Skip to contentSkip to conversation

x86: smap: Use correct reg to pass a parameter

PATCH In review Chenyi Qiang 2 participants 3 messages Oct 25, 2019 – Nov 11, 2019 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 x86: smap: Use correct reg to pass a parameter

The first parameter is passed using rdi in x86_64.

---
 x86/smap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
x86/smap.c +1 -1
index c0376e3..a8f48b8 100644
@@ -29,7 +29,7 @@ asm ("pf_tss:\n"
         // no task on x86_64, save/restore caller-save regs
         "push %rax; push %rcx; push %rdx; push %rsi; push %rdi\n"
         "push %r8; push %r9; push %r10; push %r11\n"
-	"mov 9*8(%rsp),%rsi\n"
+	"mov 9*8(%rsp),%rdi\n"
 #endif
 	"call do_pf_tss\n"
 #ifdef __x86_64__
Signature · 1 line
2.17.1
#1 lore raw

PATCH 2/2 x86: pku: fix parameter passing

Parameter error_code is passed in the function definition while the caller miss it. Fix it.

---
 x86/pku.c | 1 +
 1 file changed, 1 insertion(+)
x86/pku.c +1 -0
index 62fb261..1ce73fa 100644
@@ -38,6 +38,7 @@ asm ("pf_tss: \n\t"
     // no task on x86_64, save/restore caller-save regs
     "push %rax; push %rcx; push %rdx; push %rsi; push %rdi\n"
     "push %r8; push %r9; push %r10; push %r11\n"
+    "mov 9*8(%rsp),%rdi\n"
 #endif
     "call do_pf_tss \n\t"
 #ifdef __x86_64__
Signature · 1 line
2.17.1
maintainer
#2 lore raw

Re: [kvm-unit-tests PATCH 2/2] x86: pku: fix parameter passing

Quoted 14 lines · Chenyi Qiang

Parameter error_code is passed in the function definition while the caller miss it. Fix it.

---
 x86/pku.c | 1 +
 1 file changed, 1 insertion(+)
x86/pku.c +0 -0
index 62fb261..1ce73fa 100644

x86/pku.c asm ("pf_tss: \n\t" · line 44

Quoted 7 lines
x86/pku.c +1 -0
@@ -38,6 +38,7 @@ asm ("pf_tss: \n\t"
     // no task on x86_64, save/restore caller-save regs
     "push %rax; push %rcx; push %rdx; push %rsi; push %rdi\n"
     "push %r8; push %r9; push %r10; push %r11\n"
+    "mov 9*8(%rsp),%rdi\n"
 #endif
     "call do_pf_tss \n\t"
 #ifdef __x86_64__

Currently harmless, but should be fixed. I queued both patches.

Paolo