From patchwork Tue Feb 19 14:46:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Lindsay X-Patchwork-Id: 10819977 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C5DA817E9 for ; Tue, 19 Feb 2019 14:47:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B43762C5C5 for ; Tue, 19 Feb 2019 14:47:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A809E2C713; Tue, 19 Feb 2019 14:47:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 28EF82C5C5 for ; Tue, 19 Feb 2019 14:47:55 +0000 (UTC) Received: from localhost ([127.0.0.1]:49921 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gw6gc-00086m-Ij for patchwork-qemu-devel@patchwork.kernel.org; Tue, 19 Feb 2019 09:47:54 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52698) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gw6fo-0007gr-6a for qemu-devel@nongnu.org; Tue, 19 Feb 2019 09:47:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gw6fn-0001bV-Cj for qemu-devel@nongnu.org; Tue, 19 Feb 2019 09:47:04 -0500 Received: from mail-eopbgr770109.outbound.protection.outlook.com ([40.107.77.109]:15184 helo=NAM02-SN1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gw6fl-0001Tv-Fk; Tue, 19 Feb 2019 09:47:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amperemail.onmicrosoft.com; s=selector1-os-amperecomputing-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dqMxihVBNNKuzkyq2dCFBjG6L/7iBPuH94KHJMxoi98=; b=IcLMmhCEH6PZqHL9K9kBeZjuMRD2ug+sGhI1uC+EltJmvKlvKdMmVEC5fDqpbqbpM0ng8HNkGlyrmGc4YSgRQyXLCi1HnqgUb8MWZZUS1dkV5YwZ0jHE+Waf+pNyQFnkqPI/J8EKfCvcccfDECuH/QlIHUZuNoJxhO6JfeImJsg= Received: from DM6PR01MB4825.prod.exchangelabs.com (20.177.218.222) by DM6PR01MB3979.prod.exchangelabs.com (20.176.73.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1643.14; Tue, 19 Feb 2019 14:46:43 +0000 Received: from DM6PR01MB4825.prod.exchangelabs.com ([fe80::8054:2484:c74a:d082]) by DM6PR01MB4825.prod.exchangelabs.com ([fe80::8054:2484:c74a:d082%3]) with mapi id 15.20.1622.018; Tue, 19 Feb 2019 14:46:43 +0000 From: Aaron Lindsay OS To: "qemu-arm@nongnu.org" , Peter Maydell Thread-Topic: [PATCH] target/arm: Stop unintentional sign extension in pmu_init Thread-Index: AQHUyGHuAxrLE/mSg0ShUL6vzJCq9A== Date: Tue, 19 Feb 2019 14:46:43 +0000 Message-ID: <20190219144621.450-1-aaron@os.amperecomputing.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BN6PR05CA0024.namprd05.prod.outlook.com (2603:10b6:405:39::37) To DM6PR01MB4825.prod.exchangelabs.com (2603:10b6:5:6b::30) authentication-results: spf=none (sender IP is ) smtp.mailfrom=aaron@os.amperecomputing.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.20.1 x-originating-ip: [216.85.170.153] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: abf2ed7e-c735-4f0f-7530-08d696791097 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605104)(2017052603328)(7153060)(7193020); SRVR:DM6PR01MB3979; x-ms-traffictypediagnostic: DM6PR01MB3979: x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1; DM6PR01MB3979; 23:8e9Ia+PL88uXCdSrTq/ib3VIZ1YTemJewa+LkZg?= =?iso-8859-1?q?WxvQOGi3Xw71PrZ?= =?iso-8859-1?q?lzYyqDhQsZSMMuPSlEQ1weC81fg9K6uOuDg78ylcTePACkxPSTZu5ci1RKy/?= =?iso-8859-1?q?Z5ohlfeQBH9wIwY+JqYsFFn+EQlGHWBhNdZ8kIjuU2mSr/YYkxTfrJJ6TuDW?= =?iso-8859-1?q?YMabioVIXLAqRPGj8B5+kPujtlyQYCh6PHS2Qd4Aoi/hxanWC0qwNUM/VoYL?= =?iso-8859-1?q?MQ7n6vqtRXFNX1NE/fpivMuKvpC+OAdjGUOPgBn/jFnem/UUhHW+5I3tW8kY?= =?iso-8859-1?q?SP7uRCB3GLocNLu+ZsMuqiyujtVtC+JgC4khNQ7MsV5iV2VrVb9pPjVMGwKv?= =?iso-8859-1?q?RZ4D9+uOdVztexdfXcRcK52jDw5HGH2q1vlOBrPHFYkI53B2LH8GAIft7S7n?= =?iso-8859-1?q?2a0qSkDHHZR3UZbOcNSYbzOHAbf+101k43HVwT0G8yQ/lOw7gW7JSHpYjpBu?= =?iso-8859-1?q?zUTb4EdYVm0pOUf8v16FTTAAcANIl+uBrc2UCpv0oAmTrp5tyFOo/ONNYNyx?= =?iso-8859-1?q?GqWeIyU5Un+p2PeG92VHcIuFjWYJV2/HiaBndO8n4qUdhkbw2dnx1JowAyT8?= =?iso-8859-1?q?6mSvlESD2QYOV3emofNhqXn2eNEsKWjdW0v2US2Llemmp1FVRrapNC3shx2U?= =?iso-8859-1?q?NFUohEt7RMBmLAyLgvq1yMaa4zMFeN4CsPooMz53jkE7x1xs1IlYQXhhiK3r?= =?iso-8859-1?q?IcxbVWPNPKVzztkjA3ArgvYV5y98BkOTvTupdUruHIS5tOjPV7F6IkFlhj8e?= =?iso-8859-1?q?ISky0CUEGEcDBoffpnOdhavZQwaH+hagFC1RhAGs5yYJ45xNRv3ocnCcZYBh?= =?iso-8859-1?q?L9KrdzetlYoKhfizVQD/Tne1j0IS+7OXpkUVAFMfE82XwYFL6dy+CwEgrM0/?= =?iso-8859-1?q?IBSeXwci4hykbHtpQ3h+o7QCaX1l6C0pCzQ4xZR1+k2D6ht2eoCMea1+WgS+?= =?iso-8859-1?q?QKwuWYstG6IZjnkOxe1kGY+JMU6fJhb0js0v4R1FWxYN2wa6/xx/HZW6bKZn?= =?iso-8859-1?q?4h2RMNawjjAjChw4Rp580CcL0ZpDnQCM0wlqG6daNBNhPHTiXzQlqH7Tf1hV?= =?iso-8859-1?q?P183gDHAnDinGmYyfFdFPi1dgDybTGMu8BeJWziI5qW88qxPyp3fRkbqoDDj?= =?iso-8859-1?q?IcrXwi0qUJIVqNKxYPNyNf0VfsAUAVTfaj9+aFHzTTtWcGV95rZVY3JSziwe?= =?iso-8859-1?q?qZe/ue/z7QLYoP9xsxwuwQ?= x-microsoft-antispam-prvs: x-forefront-prvs: 09538D3531 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(396003)(136003)(39840400004)(366004)(346002)(376002)(189003)(199004)(2616005)(476003)(6486002)(486006)(26005)(6506007)(97736004)(386003)(186003)(6436002)(3846002)(102836004)(6116002)(6512007)(2906002)(106356001)(2501003)(25786009)(66066001)(105586002)(50226002)(81166006)(7736002)(305945005)(8936002)(81156014)(8676002)(107886003)(4326008)(53936002)(14454004)(478600001)(256004)(14444005)(52116002)(110136005)(54906003)(99286004)(68736007)(316002)(4744005)(1076003)(86362001)(71200400001)(71190400001)(5660300002); DIR:OUT; SFP:1102; SCL:1; SRVR:DM6PR01MB3979; H:DM6PR01MB4825.prod.exchangelabs.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:0; received-spf: None (protection.outlook.com: os.amperecomputing.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 5sFtDtF1Ttz7FbH/eZxIUI9NJxIN6dc1vwZPx/5GKZOvRGxlgVHMBfdF623PNHIfP8/ss6T+tYdQXlnKE2WYaDBhIgrP4V6AqnDB+7InNZXlPG1aWobVwwCVptc+KaarCRAFxwm+AKqseyF8cdBPYfFUCyye64Ehtcuq+evgcIQm8rmB2d+mPQwMdnklyLfYQcpxrVB5nYLs6+9rk2vc+LUkmW1DGlGzXB7k5WTlQugh7yuriKkXRF2DKQaMUirOEm99HRGBf/W82WbU0Gad79pjK0qBAgGqoh3E+NsJLBFnIIEsHF68pu9E3aq3CTjEKB5PTD51j181cJAAn0AYjQ+eDDzUQ6LUg73uLPJspBEXkHik5Ge53QNefRGashLFMtZNNPzqxcXepkaGYid3fKr3MlFlVqdJAFRdKDlP2dM= MIME-Version: 1.0 X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: abf2ed7e-c735-4f0f-7530-08d696791097 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Feb 2019 14:46:42.9261 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR01MB3979 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.77.109 Subject: [Qemu-devel] [PATCH] target/arm: Stop unintentional sign extension in pmu_init X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Aaron Lindsay OS , "qemu-devel@nongnu.org" Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP This was introduced by commit bf8d09694ccc07487cd73d7562081fdaec3370c8 target/arm: Don't clear supported PMU events when initializing PMCEID1 and identified by Coverity (CID 1398645). Signed-off-by: Aaron Lindsay Reported-by: Peter Maydell --- target/arm/helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/arm/helper.c b/target/arm/helper.c index a018eb23fe..5a29bc9799 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -1167,7 +1167,7 @@ void pmu_init(ARMCPU *cpu) if (cnt->supported(&cpu->env)) { supported_event_map[cnt->number] = i; - uint64_t event_mask = 1 << (cnt->number & 0x1f); + uint64_t event_mask = 1ULL << (cnt->number & 0x1f); if (cnt->number & 0x20) { cpu->pmceid1 |= event_mask; } else {