lkml.org 
[lkml]   [2022]   [Sep]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v10 07/39] KVM: x86: Prepare kvm_hv_flush_tlb() to handle L2's GPAs
    Date
    To handle L2 TLB flush requests, KVM needs to translate the specified
    L2 GPA to L1 GPA to read hypercall arguments from there.

    No functional change as KVM doesn't handle VMCALL/VMMCALL from L2 yet.

    Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>
    Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
    ---
    arch/x86/kvm/hyperv.c | 7 +++++++
    1 file changed, 7 insertions(+)

    diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c
    index aced2b3fe56b..ad2560914a5f 100644
    --- a/arch/x86/kvm/hyperv.c
    +++ b/arch/x86/kvm/hyperv.c
    @@ -23,6 +23,7 @@
    #include "ioapic.h"
    #include "cpuid.h"
    #include "hyperv.h"
    +#include "mmu.h"
    #include "xen.h"

    #include <linux/cpu.h>
    @@ -1909,6 +1910,12 @@ static u64 kvm_hv_flush_tlb(struct kvm_vcpu *vcpu, struct kvm_hv_hcall *hc)
    */
    BUILD_BUG_ON(KVM_HV_MAX_SPARSE_VCPU_SET_BITS > 64);

    + if (!hc->fast && is_guest_mode(vcpu)) {
    + hc->ingpa = translate_nested_gpa(vcpu, hc->ingpa, 0, NULL);
    + if (unlikely(hc->ingpa == INVALID_GPA))
    + return HV_STATUS_INVALID_HYPERCALL_INPUT;
    + }
    +
    if (hc->code == HVCALL_FLUSH_VIRTUAL_ADDRESS_LIST ||
    hc->code == HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE) {
    if (hc->fast) {
    --
    2.37.3
    \
     
     \ /
      Last update: 2022-09-21 17:26    [W:3.001 / U:0.192 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site