[RFC PATCH 0/1] Runstate error with KPTI

Bertrand Marquis posted 1 patch 3 years, 10 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/xen tags/patchew/cover.1590675919.git.bertrand.marquis@arm.com
Maintainers: Jan Beulich <jbeulich@suse.com>, Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>, George Dunlap <george.dunlap@citrix.com>, Ian Jackson <ian.jackson@eu.citrix.com>, "Roger Pau Monné" <roger.pau@citrix.com>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, Julien Grall <julien@xen.org>, Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/arm/domain.c   | 32 +++++++++-------
xen/arch/x86/domain.c   | 51 ++++++++++++++-----------
xen/common/domain.c     | 84 ++++++++++++++++++++++++++++++++++-------
xen/include/xen/sched.h | 11 ++++--
4 files changed, 124 insertions(+), 54 deletions(-)
[RFC PATCH 0/1] Runstate error with KPTI
Posted by Bertrand Marquis 3 years, 10 months ago
The following patch implements a solution to the bug occuring on Arm
with Linux with KPTI enabled during a context switch from user mode:
(XEN) p2m.c:1890: d1v0: Failed to walk page-table va 0xffffff837ebe0cd0

This is an answer to the discussion started here:
https://lists.xenproject.org/archives/html/xen-devel/2020-05/msg00735.html

and a modification of the patches submitted here:
https://lists.xenproject.org/archives/html/xen-devel/2019-05/msg02320.html

This is submitted as an RFC as the solution is only working on Arm and I
would need some help for the x86 implementation.
On x86 this needs at least a solution to implement an equivalent of
get_page_from_gva (see #error in domain.c) and implementation of the
different runstate_update functions.
Any help or suggestion on that would be nice.

I also added some XXX in different places as part of the code of the
original patch I started from are not completely clear to me.

Bertrand Marquis (1):
  xen: Use a global mapping for runstate

 xen/arch/arm/domain.c   | 32 +++++++++-------
 xen/arch/x86/domain.c   | 51 ++++++++++++++-----------
 xen/common/domain.c     | 84 ++++++++++++++++++++++++++++++++++-------
 xen/include/xen/sched.h | 11 ++++--
 4 files changed, 124 insertions(+), 54 deletions(-)

-- 
2.17.1