[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v2 0/4] x86/spec-ctrl: Fix NMI race condition


  • To: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Mon, 17 Jan 2022 18:34:11 +0000
  • Authentication-results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Jan Beulich <JBeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Jun Nakajima <jun.nakajima@xxxxxxxxx>, Kevin Tian <kevin.tian@xxxxxxxxx>
  • Delivery-date: Mon, 17 Jan 2022 18:35:16 +0000
  • Ironport-data: A9a23:fIddM6LD7sQHhp8rFE+RXZIlxSXFcZb7ZxGr2PjKsXjdYENS32QBy jAfXmjTPa2KNzD1LtAkaN629RkE68PWmoIxHgJlqX01Q3x08seUXt7xwmUcns+xwm8vaGo9s q3yv/GZdJhcokcxIn5BC5C5xZVG/fjgqoHUVaiUakideSc+EH170Us6xLZj6mJVqYPR7z2l6 IuaT/L3YDdJ6xYsWo7Dw/vewP/HlK2aVAIw5jTSV9gS1LPtvyB94KYkDbOwNxPFrrx8RYZWc QphIIaRpQs19z91Yj+sfy2SnkciGtY+NiDW4pZatjTLbrGvaUXe345iXMfwZ3u7hB3Okol/9 PFrp6DpTBgXPoHug+ANQjtXRnQW0a1uoNcrIFC6uM2XiUbHb2Ht07NlC0Re0Y8wo7gtRzsUr LpBdW5LPkvra+GemdpXTsFFgMg5IdatF4QYonx6lhnSDOo8QICFSKLPjTNd9Glq358WRa6CD yYfQXlSYjnucxNUAXUsGY8RzOmpnyT0KhQN/Tp5ooJoujOOnWSdyoPFMsfTPNqDRsxXn0ORj mPA42n9RBodMbS3yjeb83Tqmu7Gmwv6Xp4fEPuz8fsCqEKX7nweDlsRT1TTiem0jAuyVsxS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DUI+orL9Y04lQ7vn2YSXRuHPBw8P re+8jztCWE7Ar5N0tBpTntAsW9qBDnhPtICOsqTNSftWDd0QPCRuxfBOPZslvd8kbFl9K1u5 0OT0EHMqyTMWRH
  • Ironport-sdr: 0hojTDwn5QxwEaNJts8iwFR+bWoGLPGkFNsYRnUzLcVTwkoy9hOD72b/3rLL/ZFcMDeI4Bl/ph JWpxaCPEoSnFBKlhDY5xyXJPCQEAnpmk1drLK0c52OvbAHTIIq0x/y0ZQMyEaA72zs+Rr7HFq3 NflcoFqvoXQmiiHH3grfOjpa0kzKoZxOH3NZxN1j9/2klsEIhjrmnEnhwGFz014Kqlwva+zKQS 1gVbO9Qk9hucdakxJiaBiCpQgQUnXNduNDkmDHJUgA2PtT1HtC124SopLgzIQTWj+EZ1pGVjdI rEK2YRuCFKwgEIeFdJAi3ACx
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

v1 had an irritating breakage with VM migration, caused by the accessor logic
moving out of guest_{rd,wr}msr().  v2 takes an approach I'd previously put off
to one side, but which appears to be the least invasive way forward.

Andrew Cooper (4):
  x86/guest: Introduce {get,set}_reg() infrastructure
  x86/msr: Split MSR_SPEC_CTRL handling
  x86/spec-ctrl: Drop SPEC_CTRL_{ENTRY_FROM,EXIT_TO}_HVM
  x86/spec-ctrl: Fix NMI race condition with VT-x MSR_SPEC_CTRL handling

 xen/arch/x86/hvm/hvm.c                   | 22 +++++++++
 xen/arch/x86/hvm/svm/entry.S             |  5 +-
 xen/arch/x86/hvm/svm/svm.c               | 30 ++++++++++++
 xen/arch/x86/hvm/vmx/entry.S             | 23 +++++++---
 xen/arch/x86/hvm/vmx/vmx.c               | 78 +++++++++++++++++++++++++++++++-
 xen/arch/x86/include/asm/hvm/hvm.h       | 24 ++++++++++
 xen/arch/x86/include/asm/msr.h           | 10 +++-
 xen/arch/x86/include/asm/pv/domain.h     | 13 ++++++
 xen/arch/x86/include/asm/spec_ctrl_asm.h | 51 ++++-----------------
 xen/arch/x86/msr.c                       | 21 +++++++--
 xen/arch/x86/pv/emulate.c                | 40 ++++++++++++++++
 11 files changed, 259 insertions(+), 58 deletions(-)

-- 
2.11.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.