• Tom Dohrmann's avatar
    KVM: x86: Only advertise KVM_CAP_READONLY_MEM when supported by VM · d30d9ee9
    Tom Dohrmann authored
    Until recently, KVM_CAP_READONLY_MEM was unconditionally supported on
    x86, but this is no longer the case for SEV-ES and SEV-SNP VMs.
    
    When KVM_CHECK_EXTENSION is invoked on a VM, only advertise
    KVM_CAP_READONLY_MEM when it's actually supported.
    
    Fixes: 66155de9 ("KVM: x86: Disallow read-only memslots for SEV-ES and SEV-SNP (and TDX)")
    Cc: Sean Christopherson <seanjc@google.com>
    Cc: Paolo Bonzini <pbonzini@redhat.com>
    Cc: Michael Roth <michael.roth@amd.com>
    Signed-off-by: default avatarTom Dohrmann <erbse.13@gmx.de>
    Message-ID: <20240902144219.3716974-1-erbse.13@gmx.de>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    d30d9ee9
x86.c 374 KB