* [PATCH] KVM: VMX: use correct vmcs_read/write for guest segment selector/base
@ 2017-02-21 8:50 Chao Peng
2017-02-21 11:46 ` Paolo Bonzini
2017-02-21 14:23 ` David Hildenbrand
0 siblings, 2 replies; 3+ messages in thread
From: Chao Peng @ 2017-02-21 8:50 UTC (permalink / raw)
To: kvm
Cc: Paolo Bonzini, Radim Krčmář,
Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, linux-kernel,
Chao Peng, stable
Guest segment selector is 16 bit field and guest segment base is natural
width field. Fix two incorrect invocations accordingly.
Without this patch, build fails when aggressive inlining is used with ICC.
Cc: stable@vger.kernel.org
Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
---
arch/x86/kvm/vmx.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index a236dec..2c22aef 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -3962,7 +3962,7 @@ static void fix_rmode_seg(int seg, struct kvm_segment *save)
}
vmcs_write16(sf->selector, var.selector);
- vmcs_write32(sf->base, var.base);
+ vmcs_writel(sf->base, var.base);
vmcs_write32(sf->limit, var.limit);
vmcs_write32(sf->ar_bytes, vmx_segment_access_rights(&var));
}
@@ -8350,7 +8350,7 @@ static void kvm_flush_pml_buffers(struct kvm *kvm)
static void vmx_dump_sel(char *name, uint32_t sel)
{
pr_err("%s sel=0x%04x, attr=0x%05x, limit=0x%08x, base=0x%016lx\n",
- name, vmcs_read32(sel),
+ name, vmcs_read16(sel),
vmcs_read32(sel + GUEST_ES_AR_BYTES - GUEST_ES_SELECTOR),
vmcs_read32(sel + GUEST_ES_LIMIT - GUEST_ES_SELECTOR),
vmcs_readl(sel + GUEST_ES_BASE - GUEST_ES_SELECTOR));
--
1.8.3.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] KVM: VMX: use correct vmcs_read/write for guest segment selector/base
2017-02-21 8:50 [PATCH] KVM: VMX: use correct vmcs_read/write for guest segment selector/base Chao Peng
@ 2017-02-21 11:46 ` Paolo Bonzini
2017-02-21 14:23 ` David Hildenbrand
1 sibling, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2017-02-21 11:46 UTC (permalink / raw)
To: Chao Peng, kvm
Cc: Radim Krčmář,
Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, linux-kernel,
stable
On 21/02/2017 09:50, Chao Peng wrote:
> Guest segment selector is 16 bit field and guest segment base is natural
> width field. Fix two incorrect invocations accordingly.
>
> Without this patch, build fails when aggressive inlining is used with ICC.
>
> Cc: stable@vger.kernel.org
> Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
Applied, thanks.
Paolo
> ---
> arch/x86/kvm/vmx.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> index a236dec..2c22aef 100644
> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -3962,7 +3962,7 @@ static void fix_rmode_seg(int seg, struct kvm_segment *save)
> }
>
> vmcs_write16(sf->selector, var.selector);
> - vmcs_write32(sf->base, var.base);
> + vmcs_writel(sf->base, var.base);
> vmcs_write32(sf->limit, var.limit);
> vmcs_write32(sf->ar_bytes, vmx_segment_access_rights(&var));
> }
> @@ -8350,7 +8350,7 @@ static void kvm_flush_pml_buffers(struct kvm *kvm)
> static void vmx_dump_sel(char *name, uint32_t sel)
> {
> pr_err("%s sel=0x%04x, attr=0x%05x, limit=0x%08x, base=0x%016lx\n",
> - name, vmcs_read32(sel),
> + name, vmcs_read16(sel),
> vmcs_read32(sel + GUEST_ES_AR_BYTES - GUEST_ES_SELECTOR),
> vmcs_read32(sel + GUEST_ES_LIMIT - GUEST_ES_SELECTOR),
> vmcs_readl(sel + GUEST_ES_BASE - GUEST_ES_SELECTOR));
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] KVM: VMX: use correct vmcs_read/write for guest segment selector/base
2017-02-21 8:50 [PATCH] KVM: VMX: use correct vmcs_read/write for guest segment selector/base Chao Peng
2017-02-21 11:46 ` Paolo Bonzini
@ 2017-02-21 14:23 ` David Hildenbrand
1 sibling, 0 replies; 3+ messages in thread
From: David Hildenbrand @ 2017-02-21 14:23 UTC (permalink / raw)
To: Chao Peng, kvm
Cc: Paolo Bonzini, Radim Krčmář,
Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, linux-kernel,
stable
Am 21.02.2017 um 09:50 schrieb Chao Peng:
> Guest segment selector is 16 bit field and guest segment base is natural
> width field. Fix two incorrect invocations accordingly.
>
> Without this patch, build fails when aggressive inlining is used with ICC.
>
> Cc: stable@vger.kernel.org
> Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
> ---
> arch/x86/kvm/vmx.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> index a236dec..2c22aef 100644
> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -3962,7 +3962,7 @@ static void fix_rmode_seg(int seg, struct kvm_segment *save)
> }
>
> vmcs_write16(sf->selector, var.selector);
> - vmcs_write32(sf->base, var.base);
> + vmcs_writel(sf->base, var.base);
> vmcs_write32(sf->limit, var.limit);
> vmcs_write32(sf->ar_bytes, vmx_segment_access_rights(&var));
> }
> @@ -8350,7 +8350,7 @@ static void kvm_flush_pml_buffers(struct kvm *kvm)
> static void vmx_dump_sel(char *name, uint32_t sel)
> {
> pr_err("%s sel=0x%04x, attr=0x%05x, limit=0x%08x, base=0x%016lx\n",
> - name, vmcs_read32(sel),
> + name, vmcs_read16(sel),
> vmcs_read32(sel + GUEST_ES_AR_BYTES - GUEST_ES_SELECTOR),
> vmcs_read32(sel + GUEST_ES_LIMIT - GUEST_ES_SELECTOR),
> vmcs_readl(sel + GUEST_ES_BASE - GUEST_ES_SELECTOR));
>
Reviewed-by: David Hildenbrand <david@redhat.com>
--
Thanks,
David
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-02-21 14:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-21 8:50 [PATCH] KVM: VMX: use correct vmcs_read/write for guest segment selector/base Chao Peng
2017-02-21 11:46 ` Paolo Bonzini
2017-02-21 14:23 ` David Hildenbrand
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®