File: aarch64-linux-user-no-pauth.patch

package info (click to toggle)
qemu 1%3A10.1.2%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 415,888 kB
  • sloc: ansic: 4,763,605; pascal: 115,173; python: 105,698; asm: 68,689; sh: 53,146; makefile: 27,519; perl: 18,863; cpp: 11,443; xml: 3,629; objc: 2,877; yacc: 2,505; php: 1,299; tcl: 1,296; lex: 1,110; sql: 71; awk: 43; sed: 35; javascript: 7
file content (27 lines) | stat: -rw-r--r-- 1,244 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
From: Michael Tokarev <mjt@tls.msk.ru>
Date: Mon, 15 Sep 2025 12:58:18 +0300
Subject: aarch64-linux-user: turn off pauth by default
Forwarded: not-needed
Debian-Specific: yes
Bug-Debian: https://bugs.debian.org/1113951

By default, qemu emulates pauth feature (pauth_impdef) on aarch64 CPU.
However, it costs quite a lot of host CPU cycles to implement, which
results in significant slowdowns of the guest code which uses pauth.
Since more and more code uses uses pauth (which is implemented in-cpu
on aarch64, and costs basically nothing on real hardware), we observe
more and more slowness, to the effect of being impractical.

Turn off pauth emulation by default at least for the linux-user case,
so that foreign-arch aarch64 binaries aren't dramatically slow.  For
the qemu system mode, things has to be backwards-compatible and
migratable between qemu versions, so things aren't that simple.

diff --git a/linux-user/aarch64/target_elf.h b/linux-user/aarch64/target_elf.h
--- a/linux-user/aarch64/target_elf.h
+++ b/linux-user/aarch64/target_elf.h
@@ -11,3 +11,3 @@ static inline const char *cpu_get_model(uint32_t eflags)
 {
-    return "any";
+    return "any,pauth=off"; // pauth (any variant of it) is too slow for modern userspace
 }