From patchwork Wed Apr 4 10:44:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 132809 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp4893180ljb; Wed, 4 Apr 2018 03:46:08 -0700 (PDT) X-Google-Smtp-Source: AIpwx49bERJ8jO9J7NjCXdAAEeVDtLd321X2t+mqQGiQMxEKquvA/Pozl1jOUtqXthmx4iLAiHHf X-Received: by 10.99.152.68 with SMTP id l4mr11428663pgo.75.1522838767903; Wed, 04 Apr 2018 03:46:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522838767; cv=none; d=google.com; s=arc-20160816; b=twupWw6aXz12r/01Vdt/LO1jOcmoLHfnGbvgUiHtwesFYrraBf9TSqGZsszh/xN2aT jPtIDxI8jl3IfYJUjIX6cUGIpqegxTnm0e8S96OOi47dhGSDDMNlw3UeSRstXA2Sagty 5pX9CMMvgzMQctNqaWodeMxwSDuEjen3/R6f2p/wD59SicGdr5wcWJVH/9TNp9Z9mP85 ZaWkD0cNaSghhpm2sOAW27AFdHL4GXGaS/Lmgazf1WUmoEKJtx9WMw8SDlQMx2swkrm9 6KFz/0eeerV5qk1J+NubyrkN3E3j23yl14LwOBDuomUiTr1nfTj7W1gRmcW8cCfxAGdD kbBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=U3NJSTaASldewSKu+N0RiopAebnFgwabt+uim4Lj7Ko=; b=MyhthOwSBklGYq7MaV0P2sDTJMdUwzgEyVxnqMyFleQKmjUaRIbzXdKyW94K5YGzQf wcLDGJ6fkEvuHPEtejrXz8UaI2gpMSBu++5ELKqXq73BBMG+mlm2sM/VprW6/wmqMy4t 5FFwKL3upJ+E5v2Lr5Hj4cwofXlJtiSn4ugIpRvT7F+F9/w1AI5xirni6kHR0yrjs6/O MsdXIB9SmGg0Z+GVxGcJdA3PkeXF7s99KXOrxfpklKVSZ/6krUZqkMBc3tndthbIlS7f PvdCwKfyB6wIEPVuplLtnouK2fdJ9X9sm/CVoIkV3QnEBP1x6Efo54hX79GncmWCJhVk iirg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u13si3540661pgq.232.2018.04.04.03.46.07; Wed, 04 Apr 2018 03:46:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751312AbeDDKqF (ORCPT + 29 others); Wed, 4 Apr 2018 06:46:05 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:48021 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750827AbeDDKqD (ORCPT ); Wed, 4 Apr 2018 06:46:03 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.145]) with ESMTPA (Nemesis) id 0LmcYl-1eVARA2R0d-00aAeG; Wed, 04 Apr 2018 12:44:55 +0200 From: Arnd Bergmann To: Paolo Bonzini , =?utf-8?b?UmFkaW0gS3LEjW3DocWZ?= , Thomas Gleixner , Ingo Molnar , x86@kernel.org Cc: Arnd Bergmann , "H. Peter Anvin" , Jim Mattson , David Hildenbrand , Wanpeng Li , Sean Christopherson , Vitaly Kuznetsov , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] x86: kvm: hide the unused 'cpu' variable Date: Wed, 4 Apr 2018 12:44:14 +0200 Message-Id: <20180404104449.113197-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K1:BQUml2M6sUsn6EsBUvm3QBmoWa0dZQc2If4szyNInaTC1IzeVPn BRG4WeC3iiWoXpHz+nhF1AOzuX770+RXs8XjOVCkJ/34YqCkPwgyyLqbhQ+1+80VdrH9Y9s 5gWId1xcHLjLcfCkuM6zGoRqboyFARgg6y3Z26hr4CU3wSE731IE2ap16yinKpCsxFE2Kqd DAW6ORpqdVpBDOAKJRshQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:ObOSg6mvcTQ=:sXibSBfEZrszB4JyYzag97 Wda+Vhag4UpkYsQOIm58F3ltcy1lziRMlDLMZ8sPD/z+vtgy8DnJ8XLKN3MgwGGhlKIDjA7k0 m77HEZduP022/iGBiKI7SyhwoqOSNo3Rw4spv523Q8GmitVP6PvZ9lk55JwG8Bugjq9Y6TkhL u3xXNsJ7gItyqt9x8WovSmh+0TjuQdI5XGM1bSytlqEk2Cba2VBQpCDFi5QhBGLqerVVDId19 d/7449AqN7BSWE8dTz/heQBjcZxW54U+1gEEaWyM4RwHrx3VP9J1AQnJ50t0oNRiHNCeEQ24B yimuj9wJVXK0ev9o4Nqgs9IAHumYx3obD6JH5lMNSBoYyVkbQIOV805YlXfEO8QB+fCE+p8O2 MCG13a4sqTPHaeYveDpss6pU/sMuEe1+zruyE2gGrIegGHwR5npeoTn40mOOqAceoPUCWgnlP AZ2gtFGcpNWXJL74DJWInH+5gUhfSEub34jzWt89GG0JzXw1AmFOwh8bKTXy6aTOaB6pECmH8 f+kogJGbVPlo/5jBbcs+Mzq9aqp9xFnLtkQsWX/BBtzl3ydk7uENR3b0xusOyhprrZshfieyY dXmuAHhdGL9NKfh40SjgLkd0cm6bbKkxxUK9lxOP/ce9pgM8rx72ZRGe6gfOMlWKoj+iOZyc6 4QYbbuGun/aoeJvU6sEgC/qYZVxzdVCnQU5e/Mg1483KE0MDxXy0xmL+iw3AhKp+xM9XWkrAw V1vOPiDDX4aD/SXVDmjHGSsAJA9GR1MQ4/W4+Q== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The local variable was newly introduced but is only accessed in one place on x86_64, but not on 32-bit: arch/x86/kvm/vmx.c: In function 'vmx_save_host_state': arch/x86/kvm/vmx.c:2175:6: error: unused variable 'cpu' [-Werror=unused-variable] This puts it into another #ifdef. Fixes: 35060ed6a1ff ("x86/kvm/vmx: avoid expensive rdmsr for MSR_GS_BASE") Signed-off-by: Arnd Bergmann --- arch/x86/kvm/vmx.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.9.0 Reviewed-by: David Hildenbrand diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 8307f625ea99..7399a4a17f78 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -2357,7 +2357,9 @@ static unsigned long segment_base(u16 selector) static void vmx_save_host_state(struct kvm_vcpu *vcpu) { struct vcpu_vmx *vmx = to_vmx(vcpu); +#ifdef CONFIG_X86_64 int cpu = raw_smp_processor_id(); +#endif int i; if (vmx->host_state.loaded)