Commit e8ff3bef authored by Chuanxiao Dong's avatar Chuanxiao Dong Committed by Grzegorz Jaszczyk
Browse files

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: default avatarDmytro Maluka <dmaluka@google.com>
Signed-off-by: default avatarChuanxiao Dong <chuanxiao.dong@intel.com>
Signed-off-by: default avatarGrzegorz Jaszczyk <jaszczyk@google.com>
parent 21dbd502
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment