lkml.org 
[lkml]   [2021]   [Oct]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [RFC PATCH v2 66/69] KVM: TDX: Add "basic" support for building and running Trust Domains
From
On 10/22/2021 5:44 AM, Sagi Shahar wrote:
> On Fri, Jul 2, 2021 at 3:06 PM, Isaku Yamahata
> <isaku.yamahata@intel.com> wrote:
>> Subject: [RFC PATCH v2 66/69] KVM: TDX: Add "basic" support for
>> building and running Trust Domains
>>
>>
>> +static int tdx_map_gpa(struct kvm_vcpu *vcpu)
>> +{
>> + gpa_t gpa = tdvmcall_p1_read(vcpu);
>> + gpa_t size = tdvmcall_p2_read(vcpu);
>> +
>> + if (!IS_ALIGNED(gpa, 4096) || !IS_ALIGNED(size, 4096) ||
>> + (gpa + size) < gpa ||
>> + (gpa + size) > vcpu->kvm->arch.gfn_shared_mask << (PAGE_SHIFT + 1))
>> + tdvmcall_set_return_code(vcpu, TDG_VP_VMCALL_INVALID_OPERAND);
>> + else
>> + tdvmcall_set_return_code(vcpu, TDG_VP_VMCALL_SUCCESS);
>> +
>> + return 1;
>> +}
>
> This function looks like a no op in case of success. Is this
> intentional? Is this mapping handled somewhere else later on?
>

Yes, it's intentional.

The mapping will be exactly set up in EPT violation handler when the GPA
is really accessed.

\
 
 \ /
  Last update: 2021-10-24 15:01    [W:0.085 / U:2.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site