Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F148801060
D15183.id41856.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
970 B
Referenced Files
None
Subscribers
None
D15183.id41856.diff
View Options
Index: head/sys/amd64/amd64/exception.S
===================================================================
--- head/sys/amd64/amd64/exception.S
+++ head/sys/amd64/amd64/exception.S
@@ -341,6 +341,9 @@
* On the stack, we have the hardware interrupt frame to return
* to usermode (faulted) and another frame with error code, for
* fault. For PTI, copy both frames to the main thread stack.
+ * Handle the potential 16-byte alignment adjustment incurred
+ * during the second fault by copying both frames independently
+ * while unwinding the stack in between.
*/
.macro PROTF_ENTRY name,trapno
\name\()_pti_doreti:
@@ -351,7 +354,11 @@
movq %rax,%cr3
movq PCPU(RSP0),%rax
subq $2*PTI_SIZE-3*8,%rax /* no err, %rax, %rdx in faulted frame */
- MOVE_STACKS (PTI_SIZE / 4 - 3)
+ MOVE_STACKS (PTI_SIZE / 8)
+ addq $PTI_SIZE,%rax
+ movq PTI_RSP(%rsp),%rsp
+ MOVE_STACKS (PTI_SIZE / 8 - 3)
+ subq $PTI_SIZE,%rax
movq %rax,%rsp
popq %rdx
popq %rax
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 21, 7:07 AM (29 m, 19 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30006741
Default Alt Text
D15183.id41856.diff (970 B)
Attached To
Mode
D15183: in PTI case account for stack alignment adjustment while copying frames during nested fault
Attached
Detach File
Event Timeline
Log In to Comment