Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1541189pxb; Fri, 20 Aug 2021 07:57:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxmUOSy69WcLp8/s+3gKBjpR4S1qbDNOVEtoe00qNmFeknR46WB5rPHZdtr3ffj4I8O8Pqf X-Received: by 2002:a05:6e02:1c2b:: with SMTP id m11mr13787307ilh.242.1629471455435; Fri, 20 Aug 2021 07:57:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1629471455; cv=pass; d=google.com; s=arc-20160816; b=c38t+ICmB5qcE2Bu+g6cRaIdoXsjJsksOwZ+w57JoJZ289iRmamfkoabyFYtr9Vgcd 3VRO4OfnQnxs6ASxfEuZ5D/C+qloaYD6BVY9nAv26N9CPNz0zfCsp2SkfUrclDe7bm14 cEi9wsc/+fJ2u3K5k5QNtjhq3rMngVzrboNMsIJb33mbl1AtMpln/ZmbkvhMJS5gQ10Y 81pKyzqgv8a43j36mFkEarAyCuvl+/VLwv8I18LGxt1/OiOGKolJ480f/Rs+7o+H7uGu LZAFOXtqv5FgEJfQVD0q5YF9DxBvWsYDyuk1tBNY+Czk5p31VVeiSaGLMqCLTq2h9Onq 5zEg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:in-reply-to:user-agent:date:message-id:from :references:cc:to:subject:dkim-signature; bh=st7DanAfCoyEPAyUxtCYse+q/9ieuX9I1N5Q9M2Pfes=; b=Frj9h7HrOtgKLy1rXeMySXu4WQ4uiephyXcR7SoMPnZHtjn2baYWF4hLfS9HpesIUM A287xzPIgntL/y82M+lOgsdmx4P2MRKsHCd9in9Os2QO1bFq43TTCqtBtpjl1HsbT4E1 awF05TiAbUPoooK3cjhlRSLs+YOPLaqoPz/VzgwLERXLhseXHqDR4vlbTbUyEWXpXIcH OWf2dP7UAOo6nLmdapJQ4ByHbyaLCFRX9w/ZoywVPEypzXZhMsd56y/P2T/4gukfHy+9 Vmgjv7OkFZPLiqNVA86sV6qKFC2XfyLKHBWOuReYVZ8PgVL2Hhfjn3oCRsBUi+o/Glxm PbDg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=eymBB1ai; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n16si6213014jao.126.2021.08.20.07.57.22; Fri, 20 Aug 2021 07:57:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=eymBB1ai; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240607AbhHTORL (ORCPT + 99 others); Fri, 20 Aug 2021 10:17:11 -0400 Received: from mail-dm6nam10on2058.outbound.protection.outlook.com ([40.107.93.58]:12196 "EHLO NAM10-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S235032AbhHTORK (ORCPT ); Fri, 20 Aug 2021 10:17:10 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mooVY6gFvaoP9Z81RLDpfKVIZi1STZM4cSlpzyPSfwlUqlg5exQNCcvRkWlLIyO08U0jVRwL92yTGfafE6OORDElRaAMTR6uZYf8s2x9Keq05u5H+wARISsL9aL69l06c1sJO2Hqjg3MFrCSWB2roBvrkhL9lKjrnqxpUCrxXq4XiYIGeN15/eXvKTrkzSVf7YmCfiqPUpD1DzAJby2Wv/zhNhcuOCh/ukfecG/XwqvZ28ttcVZVmO3+GtSwfaNuipF5E5Nhx4hVmeyECoIXupkbM0E3epD3wxTqMJSTnWrH6wGR2zUV4fDDb1985quqn0XXBrb6mKZu4ny8a0u11g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=st7DanAfCoyEPAyUxtCYse+q/9ieuX9I1N5Q9M2Pfes=; b=gZDJ+7GmFQDMNsge5KTXf30pHxDBZhpyrWnHfX4PKturHyjSgrhbBJkhxy8d2GJTjYK8/0VCDgnhorzNgBPmaau3/a5P9OITpqy6Llmqc4N4DydD+nGgt55Dvg9r+VRlFGVLQyHukyyOvrCFTQlrDse4AlBVjgFzSYx64Jo81XFV6PkAnhnBh8AhPVgadIHdQH2tZZWjIVava3ctpx1480MmW4j9ZGzQg35DUhTS2n4U5vfqtXjmJ5j+0BUuMcorDAX2VBBTTzBXUTn+Pq/DMl2JZ9cblZBKwRKBvpyrLDdVA1piSipp2n64yhlT3gxHFE3yxn8PgpksljMj6Tsh2A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=st7DanAfCoyEPAyUxtCYse+q/9ieuX9I1N5Q9M2Pfes=; b=eymBB1ai0BA3Ha+WGzKTiDks2wt7dvkrTTskgvyahjc9+XrgdGuxqW4pr8PzdIQHRcv1jhgVR1y/RvrEfvWHnaqCNL2GX/UQWczKsgFzeP+iwIAB3Ck0RM5lM3mjtyl3SVrzuECqHFEGGcVCgE2bhNxmek03FujE+3h0Ljo7dNw= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=amd.com; Received: from MW3PR12MB4553.namprd12.prod.outlook.com (2603:10b6:303:2c::19) by MW2PR12MB2539.namprd12.prod.outlook.com (2603:10b6:907:9::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.24; Fri, 20 Aug 2021 14:16:30 +0000 Received: from MW3PR12MB4553.namprd12.prod.outlook.com ([fe80::3987:37e5:4db7:944e]) by MW3PR12MB4553.namprd12.prod.outlook.com ([fe80::3987:37e5:4db7:944e%8]) with mapi id 15.20.4436.021; Fri, 20 Aug 2021 14:16:30 +0000 Subject: Re: [tip:x86/urgent] BUILD SUCCESS WITH WARNING 064855a69003c24bd6b473b367d364e418c57625 To: Borislav Petkov , Reinette Chatre Cc: "Chen, Rong A" , kernel test robot , x86-ml , linux-kernel@vger.kernel.org References: <6118d218.4ZZRXYKZCzQSq1Km%lkp@intel.com> From: Babu Moger Message-ID: <20d8842e-197f-e413-2588-92652c1dcb47@amd.com> Date: Fri, 20 Aug 2021 09:16:28 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SA0PR12CA0006.namprd12.prod.outlook.com (2603:10b6:806:6f::11) To MW3PR12MB4553.namprd12.prod.outlook.com (2603:10b6:303:2c::19) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [10.236.31.0] (165.204.77.1) by SA0PR12CA0006.namprd12.prod.outlook.com (2603:10b6:806:6f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Fri, 20 Aug 2021 14:16:29 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 69df8bd8-3b3b-410b-8ef0-08d963e51b0f X-MS-TrafficTypeDiagnostic: MW2PR12MB2539: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uiaUL5Y3JSoBF9dk7iuY9KQN9EbV0SX0WySnD8SRyYnA1auyaVPsO+ah0ebVsjXgDBV/AGq43mJYqbn84s/qRo2zFFi3dZgDRJSNH6IaOYKijdeWpGQy1gpULR4ecl2OQWbIiEB6LaO4TVSoqjFN19JiUgwg9A7c4qRWp+Gh+KjJDh61YyhFNrdVsFunnXl3WzSzVxUTSgTQCezvTjUxtslCyQjiQwU8Qqv88RvpS9hswdDn0aC4kxivOog3sKJCkFPvOMgZiyCaACtwCra0oj1O11Z28czgcWnCE5EzfMKMMkrHOL2g0w8eL9B5IWqykXkLeOcoG2fTJVLbV3t5nxCg6prTeCBrhJRNmUOyTDql7IHJaqT3WXHXomy/Jg7waMn0RTTTsvhJ4HbPAzWx3SJZ4eylPjiEheGT1n3Wr40MzTk8CA7nQIQjAT2QW4DenJAvP424BDWqBvqCTs8sWOTR5B7zFHMaLPSUU/26/OP3sCS75N0ZZhbpX0xnBJE6Fz5gIwtJpnSeutT7rYC1k8ZbMzqQgh5xoIIFbDAUqM6raMYE/9zCAgpT0c4m5jF8SWEU+L/UhSbBlNYOD/BqVzmlWQ39YvqZBz2lyED+qWJp0rzm2Onv4YGTxSYREFzIN3r4cGhDHw6OB8TiS9AirZuIYGefzKLVRt4vjkGS2jPyYkGoNWvhL1WR2YsmHQ3cnWWoO9vJv/j1jDeH4LF9alikPSV0f4+guDz/vt/bYgK1wlq/InqtP6p5ioUxMBL+cU6RtHcJPXoHiD9Wu2kQ9Q== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW3PR12MB4553.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(376002)(136003)(346002)(396003)(39860400002)(66946007)(6486002)(26005)(52116002)(8936002)(53546011)(54906003)(110136005)(66476007)(83380400001)(5660300002)(31686004)(86362001)(8676002)(316002)(66556008)(16576012)(36756003)(4326008)(44832011)(2906002)(38100700002)(478600001)(186003)(956004)(31696002)(38350700002)(2616005)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?M3VlOEtQMzhJS284WjJZVTZqMVVncVA2VjkzMVUrRSt5UG91V2lJWnArTzN2?= =?utf-8?B?SVVGNmFIYXRlZTlTemdpVFVxQzN4ZDhhakxSd0l3ZjdHbUYrZElQNHhVNjlm?= =?utf-8?B?OVQ1dEltbWMySHYvNSsrd2NTNnZObVhqblkvZnR0RC93WVJpSSs5YWZRN0hx?= =?utf-8?B?WEhwQi9jRXM1ZmF5Qnllc0RXUDNHeDFRd1N0N3RtOUxXWDdQMncxYkxGQm9q?= =?utf-8?B?OUhESW5saDBPV0dsK3kvSUNsbm00WUxTVm01amwxSDlCVTB5YUNZNzRrMFFX?= =?utf-8?B?M3ZvN1NoSDlremdrU0tTVURiSUJzWnY1bzdqNk5LZnNubzU5QWlhSWczTldQ?= =?utf-8?B?WjlzeEFhMWFEWWZaRVFQR201bEZodVQxYkpTWmZheVRTUUxJY3VrTm1SRUlC?= =?utf-8?B?a09SSTROQUU5NDBDVGxNbHpyS24rRkgzNFpaMWZNazVGdEJNUUtNT211dUVS?= =?utf-8?B?Wk9KSTMvcXo5ZTZ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?eWJuTDQ4TzBjR2M1TmxuK0ZSSW1aenlIZ0ZhZTdtNXpTN2dxNmp4b3UyUUtu?= =?utf-8?B?YU1BdVVndUEvd2d2VDB0RmhZK1J1VDNHa0RWVk5NRlZIRTI1K3NvU0JUL3p5?= =?utf-8?B?cGQvb0pqZDRxazFGSVd4aEhka1Z1QjlnYnR2Vzk4bElXeDg2dXhpU29Ma20v?= =?utf-8?B?SjNzcXJlWEdtK3JSd3RrTDZXWWY0K2xUYk01aUs4SHVhREh3ZVA3TjVyU0R2?= =?utf-8?B?RHl5UVlBNlplTnUwaE5qMEVQbjVUK0MrMmt2VTRpd2Y0d0pvQ0hiV09oem9j?= =?utf-8?B?cUlYaEVvWXdoL0laQmVXR3RGZ1RVbmVBa00zcXV6Q25qMGJrVnl1UHhHeEFt?= =?utf-8?Q?HJD26Qwfj0WnJFSoWZbbfwREi3nuZaRE2mIbnq/?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 69df8bd8-3b3b-410b-8ef0-08d963e51b0f X-MS-Exchange-CrossTenant-AuthSource: MW3PR12MB4553.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Aug 2021 14:16:30.3435 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 8WMiZasI+ESH20Zn97pli7YWA5oYYkIlc1dYEXpKZbzFT46YyBBrOz3snCNzJ+7X X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2PR12MB2539 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/19/21 4:05 PM, Borislav Petkov wrote: > On Thu, Aug 19, 2021 at 01:39:46PM -0700, Reinette Chatre wrote: >> I can confirm that the removed comment explains why m would be initialized >> when used in the code that follows. >> >> How would you prefer to address this? We could add just the comment back in >> support of future reports or perhaps by adding the default case back with >> the same error that would be returned earlier when there is an invalid >> EVENT_ID. Something like: >> >> ---8<--- >> diff --git a/arch/x86/kernel/cpu/resctrl/monitor.c >> b/arch/x86/kernel/cpu/resctrl/monitor.c >> index 57e4bb695ff9..05b99e4d621c 100644 >> --- a/arch/x86/kernel/cpu/resctrl/monitor.c >> +++ b/arch/x86/kernel/cpu/resctrl/monitor.c >> @@ -304,6 +304,12 @@ static u64 __mon_event_count(u32 rmid, struct rmid_read >> *rr) >> case QOS_L3_MBM_LOCAL_EVENT_ID: >> m = &rr->d->mbm_local[rmid]; >> break; >> + default: >> + /* >> + * Code would never reach here because >> + * an invalid event id would fail the __rmid_read. >> + */ >> + return RMID_VAL_ERROR; >> } >> >> if (rr->first) { > > Right, I would normally not take a patch just to fix a tool because it > cannot see it correctly. > > But Babu has another use case which breaks the build so I guess that's > serious enough to make an exception. > > Babu, can you please explain? Details: The patch applies cleanly to RHEL8.5 tree but the build fails with an uninitialized variable warning treated as an error. The RHEL8.5 Makefile uses '-Werror=maybe-uninitialized' to force uninitialized variable warnings to be treated as errors. The build error was found while using the redhat/configs/kernel-x86_64.config kernel config. BTW, the 5.14-rc6 build passes and it does not build using '-Werror=maybe-uninitialized'. The error from the build is below: arch/x86/kernel/cpu/resctrl/monitor.c: In function ‘__mon_event_count’: arch/x86/kernel/cpu/resctrl/monitor.c:261:12: error: ‘m’ may be used uninitialized in this function [-Werror=maybe-uninitialized] m->chunks += chunks; ^~ The following patch fixes the problem. diff --git a/arch/x86/kernel/cpu/resctrl/monitor.c b/arch/x86/kernel/cpu/resctrl/monitor.c index 57e4bb695ff9..553cc6410442 100644 --- a/arch/x86/kernel/cpu/resctrl/monitor.c +++ b/arch/x86/kernel/cpu/resctrl/monitor.c @@ -304,6 +304,8 @@ static u64 __mon_event_count(u32 rmid, struct rmid_read *rr) case QOS_L3_MBM_LOCAL_EVENT_ID: m = &rr->d->mbm_local[rmid]; break; + default: + return RMID_VAL_ERROR; } if (rr->first) { Reinette, Are you going to send the official patch or let me know I will send. You can add signoff from me after adding above details. We probably need Fixes and Cc: stable@vger.kernel.org. thanks Babu