Received: by 10.223.185.116 with SMTP id b49csp4282461wrg; Mon, 26 Feb 2018 14:43:35 -0800 (PST) X-Google-Smtp-Source: AH8x224t5J/B2fSbR4+f0/YQfinsm1YWDP5ngA7YM6bFu5LNpYStTjTt5WFtR+9HMSl9FbSFZPBO X-Received: by 10.98.137.147 with SMTP id n19mr12209273pfk.193.1519685015714; Mon, 26 Feb 2018 14:43:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519685015; cv=none; d=google.com; s=arc-20160816; b=bxccmJYxL3mmZ8V1abyQJJtuPxepKxNgQSaF3gjtcuNkgaas7WE19Lx6ZeKfwlchQ6 DEDgAS76z3NumNAi0RRnVfhj6WWWGJSFjXDmj9lQQ4e0VFTxnaOAI3mSSpBNUbc0D6DK mbzJO/z0j7Q4jdwERwRdJpZHtNYjm+AvniyqTaD9yZp0ylqQU1aJi2IxG9kcaz78fLSd LjsKBH34CNRLF8N/dwJ7ElzZ1UQtbZhUXnHaoWqPLqxq35SYaBdNIp3odsFieONHn0I7 y4fduhbMu9UhynS0+itSbyKL5rCmV47GW0+3MOoWX3gull3BrdCoOEohk1FnH1UlW+GX KyvA== 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=ALNAWDjwmq8iZxep8XaIfm5KMLgeuLLFN13RSmD1eN0=; b=f7EwMAcj3p58RhKhDj3oNdAJmTZMrBlBAoK9UrqnwZfzqUONxSSHfm/250whZ3XOEX M2C0wxNY42pimIh5jXvEfVRRfKajMO5BGoZdY6jc/iy/ovhCMquDtJkTLEP1AxcHz5IE iP6EDjjJkIkeksFMekmTVmeiq3m4m2MpgI4pRhcgrr68kaErv/g0MBA5PcUD8VEMw0zf rKxI6iyhsUHKKWmgUKzAM3bwM59xFFOMHNEBlvcZu3AnyjiJClqbMwoT1s9JlumZ2xZ8 PST7LHObMdoFfeGjn83XM3QRkbLKEjZLSr5QVJrTvKKqqOM8q7BUVnsCvu+wFAnaFbun UVxA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r65si7464432pfa.79.2018.02.26.14.43.19; Mon, 26 Feb 2018 14:43:35 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751552AbeBZWmk (ORCPT + 99 others); Mon, 26 Feb 2018 17:42:40 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:37162 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751411AbeBZWmi (ORCPT ); Mon, 26 Feb 2018 17:42:38 -0500 Received: by mail-pf0-f196.google.com with SMTP id s24so7133914pfm.4 for ; Mon, 26 Feb 2018 14:42:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ALNAWDjwmq8iZxep8XaIfm5KMLgeuLLFN13RSmD1eN0=; b=buTg9aedUut7pQjwzG2wfPQ3DoEyss6asKIMAL2KQkmv3Ee0gFPXqWz8+AVlL1QdKX TNVFAAiTbVyGs077E4tq/CzT9qZHp+whC6imftz7sV97K5YW1CnH02eA17+DvmJsqb1l iNbnRIl3pOqSS5JOIvSW5NCfL4Gzin7bnzVeXDh0Dj7rzgYDW/MHw0hJw/UKwA2mT7+o OY/tc8hsoy80zRp0jqyPoqI7vg4g4pctoLpwB6jLnjRKANgskgipOtY+rC9O6aWn0CeL VuFlfvEmmn0DsGn/+IOulYV2XBsZdVoNiC/bRrMlAEY7LgZNtTdw7nBgE6wGJRoEkhi/ U6rg== X-Gm-Message-State: APf1xPAJ6OPHw5dOJslGDnR0eRos/7drUvrfGJlT+gh/b3Mdz7gtLMd/ xb3iJafGRhsyRuWlI/WPTO3hmg== X-Received: by 10.98.74.67 with SMTP id x64mr12084759pfa.135.1519684957712; Mon, 26 Feb 2018 14:42:37 -0800 (PST) Received: from mka.mtv.corp.google.com ([2620:0:1000:1501:8e2d:4727:1211:622]) by smtp.gmail.com with ESMTPSA id 10sm21714963pfq.51.2018.02.26.14.42.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Feb 2018 14:42:36 -0800 (PST) From: Matthias Kaehlcke To: Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" Cc: x86@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Guenter Roeck , Matthias Kaehlcke Subject: [PATCH] KVM: x86: Make enum conversion explicit in kvm_pdptr_read() Date: Mon, 26 Feb 2018 14:42:24 -0800 Message-Id: <20180226224224.244247-1-mka@chromium.org> X-Mailer: git-send-email 2.16.1.291.g4437f3f132-goog Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The type 'enum kvm_reg_ex' is an extension of 'enum kvm_reg', however the extension is only semantical and the compiler doesn't know about the relationship between the two types. In kvm_pdptr_read() a value of the extended type is passed to kvm_x86_ops->cache_reg(), which expects a value of the base type. Clang raises the following warning about the type mismatch: arch/x86/kvm/kvm_cache_regs.h:44:32: warning: implicit conversion from enumeration type 'enum kvm_reg_ex' to different enumeration type 'enum kvm_reg' [-Wenum-conversion] kvm_x86_ops->cache_reg(vcpu, VCPU_EXREG_PDPTR); Cast VCPU_EXREG_PDPTR to 'enum kvm_reg' to make the compiler happy. Signed-off-by: Matthias Kaehlcke --- arch/x86/kvm/kvm_cache_regs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kvm/kvm_cache_regs.h b/arch/x86/kvm/kvm_cache_regs.h index f500293dad8d..58ba12071014 100644 --- a/arch/x86/kvm/kvm_cache_regs.h +++ b/arch/x86/kvm/kvm_cache_regs.h @@ -41,7 +41,7 @@ static inline u64 kvm_pdptr_read(struct kvm_vcpu *vcpu, int index) if (!test_bit(VCPU_EXREG_PDPTR, (unsigned long *)&vcpu->arch.regs_avail)) - kvm_x86_ops->cache_reg(vcpu, VCPU_EXREG_PDPTR); + kvm_x86_ops->cache_reg(vcpu, (enum kvm_reg)VCPU_EXREG_PDPTR); return vcpu->arch.walk_mmu->pdptrs[index]; } -- 2.16.1.291.g4437f3f132-goog