lkml.org 
[lkml]   [2024]   [May]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    SubjectRe: [PATCH v19 101/130] KVM: TDX: handle ept violation/misconfig exit
    From
    On Mon, Feb 26, 2024, isaku.yamahata@intel.com wrote:
    > +static int tdx_handle_ept_violation(struct kvm_vcpu *vcpu)
    > +{
    > + unsigned long exit_qual;
    > +
    > + if (kvm_is_private_gpa(vcpu->kvm, tdexit_gpa(vcpu))) {
    > + /*
    > + * Always treat SEPT violations as write faults. Ignore the
    > + * EXIT_QUALIFICATION reported by TDX-SEAM for SEPT violations.
    > + * TD private pages are always RWX in the SEPT tables,
    > + * i.e. they're always mapped writable. Just as importantly,
    > + * treating SEPT violations as write faults is necessary to
    > + * avoid COW allocations, which will cause TDAUGPAGE failures
    > + * due to aliasing a single HPA to multiple GPAs.
    > + */
    > +#define TDX_SEPT_VIOLATION_EXIT_QUAL EPT_VIOLATION_ACC_WRITE

    This does not needd a #define. It's use in literally one place, one line below.

    \
     
     \ /
      Last update: 2024-05-27 18:17    [W:4.037 / U:0.364 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site