RE: [PATCHv2 26/29] x86/tdx: ioapic: Add shared bit for IOAPIC base address

From: Yamahata, Isaku
Date: Fri Feb 04 2022 - 17:10:09 EST


> > ioremap()-created mappings such as virtio will be marked as
> > shared. However, the IOAPIC code does not use ioremap() and instead
> > uses the fixmap mechanism.
> >
> > Introduce a special fixmap helper just for the IOAPIC code. Ensure
> > that it marks IOAPIC pages as "shared". This replaces
> > set_fixmap_nocache() with __set_fixmap() since __set_fixmap()
> > allows custom 'prot' values.
>
> Why is this a TDX only issue and SEV does not suffer from that?

The bit meaning is opposite.
TDX: set: shared, cleared: private
SEV: set: private, cleared: shared

Without this patch, it happens to work for SEV. (or any emulated MMIO can work)
But for TDX, IOAPIC emulation doesn't work.

Thanks,
Isaku Yamahata