All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] Permit fault-less access to non-emulated MSRs
@ 2021-01-20 22:49 Boris Ostrovsky
  2021-01-20 22:49 ` [PATCH v2 1/4] xl: Add support for ignore_msrs option Boris Ostrovsky
                   ` (3 more replies)
  0 siblings, 4 replies; 53+ messages in thread
From: Boris Ostrovsky @ 2021-01-20 22:49 UTC (permalink / raw)
  To: xen-devel
  Cc: iwj, wl, anthony.perard, jbeulich, andrew.cooper3, roger.pau,
	jun.nakajima, kevin.tian, boris.ostrovsky


Disallowing accesses to MSRs that are not explicitly handled (done by
commit 84e848fd7a16 ("x86/hvm: disallow access to unknown MSRs")) caused
regression for Solaris guests who access MSR_RAPL_POWER_UNIT assuming
it's always there.

We can add special handling for this and other RAPL registers (and that's
what should happen for pre-4.14 releases) but a more general solution is to
provide an option to allow accesses to unhandled registers to proceed.

The new option is "ignore_msrs" and it can take three values
    never:   Issue a warning to the log and #GP to the guest. This is default.
    silent:  MSR reads return 0, MSR writes are ignored. No warnings to the log.
    verbose: Similar to silent but a warning is written.

v2:
* pass ignore_msrs in msr_policy's value filed, not flags
* use 0x400002ff as unhandled MSR
* make sure MSR policy is only consulted for guest's MSR acceses


Boris Ostrovsky (4):
  xl: Add support for ignore_msrs option
  x86: Introduce MSR_UNHANDLED
  x86: Allow non-faulting accesses to non-emulated MSRs if policy
    permits this
  tools/libs: Apply MSR policy to a guest

 docs/man/xl.cfg.5.pod.in               |  20 +++++-
 tools/include/xenctrl.h                |   2 +
 tools/libs/guest/Makefile              |   1 +
 tools/libs/guest/xg_msrs_x86.c         | 110 +++++++++++++++++++++++++++++++++
 tools/libs/light/libxl_dom.c           |   5 +-
 tools/libs/light/libxl_internal.h      |   2 +
 tools/libs/light/libxl_types.idl       |   7 +++
 tools/libs/light/libxl_x86.c           |   7 +++
 tools/xl/xl_parse.c                    |   7 +++
 xen/arch/x86/hvm/svm/svm.c             |  10 ++-
 xen/arch/x86/hvm/vmx/vmx.c             |  10 ++-
 xen/arch/x86/msr.c                     |  32 +++++++++-
 xen/arch/x86/pv/emul-priv-op.c         |  10 +--
 xen/arch/x86/x86_emulate/x86_emulate.h |   6 ++
 xen/include/asm-x86/msr.h              |   3 +
 xen/include/xen/lib/x86/msr.h          |  17 ++++-
 xen/lib/x86/msr.c                      |   2 +
 17 files changed, 229 insertions(+), 22 deletions(-)
 create mode 100644 tools/libs/guest/xg_msrs_x86.c

-- 
1.8.3.1



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

end of thread, other threads:[~2021-02-23 18:46 UTC | newest]

Thread overview: 53+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-20 22:49 [PATCH v2 0/4] Permit fault-less access to non-emulated MSRs Boris Ostrovsky
2021-01-20 22:49 ` [PATCH v2 1/4] xl: Add support for ignore_msrs option Boris Ostrovsky
2021-01-21 14:56   ` Wei Liu
2021-01-21 22:43     ` Boris Ostrovsky
2021-01-22  9:52   ` Julien Grall
2021-01-22 18:28     ` Boris Ostrovsky
2021-01-22 18:33       ` Julien Grall
2021-01-22 18:39         ` Boris Ostrovsky
2021-01-22 20:42           ` Julien Grall
2021-02-18 10:42   ` Roger Pau Monné
2021-02-18 11:54     ` Jan Beulich
2021-02-18 15:52       ` Roger Pau Monné
2021-02-18 15:57         ` Jan Beulich
2021-02-19 14:50           ` Boris Ostrovsky
2021-02-22 10:24             ` Roger Pau Monné
2021-02-22 10:33               ` Jan Beulich
2021-01-20 22:49 ` [PATCH v2 2/4] x86: Introduce MSR_UNHANDLED Boris Ostrovsky
2021-01-22 11:51   ` Jan Beulich
2021-01-22 18:56     ` Boris Ostrovsky
2021-02-02 17:01     ` Boris Ostrovsky
2021-02-18 10:51   ` Roger Pau Monné
2021-02-19 14:56     ` Boris Ostrovsky
2021-02-22 11:08       ` Roger Pau Monné
2021-02-22 21:19         ` Boris Ostrovsky
2021-02-23  7:57           ` Jan Beulich
2021-02-23  9:34             ` Roger Pau Monné
2021-02-23 10:15               ` Jan Beulich
2021-02-23 12:17                 ` Roger Pau Monné
2021-02-23 13:23                   ` Jan Beulich
2021-02-23 15:39                     ` Boris Ostrovsky
2021-02-23 16:10                       ` Jan Beulich
2021-02-23 18:00                         ` Roger Pau Monné
2021-02-23 16:11                       ` Roger Pau Monné
2021-02-23 16:40                         ` Boris Ostrovsky
2021-02-23 18:02                           ` Roger Pau Monné
2021-02-23 18:45                             ` Boris Ostrovsky
2021-01-20 22:49 ` [PATCH v2 3/4] x86: Allow non-faulting accesses to non-emulated MSRs if policy permits this Boris Ostrovsky
2021-01-22 12:51   ` Jan Beulich
2021-01-22 19:52     ` Boris Ostrovsky
2021-01-25 10:22       ` Jan Beulich
2021-01-25 18:42         ` Boris Ostrovsky
2021-01-26  9:05           ` Jan Beulich
2021-01-26 16:02             ` Boris Ostrovsky
2021-01-26 16:35               ` Jan Beulich
2021-02-18 11:24   ` Roger Pau Monné
2021-02-18 11:57     ` Jan Beulich
2021-02-18 15:53       ` Roger Pau Monné
2021-01-20 22:49 ` [PATCH v2 4/4] tools/libs: Apply MSR policy to a guest Boris Ostrovsky
2021-01-21 14:58   ` Wei Liu
2021-01-22  9:56   ` Julien Grall
2021-01-22 18:35     ` Boris Ostrovsky
2021-02-18 11:48   ` Roger Pau Monné
2021-02-19 14:57     ` Boris Ostrovsky

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.