Load the fault handler into the correct register.
authordrahn <drahn@openbsd.org>
Sat, 15 May 2021 00:04:32 +0000 (00:04 +0000)
committerdrahn <drahn@openbsd.org>
Sat, 15 May 2021 00:04:32 +0000 (00:04 +0000)
Having the onfault dance in a macro makes this almost unreadable.
Initial failure found by deraadt, cause finally found.

sys/arch/riscv64/riscv64/copy.S

index 9412945..84fa644 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: copy.S,v 1.2 2021/05/12 01:20:52 jsg Exp $    */
+/*     $OpenBSD: copy.S,v 1.3 2021/05/15 00:04:32 drahn Exp $  */
 
 /*
  * Copyright (c) 2020 Brian Bamsch <bbamsch@google.com>
@@ -94,7 +94,7 @@ ENTRY(copyout)
        li      a4, VM_MAXUSER_ADDRESS
        bgt     a3, a4, .Lcopyiofault_nopcb
 
-       la      a4, .Lcopyiofault_user
+       la      a3, .Lcopyiofault_user
        SWAP_FAULT_HANDLER(a3, a4, a5)
        ENTER_USER_ACCESS(a4)