public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] KVM: xen: update shared_info when long_mode is set
@ 2023-12-01 10:45 Paul Durrant
  2023-12-01 10:45 ` [PATCH 1/2] KVM: xen: separate initialization of shared_info cache and content Paul Durrant
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Paul Durrant @ 2023-12-01 10:45 UTC (permalink / raw)
  To: David Woodhouse, Paul Durrant, Sean Christopherson, Paolo Bonzini,
	Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
	H. Peter Anvin, kvm, linux-kernel

From: Paul Durrant <pdurrant@amazon.com>

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/20231122121822.1042-1-paul@xen.org/

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
-- 
2.39.2


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-12-01 17:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-01 10:45 [PATCH 0/2] KVM: xen: update shared_info when long_mode is set Paul Durrant
2023-12-01 10:45 ` [PATCH 1/2] KVM: xen: separate initialization of shared_info cache and content Paul Durrant
2023-12-01 10:45 ` [PATCH 2/2] KVM: xen: (re-)initialize shared_info if guest (32/64-bit) mode is set Paul Durrant
2023-12-01 15:32   ` Paul Durrant
2023-12-01 16:46 ` [PATCH 0/2] KVM: xen: update shared_info when long_mode " Sean Christopherson
2023-12-01 17:08   ` Durrant, Paul
2023-12-01 17:44     ` Sean Christopherson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox