lkml.org 
[lkml]   [2021]   [Oct]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [RFC PATCH v2 66/69] KVM: TDX: Add "basic" support for building and running Trust Domains
 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?

\
 
 \ /
  Last update: 2021-10-21 23:45    [W:0.656 / U:0.940 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site