From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.0 required=3.0 tests=BAYES_00,DKIM_ADSP_ALL, DKIM_INVALID,DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3B897C433E4 for ; Tue, 28 Jul 2020 08:34:27 +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 0A2CF2075D for ; Tue, 28 Jul 2020 08:34:27 +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 0A2CF2075D 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 Content-Type: text/plain 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=20Pau=20Monn=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) { -- 2.16.6