On September 11, 2021 9:16 AM, Erdem Aktas wrote:
> 
> On Thu, Aug 12, 2021 at 2:57 PM Min Xu <min.m...@intel.com> wrote:
>  > +UINT8
> > +EFIAPI
> > +TdMmioRead8 (
> > +  IN      UINTN                     Address
> > +  )
> > +{
> > +  UINT64                             Value;
> > +  UINT64                             Status;
> > +
> > +  Address |= TdSharedPageMask ();
> 
> Why is the SharedBit set? VMM does not care if the sharedbit is set.
> Actually it should not even be aware of it.
>
That is because GPA for MMIO region that VMM emulates must be shared region.  
i.e. shared bit must be set.
See Section 12.3 in below link.
https://software.intel.com/content/dam/develop/external/us/en/documents/tdx-module-1.0-public-spec-v0.931.pdf
>
> > +  MemoryFence ();
> > +  Status = TdVmCall (TDVMCALL_MMIO, TDVMCALL_ACCESS_SIZE_1,
> > + TDVMCALL_ACCESS_READ, Address, 0, &Value);  if (Status != 0) {
> So for some reason, MMIO read fails, we are doing a memory read. Why
> should an MMIO read fail? Could you elaborate which use case this covers?
If invalid operands provided by TD, e.g., MMIO address, 
TDG.VP.VMCALL_INVALID_OPERAND is returned.
See Section 3.7 Table 3-21 in below link:
https://software.intel.com/content/dam/develop/external/us/en/documents/intel-tdx-guest-hypervisor-communication-interface-1.0-344426-002.pdf
> 
Thanks!
Min


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#81207): https://edk2.groups.io/g/devel/message/81207
Mute This Topic: https://groups.io/mt/84837896/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to