Skip to content

KVM: xen: update shared_info when long_mode is set

Paul Durrant kvm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2KVM: xen: separate initialization of shared_info cache and contentarch/x86/kvm/xen.c+40 -300 replies
2/2KVM: xen: (re-)initialize shared_info if guest (32/64-bit) mode is setarch/x86/kvm/xen.c+15 -51 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] KVM: xen: update shared_info when long_mode is set

From: Paul Durrant <[email protected]>

This series is based on my v9 of my "update shared_info and vcpu_info handling" series [1] and fixes an issue that was latent before the "allow shared_info to be mapped by fixed HVA" patch of that series allowed a VMM to set up shared_info before the VM booted and then leave it alone.

The problem was noticed when the guest wallclock apparently reverted to the Unix epoch. This was because, when the shared_info was set up the guest's long_mode flag was unset and hence the wallclock was intialized in the place where a 32-bit guest would expect to find it. The 64-bit guest being tested instead found zero-ed out memory.

Fix the the issue by first separating the initialization of the shared_info content from setting its location (by HVA or GPA) and then (re-)initializing the content any time the long_mode flag is changed.

[1] https://lore.kernel.org/kvm/[email protected]/

Paul Durrant (2):
KVM: xen: separate initialization of shared_info cache and content
KVM: xen: (re-)initialize shared_info if guest (32/64-bit) mode is set

 arch/x86/kvm/xen.c | 84 ++++++++++++++++++++++++++++------------------
 1 file changed, 52 insertions(+), 32 deletions(-)

base-commit: 369e9826edfd346f259471e521c03e12bb0ab476

Signature · 1 line
2.39.2