hi, David,
> I'm wondering: isn't this something the kernel should be able to figure
> out? Is this encrypted RAM (SMA) or not, and set the flag accordingly?
> What are the challenges?
VFIO driver and IOMMU driver don't know the device(memory or device mmio) behind vaddr,
only device driver knows that, now that the device is managed by user space VFIO,
user should tell the info to VFIO driver.
On 16.01.25 10:53, Wencheng Yang wrote:
> On confidential VM platform, for example, AMD-SEV, P2P doesn't work.
> The underlying reason is that IOMMU driver set encryption bit on
> IOMMU page table pte entry, it's reasonalbe if the pte maps iova
> to system memory. However, if the pte maps iova to device's
> mmio bar space, setting encryption bit on pte would cause IOMMU
> translates iova to incorrect bus address, rather than mmio bar
> address.
>
> To fix the issue, the key point is to let IOMMU driver know the
> target phyical address is system memory or device mmio.
I'm wondering: isn't this something the kernel should be able to figure
out? Is this encrypted RAM (SMA) or not, and set the flag accordingly?
What are the challenges?
--
Cheers,
David / dhildenb