Displaying 20 results from an estimated 154 matches for "swapg".
Did you mean:
swap
2007 Apr 18
0
[RFC/PATCH PV_OPS X86_64 12/17] paravirt_ops - interrupt/exception changes
...*ia32_sys_call_table(,%rax,8)
movq %rax,RAX-ARGOFFSET(%rsp)
GET_THREAD_INFO(%r10)
- cli
+ DISABLE_INTERRUPTS(CLBR_NONE)
TRACE_IRQS_OFF
testl $_TIF_ALLWORK_MASK,threadinfo_flags(%r10)
jnz int_ret_from_sys_call
@@ -141,7 +148,7 @@ sysenter_do_call:
CFI_REGISTER rip,rdx
TRACE_IRQS_ON
swapgs
- sti /* sti only takes effect after the next instruction */
+ ENABLE_INTERRUPTS(CLBR_NONE) /* sti only takes effect after the next instruction */
/* sysexit */
.byte 0xf, 0x35
@@ -199,7 +206,7 @@ ENTRY(ia32_cstar_target)
* No need to follow this irqs on/off section: the syscall
* di...
2007 Apr 18
0
[RFC/PATCH PV_OPS X86_64 12/17] paravirt_ops - interrupt/exception changes
...*ia32_sys_call_table(,%rax,8)
movq %rax,RAX-ARGOFFSET(%rsp)
GET_THREAD_INFO(%r10)
- cli
+ DISABLE_INTERRUPTS(CLBR_NONE)
TRACE_IRQS_OFF
testl $_TIF_ALLWORK_MASK,threadinfo_flags(%r10)
jnz int_ret_from_sys_call
@@ -141,7 +148,7 @@ sysenter_do_call:
CFI_REGISTER rip,rdx
TRACE_IRQS_ON
swapgs
- sti /* sti only takes effect after the next instruction */
+ ENABLE_INTERRUPTS(CLBR_NONE) /* sti only takes effect after the next instruction */
/* sysexit */
.byte 0xf, 0x35
@@ -199,7 +206,7 @@ ENTRY(ia32_cstar_target)
* No need to follow this irqs on/off section: the syscall
* di...
2017 Oct 04
0
[PATCH 05/13] x86/paravirt: Move paravirt asm macros to paravirt-asm.h
...ll PARA_INDIRECT(pv_irq_ops+PV_IRQ_irq_enable); \
+ PV_RESTORE_REGS(clobbers | CLBR_CALLEE_SAVE);)
+
+#ifdef CONFIG_X86_32
+#define GET_CR0_INTO_EAX \
+ push %ecx; push %edx; \
+ call PARA_INDIRECT(pv_cpu_ops+PV_CPU_read_cr0); \
+ pop %edx; pop %ecx
+#else /* !CONFIG_X86_32 */
+
+/*
+ * If swapgs is used while the userspace stack is still current,
+ * there's no way to call a pvop. The PV replacement *must* be
+ * inlined, or the swapgs instruction must be trapped and emulated.
+ */
+#define SWAPGS_UNSAFE_STACK \
+ PARA_SITE(PARA_PATCH(pv_cpu_ops, PV_CPU_swapgs), CLBR_NONE, \
+...
2015 Nov 18
0
[PATCH 3/3] x86: usergs_sysret32 pv op is no longer needed
...it a/arch/x86/entry/entry_64_compat.S b/arch/x86/entry/entry_64_compat.S
index 98893d9..82415dc 100644
--- a/arch/x86/entry/entry_64_compat.S
+++ b/arch/x86/entry/entry_64_compat.S
@@ -18,13 +18,6 @@
.section .entry.text, "ax"
-#ifdef CONFIG_PARAVIRT
-ENTRY(native_usergs_sysret32)
- swapgs
- sysretl
-ENDPROC(native_usergs_sysret32)
-#endif
-
/*
* 32-bit SYSENTER instruction entry.
*
@@ -238,7 +231,8 @@ sysret32_from_system_call:
xorq %r9, %r9
xorq %r10, %r10
movq RSP-ORIG_RAX(%rsp), %rsp
- USERGS_SYSRET32
+ swapgs
+ sysretl
END(entry_SYSCALL_compat)
/*
diff --g...
2020 Aug 07
2
[PATCH v3 4/7] x86/paravirt: remove 32-bit support from PARAVIRT_XXL
...CONFIG_X86_64
> .mmu_write_cr3 = { 0x0f, 0x22, 0xdf }, // mov %rdi, %cr3
> .irq_restore_fl = { 0x57, 0x9d }, // push %rdi; popfq
> .cpu_wbinvd = { 0x0f, 0x09 }, // wbinvd
> @@ -50,19 +45,11 @@ static const struct patch_xxl patch_data_xxl = {
> 0x48, 0x0f, 0x07 }, // swapgs; sysretq
> .cpu_swapgs = { 0x0f, 0x01, 0xf8 }, // swapgs
> .mov64 = { 0x48, 0x89, 0xf8 }, // mov %rdi, %rax
> -# else
> - .mmu_write_cr3 = { 0x0f, 0x22, 0xd8 }, // mov %eax, %cr3
> - .irq_restore_fl = { 0x50, 0x9d }, // push %eax; popf
> - .cpu_iret = { 0xcf }, // iret...
2020 Aug 07
2
[PATCH v3 4/7] x86/paravirt: remove 32-bit support from PARAVIRT_XXL
...CONFIG_X86_64
> .mmu_write_cr3 = { 0x0f, 0x22, 0xdf }, // mov %rdi, %cr3
> .irq_restore_fl = { 0x57, 0x9d }, // push %rdi; popfq
> .cpu_wbinvd = { 0x0f, 0x09 }, // wbinvd
> @@ -50,19 +45,11 @@ static const struct patch_xxl patch_data_xxl = {
> 0x48, 0x0f, 0x07 }, // swapgs; sysretq
> .cpu_swapgs = { 0x0f, 0x01, 0xf8 }, // swapgs
> .mov64 = { 0x48, 0x89, 0xf8 }, // mov %rdi, %rax
> -# else
> - .mmu_write_cr3 = { 0x0f, 0x22, 0xd8 }, // mov %eax, %cr3
> - .irq_restore_fl = { 0x50, 0x9d }, // push %eax; popf
> - .cpu_iret = { 0xcf }, // iret...
2017 Oct 25
0
[PATCH 03/13] x86/paravirt: Convert native patch assembly code strings to macros
...s.h
> +++ b/arch/x86/include/asm/special_insns.h
> @@ -6,6 +6,30 @@
>
> #include <asm/nops.h>
>
> +#ifdef CONFIG_X86_64
> +# define _REG_ARG1 "%rdi"
> +# define NATIVE_IDENTITY_32 "mov %edi, %eax"
> +# define NATIVE_USERGS_SYSRET64 "swapgs; sysretq"
> +#else
> +# define _REG_ARG1 "%eax"
> +#endif
> +
> +#define _REG_RET "%" _ASM_AX
> +
> +#define NATIVE_ZERO "xor " _REG_ARG1 ", " _REG_ARG1
> +#define NATIVE_IDENTITY "mov " _REG_ARG1 ", "...
2017 Oct 04
1
[PATCH 03/13] x86/paravirt: Convert native patch assembly code strings to macros
...00644
--- a/arch/x86/include/asm/special_insns.h
+++ b/arch/x86/include/asm/special_insns.h
@@ -6,6 +6,30 @@
#include <asm/nops.h>
+#ifdef CONFIG_X86_64
+# define _REG_ARG1 "%rdi"
+# define NATIVE_IDENTITY_32 "mov %edi, %eax"
+# define NATIVE_USERGS_SYSRET64 "swapgs; sysretq"
+#else
+# define _REG_ARG1 "%eax"
+#endif
+
+#define _REG_RET "%" _ASM_AX
+
+#define NATIVE_ZERO "xor " _REG_ARG1 ", " _REG_ARG1
+#define NATIVE_IDENTITY "mov " _REG_ARG1 ", " _REG_RET
+#define NATIVE_SAVE_FL &quo...
2018 Aug 13
0
[PATCH v2 03/11] x86/paravirt: remove clobbers from struct paravirt_patch_site
..._SAVE_REGS(clobbers | CLBR_CALLEE_SAVE); \
- ANNOTATE_RETPOLINE_SAFE; \
+ ANNOTATE_RETPOLINE_SAFE; \
call PARA_INDIRECT(pv_irq_ops+PV_IRQ_irq_enable); \
PV_RESTORE_REGS(clobbers | CLBR_CALLEE_SAVE);)
@@ -916,8 +915,7 @@ extern void default_banner(void);
* inlined, or the swapgs instruction must be trapped and emulated.
*/
#define SWAPGS_UNSAFE_STACK \
- PARA_SITE(PARA_PATCH(pv_cpu_ops, PV_CPU_swapgs), CLBR_NONE, \
- swapgs)
+ PARA_SITE(PARA_PATCH(pv_cpu_ops, PV_CPU_swapgs), swapgs)
/*
* Note: swapgs is very special, and in practise is either going to be
@...
2017 Oct 04
0
[PATCH 06/13] x86/paravirt: Clean up paravirt-asm.h
...\
- push %ecx; push %edx; \
- call PARA_INDIRECT(pv_cpu_ops+PV_CPU_read_cr0); \
+
+#define GET_CR0_INTO_EAX \
+ push %ecx; push %edx; \
+ call PV_INDIRECT(pv_cpu_ops+PV_CPU_read_cr0); \
pop %edx; pop %ecx
+
#else /* !CONFIG_X86_32 */
/*
@@ -97,8 +102,7 @@
* inlined, or the swapgs instruction must be trapped and emulated.
*/
#define SWAPGS_UNSAFE_STACK \
- PARA_SITE(PARA_PATCH(pv_cpu_ops, PV_CPU_swapgs), CLBR_NONE, \
- swapgs)
+ PV_SITE(swapgs, pv_cpu_ops, PV_CPU_swapgs, CLBR_NONE)
/*
* Note: swapgs is very special, and in practise is either going to be
@@ -...
2015 Nov 18
8
[PATCH 0/3] Fix and cleanup for 32-bit PV sysexit
The first patch fixes Xen PV regression introduced by 32-bit rewrite. Unlike the
earlier version it uses ALTERNATIVE instruction and avoids using xen_sysexit
(and sysret32 in compat mode) pv ops, as suggested by Andy. (I ended up patching
TEST with XOR to avoid extra NOPs, even though I said yesterday it would be
wrong. It's not wrong)
As result of this patch irq_enable_sysexit and
2015 Nov 18
8
[PATCH 0/3] Fix and cleanup for 32-bit PV sysexit
The first patch fixes Xen PV regression introduced by 32-bit rewrite. Unlike the
earlier version it uses ALTERNATIVE instruction and avoids using xen_sysexit
(and sysret32 in compat mode) pv ops, as suggested by Andy. (I ended up patching
TEST with XOR to avoid extra NOPs, even though I said yesterday it would be
wrong. It's not wrong)
As result of this patch irq_enable_sysexit and
2014 Oct 27
5
[PATCH v12 09/11] pvqspinlock, x86: Add para-virtualization support
...:
>
> Index: linux-2.6/arch/x86/kernel/paravirt_patch_64.c
> ===================================================================
> --- linux-2.6.orig/arch/x86/kernel/paravirt_patch_64.c
> +++ linux-2.6/arch/x86/kernel/paravirt_patch_64.c
> @@ -22,6 +22,10 @@ DEF_NATIVE(pv_cpu_ops, swapgs, "swapgs")
> DEF_NATIVE(, mov32, "mov %edi, %eax");
> DEF_NATIVE(, mov64, "mov %rdi, %rax");
>
> +#if defined(CONFIG_PARAVIRT_SPINLOCKS)&& defined(CONFIG_QUEUE_SPINLOCK)
> +DEF_NATIVE(pv_lock_ops, queue_unlock, "movb $0, (%rdi)");...
2014 Oct 27
5
[PATCH v12 09/11] pvqspinlock, x86: Add para-virtualization support
...:
>
> Index: linux-2.6/arch/x86/kernel/paravirt_patch_64.c
> ===================================================================
> --- linux-2.6.orig/arch/x86/kernel/paravirt_patch_64.c
> +++ linux-2.6/arch/x86/kernel/paravirt_patch_64.c
> @@ -22,6 +22,10 @@ DEF_NATIVE(pv_cpu_ops, swapgs, "swapgs")
> DEF_NATIVE(, mov32, "mov %edi, %eax");
> DEF_NATIVE(, mov64, "mov %rdi, %rax");
>
> +#if defined(CONFIG_PARAVIRT_SPINLOCKS)&& defined(CONFIG_QUEUE_SPINLOCK)
> +DEF_NATIVE(pv_lock_ops, queue_unlock, "movb $0, (%rdi)");...
2015 Nov 19
7
[PATCH v2 0/3] Fix and cleanup for 32-bit PV sysexit
The first patch fixes Xen PV regression introduced by 32-bit rewrite. Unlike the
earlier version it uses ALTERNATIVE instruction and avoids using xen_sysexit
(and sysret32 in compat mode) pv ops, as suggested by Andy.
As result of this patch irq_enable_sysexit and usergs_sysret32 pv ops are not
used anymore by anyone and so can be removed.
v2:
* patch both TEST and JZ intructions with a
2015 Nov 19
7
[PATCH v2 0/3] Fix and cleanup for 32-bit PV sysexit
The first patch fixes Xen PV regression introduced by 32-bit rewrite. Unlike the
earlier version it uses ALTERNATIVE instruction and avoids using xen_sysexit
(and sysret32 in compat mode) pv ops, as suggested by Andy.
As result of this patch irq_enable_sysexit and usergs_sysret32 pv ops are not
used anymore by anyone and so can be removed.
v2:
* patch both TEST and JZ intructions with a
2007 Apr 18
0
[PATCH] paravirt_ops x86_64 , take 2
...scall_page in the paravirt_ops struct, which
allows the kernel to map a vsyscall_page on its own
* fixed vsyscall functions to avoid calling paravirt_ops functions.
__vsyscall_0 is the page to be mapped for the host. (set and get cpu not
yet tested.)
* fixed cpuid calls.
* added substitute for the swapgs instruction. (Notice that I'm not
saying it works ;-) )
In my TODO list, you can find:
* putting swapgs to work
* making sure legacy mode binaries work
* merging in valuable commentaries from all you ;-)
--
Glauber de Oliveira Costa
Red Hat Inc.
"Free as in Freedom"
------------...
2007 Apr 18
0
[PATCH] paravirt_ops x86_64 , take 2
...scall_page in the paravirt_ops struct, which
allows the kernel to map a vsyscall_page on its own
* fixed vsyscall functions to avoid calling paravirt_ops functions.
__vsyscall_0 is the page to be mapped for the host. (set and get cpu not
yet tested.)
* fixed cpuid calls.
* added substitute for the swapgs instruction. (Notice that I'm not
saying it works ;-) )
In my TODO list, you can find:
* putting swapgs to work
* making sure legacy mode binaries work
* merging in valuable commentaries from all you ;-)
--
Glauber de Oliveira Costa
Red Hat Inc.
"Free as in Freedom"
------------...
2017 Oct 04
31
[PATCH 00/13] x86/paravirt: Make pv ops code generation more closely match reality
This changes the pv ops code generation to more closely match reality.
For example, instead of:
callq *0xffffffff81e3a400 (pv_irq_ops.save_fl)
vmlinux will now show:
pushfq
pop %rax
nop
nop
nop
nop
nop
which is what the runtime version of the code will show in most cases.
This idea was suggested by Andy Lutomirski.
The benefits are:
- For the most common runtime cases
2017 Oct 04
31
[PATCH 00/13] x86/paravirt: Make pv ops code generation more closely match reality
This changes the pv ops code generation to more closely match reality.
For example, instead of:
callq *0xffffffff81e3a400 (pv_irq_ops.save_fl)
vmlinux will now show:
pushfq
pop %rax
nop
nop
nop
nop
nop
which is what the runtime version of the code will show in most cases.
This idea was suggested by Andy Lutomirski.
The benefits are:
- For the most common runtime cases