FreeBSD Bugzilla – Attachment 232611 Details for
Bug 262691
[patch] Save only callee-saved registers in pcb
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Grouping MSR/MRS and LD/ST together
file_262691.txt (text/plain), 2.65 KB, created by
Dapeng Gao
on 2022-03-21 14:53:32 UTC
(
hide
)
Description:
Grouping MSR/MRS and LD/ST together
Filename:
MIME Type:
Creator:
Dapeng Gao
Created:
2022-03-21 14:53:32 UTC
Size:
2.65 KB
patch
obsolete
>--- a/sys/arm64/arm64/genassym.c >+++ b/sys/arm64/arm64/genassym.c >@@ -62,7 +62,7 @@ ASSYM(PCB_SINGLE_STEP_SHIFT, PCB_SINGLE_STEP_SHIFT); > ASSYM(PCB_REGS, offsetof(struct pcb, pcb_x)); > ASSYM(PCB_LR, offsetof(struct pcb, pcb_lr)); > ASSYM(PCB_SP, offsetof(struct pcb, pcb_sp)); >-ASSYM(PCB_TPIDRRO, offsetof(struct pcb, pcb_tpidrro_el0)); >+ASSYM(PCB_TPIDR, offsetof(struct pcb, pcb_tpidr_el0)); > ASSYM(PCB_ONFAULT, offsetof(struct pcb, pcb_onfault)); > ASSYM(PCB_FLAGS, offsetof(struct pcb, pcb_flags)); > >diff --git a/sys/arm64/arm64/swtch.S b/sys/arm64/arm64/swtch.S >index 0d1f1bc62d..998eb8dae3 100644 >--- a/sys/arm64/arm64/swtch.S >+++ b/sys/arm64/arm64/swtch.S >@@ -89,11 +89,11 @@ ENTRY(cpu_throw) > set_step_flag w5, x6 > > /* Restore the registers */ >- ldp x5, x6, [x4, #PCB_SP] >+ ldr x5, [x4, #PCB_SP] >+ ldp x6, x7, [x4, #PCB_TPIDR] > mov sp, x5 > msr tpidr_el0, x6 >- ldr x6, [x4, #PCB_TPIDRRO] >- msr tpidrro_el0, x6 >+ msr tpidrro_el0, x7 > ldp x19, x20, [x4, #PCB_REGS + 19 * 8] > ldp x21, x22, [x4, #PCB_REGS + 21 * 8] > ldp x23, x24, [x4, #PCB_REGS + 23 * 8] >@@ -127,10 +127,10 @@ ENTRY(cpu_switch) > stp x29, lr, [x4, #PCB_REGS + 29 * 8] > /* And the old stack pointer */ > mov x5, sp >- mrs x6, tpidrro_el0 >- str x6, [x4, #PCB_TPIDRRO] > mrs x6, tpidr_el0 >- stp x5, x6, [x4, #PCB_SP] >+ mrs x7, tpidrro_el0 >+ str x5, [x4, #PCB_SP] >+ stp x6, x7, [x4, #PCB_TPIDR] > > /* If we were single stepping, disable it */ > ldr w5, [x4, #PCB_FLAGS] >@@ -178,11 +178,11 @@ ENTRY(cpu_switch) > set_step_flag w5, x6 > > /* Restore the registers */ >- ldp x5, x6, [x4, #PCB_SP] >+ ldr x5, [x4, #PCB_SP] >+ ldp x6, x7, [x4, #PCB_TPIDR] > mov sp, x5 > msr tpidr_el0, x6 >- ldr x6, [x4, #PCB_TPIDRRO] >- msr tpidrro_el0, x6 >+ msr tpidrro_el0, x7 > ldp x19, x20, [x4, #PCB_REGS + 19 * 8] > ldp x21, x22, [x4, #PCB_REGS + 21 * 8] > ldp x23, x24, [x4, #PCB_REGS + 23 * 8] >@@ -254,9 +254,9 @@ ENTRY(savectx) > /* And the old stack pointer */ > mov x5, sp > mrs x6, tpidrro_el0 >- str x6, [x0, #PCB_TPIDRRO] >- mrs x6, tpidr_el0 >- stp x5, x6, [x0, #PCB_SP] >+ mrs x7, tpidr_el0 >+ str x5, [x0, #PCB_SP] >+ stp x6, x7, [x0, #PCB_TPIDR] > > /* Store the VFP registers */ > #ifdef VFP >diff --git a/sys/arm64/include/pcb.h b/sys/arm64/include/pcb.h >index 012ed2c927..3a520d6cd9 100644 >--- a/sys/arm64/include/pcb.h >+++ b/sys/arm64/include/pcb.h >@@ -40,8 +40,8 @@ struct pcb { > uint64_t pcb_x[30]; > uint64_t pcb_lr; > uint64_t _reserved; /* Was pcb_pc */ >- /* These two need to be in order as we access them together */ > uint64_t pcb_sp; >+ /* These two need to be in order as we access them together */ > uint64_t pcb_tpidr_el0; > uint64_t pcb_tpidrro_el0;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 262691
:
232594
| 232611