[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 7/8] target/riscv: Enable PC-relative translation in system mo
From: |
Weiwei Li |
Subject: |
[PATCH v4 7/8] target/riscv: Enable PC-relative translation in system mode |
Date: |
Fri, 31 Mar 2023 23:06:08 +0800 |
The existence of CF_PCREL can improve performance with the guest
kernel's address space randomization. Each guest process maps
libc.so (et al) at a different virtual address, and this allows
those translations to be shared.
Signed-off-by: Weiwei Li <liweiwei@iscas.ac.cn>
Signed-off-by: Junqiang Wang <wangjunqiang@iscas.ac.cn>
Reviewed-by: LIU Zhiwei <zhiwei_liu@linux.alibaba.com>
---
target/riscv/cpu.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index 646fa31a59..3b562d5d9f 100644
--- a/target/riscv/cpu.c
+++ b/target/riscv/cpu.c
@@ -1193,6 +1193,8 @@ static void riscv_cpu_realize(DeviceState *dev, Error
**errp)
#ifndef CONFIG_USER_ONLY
+ cs->tcg_cflags |= CF_PCREL;
+
if (cpu->cfg.ext_sstc) {
riscv_timer_init(cpu);
}
--
2.25.1
- Re: [PATCH v4 5/8] accel/tcg: Fix overwrite problems of tcg_cflags, (continued)
[PATCH v4 6/8] accel/tcg: Fix tb mis-matched problem when CF_PCREL is enabled, Weiwei Li, 2023/03/31
[PATCH v4 8/8] target/riscv: Add pointer mask support for instruction fetch, Weiwei Li, 2023/03/31
[PATCH v4 2/8] target/riscv: Update cur_pmmask/base when xl changes, Weiwei Li, 2023/03/31
[PATCH v4 3/8] target/riscv: Fix target address to update badaddr, Weiwei Li, 2023/03/31
[PATCH v4 7/8] target/riscv: Enable PC-relative translation in system mode,
Weiwei Li <=
[PATCH v4 4/8] target/riscv: Add support for PC-relative translation, Weiwei Li, 2023/03/31