about summary refs log tree commit diff
path: root/src/libstd/sys
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-06-20 19:14:52 +0000
committerbors <bors@rust-lang.org>2020-06-20 19:14:52 +0000
commitf455e46eae1a227d735091091144601b467e1565 (patch)
treec7252184d324a8497b66fd34a03cc2f4ffd84edc /src/libstd/sys
parent033013cab3a861224fd55f494c8be1cb0349eb49 (diff)
parentbb0016bdec30cb88370428ec124c33d6f341aad3 (diff)
Auto merge of #73550 - RalfJung:rollup-5huj1k1, r=RalfJung
Rollup of 9 pull requests

Successful merges:

 - #72600 (Properly encode AnonConst into crate metadata)
 - #73055 (remove leftover mentions of `skol` and `int` from the compiler)
 - #73058 (Support sanitizers on aarch64-unknown-linux-gnu)
 - #73171 (RISC-V Emulated Testing)
 - #73404 (Update CFGuard syntax)
 - #73444 (ci: disable alt build during try builds)
 - #73471 (Prevent attacker from manipulating FPU tag word used in SGX enclave)
 - #73539 (Deprecate `Vec::remove_item`)
 - #73543 (Clean up E0695 explanation)

Failed merges:

r? @ghost
Diffstat (limited to 'src/libstd/sys')
-rw-r--r--src/libstd/sys/sgx/abi/entry.S20
-rw-r--r--src/libstd/sys/unix/process/process_common.rs1
2 files changed, 9 insertions, 12 deletions
diff --git a/src/libstd/sys/sgx/abi/entry.S b/src/libstd/sys/sgx/abi/entry.S
index 2badfc973c9..fc6ce577033 100644
--- a/src/libstd/sys/sgx/abi/entry.S
+++ b/src/libstd/sys/sgx/abi/entry.S
@@ -26,18 +26,10 @@ IMAGE_BASE:
 .Lxsave_clear:
 .org .+24
 .Lxsave_mxcsr:
-    .int 0
+    .short 0x1f80
 
 /*  We can store a bunch of data in the gap between MXCSR and the XSAVE header */
 
-/* MXCSR initialization value for ABI */
-.Lmxcsr_init:
-    .int 0x1f80
-
-/* x87 FPU control word initialization value for ABI */
-.Lfpucw_init:
-    .int 0x037f
-
 /*  The following symbols point at read-only data that will be filled in by the */
 /*  post-linker. */
 
@@ -177,13 +169,17 @@ sgx_entry:
     jz .Lskip_debug_init
     mov %r10,%gs:tcsls_debug_panic_buf_ptr
 .Lskip_debug_init:
+/*  reset cpu state */
+    mov %rdx, %r10
+    mov $-1, %rax
+    mov $-1, %rdx
+    xrstor .Lxsave_clear(%rip)
+    mov %r10, %rdx
+
 /*  check if returning from usercall */
     mov %gs:tcsls_last_rsp,%r11
     test %r11,%r11
     jnz .Lusercall_ret
-/*  reset user state */
-    ldmxcsr .Lmxcsr_init(%rip)
-    fldcw .Lfpucw_init(%rip)
 /*  setup stack */
     mov %gs:tcsls_tos,%rsp /*  initially, RSP is not set to the correct value */
                            /*  here. This is fixed below under "adjust stack". */
diff --git a/src/libstd/sys/unix/process/process_common.rs b/src/libstd/sys/unix/process/process_common.rs
index 2d7267263de..6e33cdd3c48 100644
--- a/src/libstd/sys/unix/process/process_common.rs
+++ b/src/libstd/sys/unix/process/process_common.rs
@@ -428,6 +428,7 @@ mod tests {
     // ignored there.
     #[cfg_attr(target_arch = "arm", ignore)]
     #[cfg_attr(target_arch = "aarch64", ignore)]
+    #[cfg_attr(target_arch = "riscv64", ignore)]
     fn test_process_mask() {
         unsafe {
             // Test to make sure that a signal mask does not get inherited.