On Thu, Nov 19, 2020 at 12:15:09AM +0800, Like Xu wrote:Yes, it's expensive to inspect guest DS in the NMI handler and also
OK.ISTR there was lots of fail trying to virtualize it earlier. What'sAh, now we have EPT-friendly PEBS facilities supported since Ice Lake
changed? There's 0 clues here.
which makes guest PEBS feature possible w/o guest memory pinned.
OK, but the code here wanted to inspect the guest DS from the host. ItWhy are the host and guest DS area separate, why can't we map them toIf we map both guest and host DS_AREA to the exact same physical pages,
the exact same physical pages?
- the guest can access the host PEBS records, which means that the host
IP maybe leaked, because we cannot predict the time guest drains records and
it would be over-designed to clean it up before each vm-entry;
- different tasks/vcpus on the same pcpu cannot share the same PEBS DS
settings from the same physical page. For example, some require large
PEBS and reset values, while others do not.
Like many guest msrs, we use the separate guest DS_AREA for the guest's
own use and it avoids mutual interference as little as possible.
states this is somehow complicated/expensive.
But surely we can at theI am not sure whether the first mapped guest DS page can help
very least map the first guest DS page somewhere so we can at least
access the control bits without too much magic.