Skip to content

Commit 22a7cdc

Browse files
KarimAllah Ahmedrkrcmar
authored andcommitted
KVM/nVMX: Do not validate that posted_intr_desc_addr is page aligned
The spec only requires the posted interrupt descriptor address to be 64-bytes aligned (i.e. bits[0:5] == 0). Using page_address_valid also forces the address to be page aligned. Only validate that the address does not cross the maximum physical address without enforcing a page alignment. Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Radim Krčmář <rkrcmar@redhat.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@redhat.com> Cc: Borislav Petkov <bp@alien8.de> Cc: H. Peter Anvin <hpa@zytor.com> Cc: x86@kernel.org Cc: kvm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Fixes: 6de84e5 ("nVMX x86: check posted-interrupt descriptor addresss on vmentry of L2") Signed-off-by: KarimAllah Ahmed <karahmed@amazon.de> Reviewed-by: Jim Mattson <jmattson@google.com> Reviewed-by: Krish Sadhuhan <krish.sadhukhan@oracle.com> Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
1 parent f9dcf08 commit 22a7cdc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/kvm/vmx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12206,7 +12206,7 @@ static int nested_vmx_check_apicv_controls(struct kvm_vcpu *vcpu,
1220612206
!nested_exit_intr_ack_set(vcpu) ||
1220712207
(vmcs12->posted_intr_nv & 0xff00) ||
1220812208
(vmcs12->posted_intr_desc_addr & 0x3f) ||
12209-
(!page_address_valid(vcpu, vmcs12->posted_intr_desc_addr))))
12209+
(vmcs12->posted_intr_desc_addr >> cpuid_maxphyaddr(vcpu))))
1221012210
return -EINVAL;
1221112211

1221212212
/* tpr shadow is needed by all apicv features. */

0 commit comments

Comments
 (0)