Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c27cdea5 authored by Hugh Dickins's avatar Hugh Dickins Committed by Greg Kroah-Hartman
Browse files

kaiser: name that 0x1000 KAISER_SHADOW_PGD_OFFSET




There's a 0x1000 in various places, which looks better with a name.

Signed-off-by: default avatarHugh Dickins <hughd@google.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 61b7a404
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1318,7 +1318,7 @@ ENTRY(nmi)
	movq	%cr3, %rax
	pushq	%rax
#ifdef CONFIG_KAISER_REAL_SWITCH
	andq	$(~0x1000), %rax
	andq	$(~KAISER_SHADOW_PGD_OFFSET), %rax
#endif
	movq	%rax, %cr3
#endif
@@ -1561,7 +1561,7 @@ end_repeat_nmi:
	movq	%cr3, %rax
	pushq	%rax
#ifdef CONFIG_KAISER_REAL_SWITCH
	andq	$(~0x1000), %rax
	andq	$(~KAISER_SHADOW_PGD_OFFSET), %rax
#endif
	movq	%rax, %cr3
#endif
+5 −2
Original line number Diff line number Diff line
@@ -13,13 +13,16 @@
 * A minimalistic kernel mapping holds the parts needed to be mapped in user
 * mode, such as the entry/exit functions of the user space, or the stacks.
 */

#define KAISER_SHADOW_PGD_OFFSET 0x1000

#ifdef __ASSEMBLY__
#ifdef CONFIG_KAISER

.macro _SWITCH_TO_KERNEL_CR3 reg
movq %cr3, \reg
#ifdef CONFIG_KAISER_REAL_SWITCH
andq $(~0x1000), \reg
andq $(~KAISER_SHADOW_PGD_OFFSET), \reg
#endif
movq \reg, %cr3
.endm
@@ -27,7 +30,7 @@ movq \reg, %cr3
.macro _SWITCH_TO_USER_CR3 reg
movq %cr3, \reg
#ifdef CONFIG_KAISER_REAL_SWITCH
orq $(0x1000), \reg
orq $(KAISER_SHADOW_PGD_OFFSET), \reg
#endif
movq \reg, %cr3
.endm