Message ID | 0da9874b6e9fcbaaa5edeb345d7e2a7c859fc818.1696271334.git.thomas.lendacky@amd.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2a8e:b0:403:3b70:6f57 with SMTP id in14csp1700371vqb; Mon, 2 Oct 2023 14:27:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHUU6KVhQnd8X6pbSpRU15gOW1AlpJL2SxiW8V3rwCfs6s9KyTZr5CUOcQ6mG5M90d5M1QX X-Received: by 2002:a17:903:48f:b0:1c6:3228:c2ca with SMTP id jj15-20020a170903048f00b001c63228c2camr12077512plb.29.1696282046285; Mon, 02 Oct 2023 14:27:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1696282046; cv=pass; d=google.com; s=arc-20160816; b=kMFlj2eSoepmVuo0iMBo5fUNM1z76e8cb/uy6IyYoq/xnfHn/Yvly/1Pq5jukb+pQk JsgBCzkwBi1cSBWVQ+EUTX59PH098WzBK6VwUR2+p1OyTJ8ENEHkN73zfIq7EyZUHVNh ajaAQig0NgGIKJzWx1ZFQu2Laco6EjAIgmKFfArq2hCNJ1+XlIkrswyANN9WcAb9pVSO osFXCKG8AWpDz83TPMXPxnig1GoRPUj/w6jacE9+d36EOwNRnGwujKxMx1+AnnujGaFl XjRVqB5/KAezxGKWis2BSKgqaLVqArwyMTkbyERK66QkSQtBJNXujtx73+d5K0tIxKVT VuCQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=3QS1TYuvO7jMxlCBmhMisG6uAYoxhO8OElCqBDKdW08=; fh=Q9xU3UhrlPfcBcH5RgJhjCQenmAwdQPsqqJ2qs+ufq8=; b=YRPTWj6R+AdyJa0Kd6joe/rASAO13W4LkckzgAZPH+Ee77MWdk4LDfV6dFpGuS58MX HBn6milzxAOVxnD3iw0mOE1hnq2MOVDJq2ryYgPgIU0dc2JqQiixWxXFh6v8X/9+MNkW Wrl5525eE0WFrg3t4PibcEbOAM313AJ9ZUenTVdHNNytWC5gkEO6GBRgG6W9/H9xifX2 ygR69uITiZUFkAJGYYMGx8qEUCyzvhqBuYslh5z+yQ8F9hGGtzTXiOlhKOzIUra3/2w7 KA5I2HNo9fB1Vzxh4pmiSwzs3aMhaaPONJPVZF2Dw7YLDpRORtyuIMZVZlv3gaGLFapG GEgw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=D9jnXHLx; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id s2-20020a170903200200b001c43fce9c7asi15416588pla.444.2023.10.02.14.27.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 14:27:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=D9jnXHLx; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 097788148BB9; Mon, 2 Oct 2023 11:29:43 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236879AbjJBS3T (ORCPT <rfc822;pusanteemu@gmail.com> + 18 others); Mon, 2 Oct 2023 14:29:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229538AbjJBS3S (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 2 Oct 2023 14:29:18 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2043.outbound.protection.outlook.com [40.107.244.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF511AB; Mon, 2 Oct 2023 11:29:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UnzoT0lpK/hgHiYt4AWTlDAE3TillHek6XzKgHNGHjYg8h0tlRI/powPz/dmvRNTwuoYt9htK9Q4ORZYx5S97WMFCu22l8v18YyKN1c3DVIpVPD1icfBxaNS8GIpunv4MSsvGUK0DA+lx3Om2xy0+yLfM/PdBR5M3eVpPGvWYs+zRnGmFf6n/QC+h19vIkKOrmQV2Vp2FQ6xopWW3kFHHeBvwSBuuQLioQkjCqCI+ABnt9RoO/6s30/QnOJK+ISgmHK4TaBPjluiPRvN64fBcAPAriVt7KjVuwq+jbPlfHta38ntC8MLr9UJTq6m3X4HTQl8l5Sr69ppZq15W9dHgg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=3QS1TYuvO7jMxlCBmhMisG6uAYoxhO8OElCqBDKdW08=; b=eXPiacC0MFISqWTk0oit7BkfK6/Hea/0omefw5YBIPZwJ7BXeu/WsUESAj45Fd1RHCKciArPSZpBSkAfUXmc71W0tX4Trl9DU5LvfKRCNsB24uDF1hgx5fAyZlmW+vC/ZpUKbJPOAJGtL5U8VGJ4d6/xOrYX4PhOgb9whGJFSJyyPwS2noHTooUoVOnNdL7APvrmug2WmjZquvxWXTP1vU6nOdtHGp+ypu8OBXk+qjYs4YudQEB5NLmZEp7PZ9woTKs7LnGfELM5hHPGNuGGjXBikTX9AC5yxd2h3zXnxnrvQQCHRmIL65VyC/qlZpzP9pGHUCnZwVu+Fd+20i8+Yw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); 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=3QS1TYuvO7jMxlCBmhMisG6uAYoxhO8OElCqBDKdW08=; b=D9jnXHLxshEpwIYfn6jACNUjccIiO98WRadKmSU3iPWfvFz5v9NButgecSE2SRn7QSMYR1MQe2LxP57YEX5VOt3xBJyAeq9ETVvQPcutkLguep6ULY/42DDWQvagWaTJYdbW60PyYAm6UQqvlIz7Jv1IZuQIOu6vrn5WRMULakQ= Received: from BL1PR13CA0350.namprd13.prod.outlook.com (2603:10b6:208:2c6::25) by SJ0PR12MB7458.namprd12.prod.outlook.com (2603:10b6:a03:48d::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.29; Mon, 2 Oct 2023 18:29:08 +0000 Received: from MN1PEPF0000ECDA.namprd02.prod.outlook.com (2603:10b6:208:2c6:cafe::71) by BL1PR13CA0350.outlook.office365.com (2603:10b6:208:2c6::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.21 via Frontend Transport; Mon, 2 Oct 2023 18:29:08 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by MN1PEPF0000ECDA.mail.protection.outlook.com (10.167.242.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6838.14 via Frontend Transport; Mon, 2 Oct 2023 18:29:07 +0000 Received: from tlendack-t1.amdoffice.net (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Mon, 2 Oct 2023 13:29:06 -0500 From: Tom Lendacky <thomas.lendacky@amd.com> To: <kvm@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <x86@kernel.org> CC: Paolo Bonzini <pbonzini@redhat.com>, Sean Christopherson <seanjc@google.com>, Borislav Petkov <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>, Ingo Molnar <mingo@redhat.com>, Thomas Gleixner <tglx@linutronix.de> Subject: [PATCH] KVM: SVM: Fix build error when using -Werror=unused-but-set-variable Date: Mon, 2 Oct 2023 13:28:54 -0500 Message-ID: <0da9874b6e9fcbaaa5edeb345d7e2a7c859fc818.1696271334.git.thomas.lendacky@amd.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN1PEPF0000ECDA:EE_|SJ0PR12MB7458:EE_ X-MS-Office365-Filtering-Correlation-Id: 5fa65c8e-5421-4adc-2c07-08dbc375771f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: e8hTOSoF7/WjE3W2jDQU4yIlR9b6c2jzxMVA5Gl7Fs3KxANnXNWL0GpBXHv+hqsPY/5BXIJHzzsZBAfY+OQQQzmQaHJIevJ72GCOxtIcySMgJN2wPUyhB1KResNc+GvkaibQOba2FUqBAK02+0C/iT1n326H14CrPt1x0hF5Gz9W+8OGK8iicfvyvIpoRjs77jW1t4z64M2a9RVx9TpyBoRlriEAiLrBPs15s4ERTMvpkTnT89fy0jLc8sn4cSMPStlPKqL5T8utDfcEsTJsvqPXF4CMULjtNSXQTkRtDwlnBbDRlpV506Q8daU1ujO81U/VM4iyUr/zS73BYbeUjRwJLdTWTxtbc0+hnAySeKM3N9KmbNKTHvQ6PppvXUYVfj6Efoxor8t7e+FdQhFf5DLMixSAdx9th74pI6Tb5CGPWg0zGctsExbN2+izEzVYI3Q0kTKlRH400kV9KqCql4/UqaUAARW5viW08LxNWEZM2nIZ195Nd4eyOwuQ+1N1lXC2guPtdSNLKR67DhzXI6r7W1k/nGEarF1XXP80l8mPC2Vf+QFOE9FMGh9T88GPTTMnD/dW5VI1wRiCFyoisObPBm7lDfpu8+H0ZIvNWZr38DV2R/cOeT3FhnrKncWPu5Oxx0rt1vXc5dYuM7A8K9I8ufzVjhHn7sQ0+5KLN5wNb6xOcu5mBubVXqfVWp9NZfhuvyW5IcrQCUBvSMiCidmqYobDcfxAzxoZ+9Bypl4jYVonSWV86wY/gzFoZXYaVICGNYufRhALDY2SzWvGxA== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(4636009)(346002)(396003)(39860400002)(136003)(376002)(230922051799003)(451199024)(64100799003)(186009)(1800799009)(82310400011)(36840700001)(40470700004)(46966006)(86362001)(2906002)(5660300002)(36860700001)(8936002)(83380400001)(8676002)(4326008)(47076005)(110136005)(41300700001)(36756003)(336012)(26005)(16526019)(70206006)(2616005)(426003)(81166007)(40480700001)(356005)(82740400003)(70586007)(316002)(54906003)(40460700003)(478600001)(6666004)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Oct 2023 18:29:07.7678 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5fa65c8e-5421-4adc-2c07-08dbc375771f X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: MN1PEPF0000ECDA.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB7458 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 02 Oct 2023 11:29:43 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778680642948254623 X-GMAIL-MSGID: 1778680642948254623 |
Series |
KVM: SVM: Fix build error when using -Werror=unused-but-set-variable
|
|
Commit Message
Tom Lendacky
Oct. 2, 2023, 6:28 p.m. UTC
Commit 916e3e5f26ab ("KVM: SVM: Do not use user return MSR support for
virtualized TSC_AUX") introduced a local variable used for the rdmsr()
function for the high 32-bits of the MSR value. This variable is not used
after being set and triggers a warning or error, when treating warnings
as errors, when the unused-but-set-variable flag is set. Mark this
variable as __maybe_unused to fix this.
Fixes: 916e3e5f26ab ("KVM: SVM: Do not use user return MSR support for virtualized TSC_AUX")
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
---
arch/x86/kvm/svm/svm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Mon, Oct 02, 2023, Tom Lendacky wrote: > Commit 916e3e5f26ab ("KVM: SVM: Do not use user return MSR support for > virtualized TSC_AUX") introduced a local variable used for the rdmsr() > function for the high 32-bits of the MSR value. This variable is not used > after being set and triggers a warning or error, when treating warnings > as errors, when the unused-but-set-variable flag is set. Mark this > variable as __maybe_unused to fix this. > > Fixes: 916e3e5f26ab ("KVM: SVM: Do not use user return MSR support for virtualized TSC_AUX") > Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com> > --- > arch/x86/kvm/svm/svm.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c > index 9507df93f410..4c917c74a4d3 100644 > --- a/arch/x86/kvm/svm/svm.c > +++ b/arch/x86/kvm/svm/svm.c > @@ -691,7 +691,7 @@ static int svm_hardware_enable(void) > */ > if (boot_cpu_has(X86_FEATURE_V_TSC_AUX)) { > struct sev_es_save_area *hostsa; > - u32 msr_hi; > + u32 __maybe_unused msr_hi; Argh, the abomination that is rdmsrl() strikes again :-/ We really should be able to do: hostsa->tsc_aux = (u32)rdmsrl(MSR_TSC_AUX); I don't see a better quick fix than __maybe_unused though. Reviewed-by: Sean Christopherson <seanjc@google.com>
Queued, thanks. Paolo
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c index 9507df93f410..4c917c74a4d3 100644 --- a/arch/x86/kvm/svm/svm.c +++ b/arch/x86/kvm/svm/svm.c @@ -691,7 +691,7 @@ static int svm_hardware_enable(void) */ if (boot_cpu_has(X86_FEATURE_V_TSC_AUX)) { struct sev_es_save_area *hostsa; - u32 msr_hi; + u32 __maybe_unused msr_hi; hostsa = (struct sev_es_save_area *)(page_address(sd->save_area) + 0x400);