ANDROID: x86/paravirt: Extend pv_mmio_ops to support pci mmcfg read and write
Add the pci mmcfg reading and writing callbacks to the pv_mmio_ops so that can provide platform specific implementations, e.g., an enlightened kernel can use hypercalls to access the pci mmcfg. The callbacks are defined to use volatile to qualify the input parameter void __iomme *pos. Although doing so can result in checkpath warnings, this makes it possible to patch these callbacks with the read/write wrappers, which is done by the next patch. The default implementation is to use "mov" instruction with %eax to satisfy the AMD CPUs mentioned in the comment of mmio_config_xxx. In fact it appears to be required on modern Intel CPUs as well. Specifically on some Alder Lake machines it is observed that when using some other register than %eax for PCI MMIO writes below, suspend fails to reach S0ix (it only reaches Package C2 state), probably due to some PCI device failing to enter D3. Bug: 391539939 Bug: 353950489 BUG: 399581144 Test: Microdroid works as a protected VM Upstream-Task: 402758258 Change-Id: I0a204657e6b56a8ddcc665d39451451adb2e7587 Suggested-by:Dmytro Maluka <dmaluka@google.com> Signed-off-by:
Chuanxiao Dong <chuanxiao.dong@intel.com> Signed-off-by:
Grzegorz Jaszczyk <jaszczyk@google.com>
Loading
Please sign in to comment