From patchwork Mon Aug 20 21:37:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 144670 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp4470118ljj; Mon, 20 Aug 2018 14:38:59 -0700 (PDT) X-Google-Smtp-Source: AA+uWPx2DlEznS9RJNbAzUnrNmcrjsJGe/0LFA3cFO2kQmrKrgXF5SPVK96cCa4cWhcV3raNmNtt X-Received: by 2002:a17:902:6b4c:: with SMTP id g12-v6mr46850782plt.159.1534801139600; Mon, 20 Aug 2018 14:38:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534801139; cv=none; d=google.com; s=arc-20160816; b=UcRsIw5owxv/Hj6FqBGJISCs9YCftijU/HZZsu9bkB7LZidBGgXB9HXN51S2m0jIBP q5rvadNEgKIFO+0NV5ae9s2PJKwz1eNa8kO7Wy+Oun3Bd3wHWqpkm8sQUXQOi1MlvXUy /+MKkBo/951UJMEZt3goOApcBMAAl9r6rVikzJkmHYTsxqJIGIyGqivCd5Hx5QS4wuu+ Pu/OJ86fuVQ0hcbupae3iGv7dZsDtCt0u6R4Xbn2jbbTHpWkJ35M2Ln+MSFwFNOFGtvU 99Rv03PDKAEMhST0j9xbOP0U6bKJelv1HRlxnSjJJKmEi1VmGDOL094Q/mzM56/gbrH0 1WkA== 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=dAIIsAG7w1GilTndfOMsBD2piK1oRck7DliKYPT0tec=; b=S3d7Aem7DCp9ruZ2jyCsMMvfSPI8lAi7UxJqUqX99ijJ8a8R93EyEXWihioRLhC2ty kMyQjTtHYxfwHq24N7HqypFMRNxTxKB7X+iCTsK1FbCTU/ygtOytzmfSuLdE4So/ygtZ ySBtcSyFeaaQuTEniwOvGFspRQr+ysSYnpxgamk35ald9AUwT8RTqz2cAh4hyH0OYNRq EjsvdgnsLimFZGDY4xtoekpP66Bf0jLKayY8UEHmUfd9dBRtLIQ8CcvIgPXYXQvXc2bV GIh9O0qy3qyAbyEqnauVwjNkKV4I3Uf+km/eKfLzqJNAhWEkOkkxeokTsRfx3TmKbnq4 g3/w== 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 i5-v6si6219408pgc.607.2018.08.20.14.38.59; Mon, 20 Aug 2018 14:38:59 -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 S1726816AbeHUA4O (ORCPT + 32 others); Mon, 20 Aug 2018 20:56:14 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:57116 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726649AbeHUA4O (ORCPT ); Mon, 20 Aug 2018 20:56:14 -0400 Received: from wuerfel.lan ([109.193.40.16]) by mrelayeu.kundenserver.de (mreue001 [212.227.15.129]) with ESMTPA (Nemesis) id 0Lqqpv-1gLxpo0gGB-00eZKM; Mon, 20 Aug 2018 23:38:11 +0200 From: Arnd Bergmann To: Paolo Bonzini , =?utf-8?b?UmFkaW0gS3LEjW3DocWZ?= , Thomas Gleixner , Ingo Molnar , x86@kernel.org Cc: Arnd Bergmann , "H. Peter Anvin" , Wanpeng Li , David Hildenbrand , Liran Alon , Christoffer Dall , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] x86: kvm: avoid unused variable warning Date: Mon, 20 Aug 2018 23:37:50 +0200 Message-Id: <20180820213808.2258428-1-arnd@arndb.de> X-Mailer: git-send-email 2.18.0 X-Provags-ID: V03:K1:NZJJBIUxDf6HoOh1NyOEmX5lWi6+o5MaADGA2G+FO9mqEvIOiod XrqIAXrsqKHqiZF7pg9VHiRv3nbyXXsdyxvTuZ0GLqBXY7s2bZkKcl5dIUcJ5CXlAVd1/Ct qPkBAyZZRGGet4FGVGcwdbzwOaMvUA/2HFueX7aSWil4tmypF3mJIhwY0BCaqtLjhxtvXDw uen6Hn7QeA5McFK6Qp8UA== X-UI-Out-Filterresults: notjunk:1; V01:K0:4Dlp5PXFFxs=:3eCRueqQZ5TXjw30/h+Ahd j/H5JyI6I4lUDQLgCCibcsz2T0WneoRUeH0XIYkiWJIA2R3ek8eQESt/ut7EeMxqNAe6S97Zc vMfaRAZNsEOTsZ34JXSSuT5stscjceH63QQhTbUZKXusVurTyZxLfvGbbga1EI/svq1wdYvap u/VYT9ydV3eTR6Lx7Z4ImX4XXPW1YMYwVRTDPH/WU9jYPtrPSDZMR4g/oelA5p2His8n5IMdS eSunSLvcmQFUlaeLolmnIgesN9+glEkR+o3mn7Q/HCcMVBiaj1dP49dqfs3DUU7XMmLynk7DS ZEP/wktgSsTNa4RXw/kJO9xQF8qByO4BY1VF6DRp7/8HqlCivznxB7W54FS2lQf2U5WhrDPQb 0S3xNyvnqZWXEv35+IMkTGvqfVHeYEn6roa/UGjfcs/tidcDR/zutBfAnxiArbyQasKijORfD 02NrbiJTyODkaPazzqN5k56bN+PJff6oC4yoJ073DSPLYXUSfQvhMTGOUH7wE4aYVMC+8LNrF nEK256lSK1I1GyUMbhIhsDhtP0UQ0uBlcqxfTynnaGtys1IRo9k4Ie2SOFF7rNCzGdB60zB8g TYtuite5wCBenMmYZDiw3+5By1xt2fYTEzod0HKTF3kvUbbBwBPRdblY431wG7uXNsT3t1PEA NJKFLxfeQ1+d1w/zercPvxWiCwM7EDGtCZ6Eqhx/dbC0EGc1tPbKgG3alwPSZt7RJwMc= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Removing one of the two accesses of the maxphyaddr variable led to a harmless warning: arch/x86/kvm/x86.c: In function 'kvm_set_mmio_spte_mask': arch/x86/kvm/x86.c:6563:6: error: unused variable 'maxphyaddr' [-Werror=unused-variable] Removing the #ifdef seems to be the nicest workaround, as it makes the code look cleaner than adding another #ifdef. Fixes: 28a1f3ac1d0c ("kvm: x86: Set highest physical address bits in non-present/reserved SPTEs") Signed-off-by: Arnd Bergmann --- arch/x86/kvm/x86.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) -- 2.18.0 Reviewed-by: David Hildenbrand diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 4a74a7cf0a8b..506bd2b4b8bb 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -6576,14 +6576,12 @@ static void kvm_set_mmio_spte_mask(void) /* Set the present bit. */ mask |= 1ull; -#ifdef CONFIG_X86_64 /* * If reserved bit is not supported, clear the present bit to disable * mmio page fault. */ - if (maxphyaddr == 52) + if (IS_ENABLED(CONFIG_X86_64) && maxphyaddr == 52) mask &= ~1ull; -#endif kvm_mmu_set_mmio_spte_mask(mask, mask); }