Skip to content

Commit 3011b29

Browse files
bibo-maochenhuacai
authored andcommitted
LoongArch: KVM: Set host with kernel mode when switch to VM mode
PRMD register is only meaningful on the beginning stage of exception entry, and it is overwritten with nested irq or exception. When CPU runs in VM mode, interrupt need be enabled on host. And the mode for host had better be kernel mode rather than random or user mode. When VM is running, the running mode with top command comes from CRMD register, and running mode should be kernel mode since kernel function is executing with perf command. It needs be consistent with both top and perf command. Signed-off-by: Bibo Mao <[email protected]> Signed-off-by: Huacai Chen <[email protected]>
1 parent d8cc4fe commit 3011b29

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/loongarch/kvm/switch.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
* Guest CRMD comes from separate GCSR_CRMD register
8686
*/
8787
ori t0, zero, CSR_PRMD_PIE
88-
csrxchg t0, t0, LOONGARCH_CSR_PRMD
88+
csrwr t0, LOONGARCH_CSR_PRMD
8989

9090
/* Set PVM bit to setup ertn to guest context */
9191
ori t0, zero, CSR_GSTAT_PVM

0 commit comments

Comments
 (0)