From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Subject: Re: [PATCH] KVM: Directly return result from kvm_arch_check_processor_compat() References: <20190420051817.5644-1-sean.j.christopherson@intel.com> From: Marc Zyngier Message-ID: <0d34d373-5bba-2aac-2213-cf95184aa605@arm.com> Date: Tue, 23 Apr 2019 11:14:58 +0100 MIME-Version: 1.0 In-Reply-To: <20190420051817.5644-1-sean.j.christopherson@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: kvm-owner@vger.kernel.org List-Archive: List-Post: To: Sean Christopherson , James Hogan , Paul Mackerras , Christian Borntraeger , Janosch Frank , Paolo Bonzini , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Joerg Roedel , Christoffer Dall Cc: David Hildenbrand , Cornelia Huck , James Morse , Julien Thierry , Suzuki K Pouloze , linux-mips@vger.kernel.org, kvm-ppc@vger.kernel.org, linux-s390@vger.kernel.org, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu List-ID: On 20/04/2019 06:18, Sean Christopherson wrote: > Add a wrapper to invoke kvm_arch_check_processor_compat() so that the > boilerplate ugliness of checking virtualization support on all CPUs is > hidden from the arch specific code. x86's implementation in particular > is quite heinous, as it unnecessarily propagates the out-param pattern > into kvm_x86_ops. > > While the x86 specific issue could be resolved solely by changing > kvm_x86_ops, make the change for all architectures as returning a value > directly is prettier and technically more robust, e.g. s390 doesn't set > the out param, which could lead to subtle breakage in the (highly > unlikely) scenario where the out-param was not pre-initialized by the > caller. > > Opportunistically annotate svm_check_processor_compat() with __init. > > Signed-off-by: Sean Christopherson Acked-by: Marc Zyngier M. -- Jazz is not dead. It just smells funny...