From patchwork Tue Jul 28 08:33:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eslam Elnikety X-Patchwork-Id: 11688669 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1082A138C for ; Tue, 28 Jul 2020 08:35:04 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E06DB20838 for ; Tue, 28 Jul 2020 08:35:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="UkyvHY+/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E06DB20838 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amazon.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k0L3w-0006Hg-PI; Tue, 28 Jul 2020 08:34:16 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k0L3v-0006HU-9g for xen-devel@lists.xenproject.org; Tue, 28 Jul 2020 08:34:15 +0000 X-Inumbo-ID: 1e8022ca-d0ad-11ea-a87c-12813bfff9fa Received: from smtp-fw-2101.amazon.com (unknown [72.21.196.25]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 1e8022ca-d0ad-11ea-a87c-12813bfff9fa; Tue, 28 Jul 2020 08:34:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1595925255; x=1627461255; h=from:to:cc:subject:date:message-id:mime-version; bh=QXuCPaBFwD3FLj/A53XcKjEkryN9839jPfi9Dd1Dorg=; b=UkyvHY+/7y2zpkdz9P4UlnlgNkdASBcStysxA4W94GCPFIGiIYleVE2G 5n3O0bUtlm4yQFSqAoEWoaVm9d1jBtIXzXEmtIIM3uURQlrLMXRnGshHB wl9G2XSHmeqdHVHmveWEOr+RbQBMQDaeolrh/fbe/b+ehzciW3kyenEYl 4=; IronPort-SDR: 6DXbhNr046JubuV4KDNdBBx9GeCIZWksuRWojQ0/uWt1YYY3eVg54fY5aVdWaznDzJdghaWPUj M8/aQ3cW5CIQ== X-IronPort-AV: E=Sophos;i="5.75,405,1589241600"; d="scan'208";a="44424179" Received: from iad12-co-svc-p1-lb1-vlan2.amazon.com (HELO email-inbound-relay-2c-c6afef2e.us-west-2.amazon.com) ([10.43.8.2]) by smtp-border-fw-out-2101.iad2.amazon.com with ESMTP; 28 Jul 2020 08:34:14 +0000 Received: from EX13MTAUEA002.ant.amazon.com (pdx4-ws-svc-p6-lb7-vlan2.pdx.amazon.com [10.170.41.162]) by email-inbound-relay-2c-c6afef2e.us-west-2.amazon.com (Postfix) with ESMTPS id DC4BDA2683; Tue, 28 Jul 2020 08:34:12 +0000 (UTC) Received: from EX13D32EUB001.ant.amazon.com (10.43.166.125) by EX13MTAUEA002.ant.amazon.com (10.43.61.77) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 28 Jul 2020 08:34:12 +0000 Received: from EX13MTAUEA001.ant.amazon.com (10.43.61.82) by EX13D32EUB001.ant.amazon.com (10.43.166.125) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 28 Jul 2020 08:34:10 +0000 Received: from dev-dsk-elnikety-1b-cd63f796.eu-west-1.amazon.com (10.15.63.96) by mail-relay.amazon.com (10.43.61.243) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 28 Jul 2020 08:34:10 +0000 Received: by dev-dsk-elnikety-1b-cd63f796.eu-west-1.amazon.com (Postfix, from userid 6438462) id 510FFA0139; Tue, 28 Jul 2020 08:34:10 +0000 (UTC) From: Eslam Elnikety To: Subject: [PATCH] x86/vhpet: Fix type size in timer_int_route_valid Date: Tue, 28 Jul 2020 08:33:57 +0000 Message-ID: <20200728083357.77999-1-elnikety@amazon.com> X-Mailer: git-send-email 2.16.6 MIME-Version: 1.0 Precedence: Bulk X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Wei Liu , Andrew Cooper , Eslam Elnikety , Paul Durrant , Jan Beulich , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" The macro timer_int_route_cap evalutes to a 64 bit value. Extend the size of left side of timer_int_route_valid to match. This bug was discovered and resolved using Coverity Static Analysis Security Testing (SAST) by Synopsys, Inc. Signed-off-by: Eslam Elnikety --- xen/arch/x86/hvm/hpet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/x86/hvm/hpet.c b/xen/arch/x86/hvm/hpet.c index ca94e8b453..9afe6e6760 100644 --- a/xen/arch/x86/hvm/hpet.c +++ b/xen/arch/x86/hvm/hpet.c @@ -66,7 +66,7 @@ MASK_EXTR(timer_config(h, n), HPET_TN_INT_ROUTE_CAP) #define timer_int_route_valid(h, n) \ - ((1u << timer_int_route(h, n)) & timer_int_route_cap(h, n)) + ((1ULL << timer_int_route(h, n)) & timer_int_route_cap(h, n)) static inline uint64_t hpet_read_maincounter(HPETState *h, uint64_t guest_time) {