[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <524b2da2-21ae-f810-c513-f1a8325f4da9@redhat.com>
Date: Tue, 6 Jul 2021 16:46:59 +0200
From: Paolo Bonzini <pbonzini@...hat.com>
To: isaku.yamahata@...el.com, Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
"H . Peter Anvin" <hpa@...or.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
Joerg Roedel <joro@...tes.org>, erdemaktas@...gle.com,
Connor Kuehl <ckuehl@...hat.com>,
Sean Christopherson <seanjc@...gle.com>, x86@...nel.org,
linux-kernel@...r.kernel.org, kvm@...r.kernel.org
Cc: isaku.yamahata@...il.com,
Sean Christopherson <sean.j.christopherson@...el.com>
Subject: Re: [RFC PATCH v2 62/69] KVM: VMX: MOVE GDT and IDT accessors to
common code
On 03/07/21 00:05, isaku.yamahata@...el.com wrote:
> From: Sean Christopherson <sean.j.christopherson@...el.com>
>
> Signed-off-by: Sean Christopherson <sean.j.christopherson@...el.com>
> Signed-off-by: Isaku Yamahata <isaku.yamahata@...el.com>
> ---
> arch/x86/kvm/vmx/main.c | 6 ++++--
> arch/x86/kvm/vmx/vmx.c | 12 ------------
> 2 files changed, 4 insertions(+), 14 deletions(-)
>
> diff --git a/arch/x86/kvm/vmx/main.c b/arch/x86/kvm/vmx/main.c
> index b619615f77de..8e03cb72b910 100644
> --- a/arch/x86/kvm/vmx/main.c
> +++ b/arch/x86/kvm/vmx/main.c
> @@ -311,7 +311,8 @@ static int vt_set_efer(struct kvm_vcpu *vcpu, u64 efer)
>
> static void vt_get_idt(struct kvm_vcpu *vcpu, struct desc_ptr *dt)
> {
> - vmx_get_idt(vcpu, dt);
> + dt->size = vmread32(vcpu, GUEST_IDTR_LIMIT);
> + dt->address = vmreadl(vcpu, GUEST_IDTR_BASE);
> }
>
> static void vt_set_idt(struct kvm_vcpu *vcpu, struct desc_ptr *dt)
> @@ -321,7 +322,8 @@ static void vt_set_idt(struct kvm_vcpu *vcpu, struct desc_ptr *dt)
>
> static void vt_get_gdt(struct kvm_vcpu *vcpu, struct desc_ptr *dt)
> {
> - vmx_get_gdt(vcpu, dt);
> + dt->size = vmread32(vcpu, GUEST_GDTR_LIMIT);
> + dt->address = vmreadl(vcpu, GUEST_GDTR_BASE);
> }
>
> static void vt_set_gdt(struct kvm_vcpu *vcpu, struct desc_ptr *dt)
> diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
> index 40843ca2fb33..d69d4dc7c071 100644
> --- a/arch/x86/kvm/vmx/vmx.c
> +++ b/arch/x86/kvm/vmx/vmx.c
> @@ -3302,24 +3302,12 @@ static void vmx_get_cs_db_l_bits(struct kvm_vcpu *vcpu, int *db, int *l)
> *l = (ar >> 13) & 1;
> }
>
> -static void vmx_get_idt(struct kvm_vcpu *vcpu, struct desc_ptr *dt)
> -{
> - dt->size = vmcs_read32(GUEST_IDTR_LIMIT);
> - dt->address = vmcs_readl(GUEST_IDTR_BASE);
> -}
> -
> static void vmx_set_idt(struct kvm_vcpu *vcpu, struct desc_ptr *dt)
> {
> vmcs_write32(GUEST_IDTR_LIMIT, dt->size);
> vmcs_writel(GUEST_IDTR_BASE, dt->address);
> }
>
> -static void vmx_get_gdt(struct kvm_vcpu *vcpu, struct desc_ptr *dt)
> -{
> - dt->size = vmcs_read32(GUEST_GDTR_LIMIT);
> - dt->address = vmcs_readl(GUEST_GDTR_BASE);
> -}
> -
> static void vmx_set_gdt(struct kvm_vcpu *vcpu, struct desc_ptr *dt)
> {
> vmcs_write32(GUEST_GDTR_LIMIT, dt->size);
>
Reviewed-by: Paolo Bonzini <pbonzini@...hat.com>
Powered by blists - more mailing lists