[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <3b3b099c-67c6-ce31-879a-1aa4087714ca@intel.com>
Date: Thu, 2 Dec 2021 09:19:30 +0800
From: Xiaoyao Li <xiaoyao.li@...el.com>
To: Paolo Bonzini <pbonzini@...hat.com>,
Sean Christopherson <seanjc@...gle.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
Joerg Roedel <joro@...tes.org>
Cc: erdemaktas@...gle.com, Connor Kuehl <ckuehl@...hat.com>,
x86@...nel.org, linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
isaku.yamahata@...el.com, Kai Huang <kai.huang@...el.com>
Subject: Re: [PATCH 03/11] KVM: x86: Clean up kvm_vcpu_ioctl_x86_setup_mce()
Paolo,
Isaku is going to re-organize TDX KVM series based on your and tglx's
comments. I'm not sure if it's good/correct to make this series
separate. Maybe introduction of vm_type is better to sit at the very
beginning of Isaku's next series. In that case, I think you can pick
this cleanup patch separately?
Thanks,
-Xiaoyao
On 11/12/2021 11:37 PM, Xiaoyao Li wrote:
> No need to use goto.
>
> Signed-off-by: Xiaoyao Li <xiaoyao.li@...el.com>
> ---
> arch/x86/kvm/x86.c | 12 +++++-------
> 1 file changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index 23617582712d..b02088343d80 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -4505,15 +4505,13 @@ static int vcpu_ioctl_tpr_access_reporting(struct kvm_vcpu *vcpu,
> static int kvm_vcpu_ioctl_x86_setup_mce(struct kvm_vcpu *vcpu,
> u64 mcg_cap)
> {
> - int r;
> unsigned bank_num = mcg_cap & 0xff, bank;
>
> - r = -EINVAL;
> if (!bank_num || bank_num > KVM_MAX_MCE_BANKS)
> - goto out;
> + return -EINVAL;
> if (mcg_cap & ~(kvm_mce_cap_supported | 0xff | 0xff0000))
> - goto out;
> - r = 0;
> + return -EINVAL;
> +
> vcpu->arch.mcg_cap = mcg_cap;
> /* Init IA32_MCG_CTL to all 1s */
> if (mcg_cap & MCG_CTL_P)
> @@ -4523,8 +4521,8 @@ static int kvm_vcpu_ioctl_x86_setup_mce(struct kvm_vcpu *vcpu,
> vcpu->arch.mce_banks[bank*4] = ~(u64)0;
>
> static_call(kvm_x86_setup_mce)(vcpu);
> -out:
> - return r;
> +
> + return 0;
> }
>
> static int kvm_vcpu_ioctl_x86_set_mce(struct kvm_vcpu *vcpu,
>
Powered by blists - more mailing lists