Received: by 10.223.185.116 with SMTP id b49csp5361395wrg; Wed, 7 Mar 2018 10:25:28 -0800 (PST) X-Google-Smtp-Source: AG47ELvu6cc1jDW//jloX2kh9Vh+2aXFPtRsRIMyBom/8ebYcViIwIl9ISl9qwP2+cN7zkiUq3qv X-Received: by 10.98.17.147 with SMTP id 19mr23266613pfr.160.1520447128797; Wed, 07 Mar 2018 10:25:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520447128; cv=none; d=google.com; s=arc-20160816; b=Hpiqe4zb0Dr+7K6U/JhWjPai0Rc70+1QcazRdT1GzahzChXG4+tQzsdYGfvUTgXyvc yJcgP2d/O24NnabSU2ppt93NoeqaXgkrclShM7z1Jyl/1dxNnakoDuKOzLFiXL35WMbE mt2YX4yPztNuNykV3b/ixD+mLLBLXaLw4zeTkA8dArt3RP6apm5cPUTxL0647ExrDpfS VDxCsBvTBf/iQYO35sptG4Hzg+shSQze3cjLsrptcg0m0ufZ+vDY8/blpCW+0O4otcaE PmKtOpJBGy2Nb0Eg5+smYZIYsjqh4qKWlUFQZKxk7md4HvYORd5gIX98G09hKEvRnDSI e0iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=ijdTGma8BL7LukFpzTjgOZlXyhdvSMs4AbGu53xpNc0=; b=VUg1XCeSzecThdta4U4z68ghGC+WevpLaTk7rZ/F0QP8sweU9/PJrg9KkAk0ivauLx HkrCu/d+L1Y4X8nkg7pKcXk0gxdmFfsQnQ27gWdfAe7xUcw1ncwkV3hyx6nrvhgpG8zh J6vc5I+6jjcAVZntJS4Q74nNBLGdrVJLw2xrz4q45rx3j1pzgsPqC0qerFqd/bWZ49HZ W+DXTKHyb7BTWM3sQx8JeqUaL7kMjVKuxMz+fxZyN+Evmyd+3NrLLVsYM1/SA+TYzdPh wayCDDdJQxhPsty+N4LvfteWezMdVI5yfaxnpJFTc3Ywq4LscOKu/OWJSyv45uwi6sjV aSSA== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d9si9737930pga.789.2018.03.07.10.25.12; Wed, 07 Mar 2018 10:25:28 -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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933537AbeCGSYL (ORCPT + 99 others); Wed, 7 Mar 2018 13:24:11 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:41324 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753949AbeCGSYJ (ORCPT ); Wed, 7 Mar 2018 13:24:09 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 301BE814F0CF; Wed, 7 Mar 2018 18:24:09 +0000 (UTC) Received: from flask (unknown [10.43.2.80]) by smtp.corp.redhat.com (Postfix) with SMTP id B12722026980; Wed, 7 Mar 2018 18:24:06 +0000 (UTC) Received: by flask (sSMTP sendmail emulation); Wed, 07 Mar 2018 19:23:28 +0100 Date: Wed, 7 Mar 2018 19:23:28 +0100 From: Radim =?utf-8?B?S3LEjW3DocWZ?= To: Matthias Kaehlcke Cc: Paolo Bonzini , Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , x86@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Guenter Roeck Subject: Re: [PATCH] KVM: x86: Make enum conversion explicit in kvm_pdptr_read() Message-ID: <20180307182328.GG12290@flask> References: <20180226224224.244247-1-mka@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180226224224.244247-1-mka@chromium.org> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Wed, 07 Mar 2018 18:24:09 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Wed, 07 Mar 2018 18:24:09 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'rkrcmar@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2018-02-26 14:42-0800, Matthias Kaehlcke: > 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: Yeah, expressing this in C type system seems impossible. > 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 > --- Applied, thanks.