- disable keyring option - loongarch: Change the UEFI loading mode to loongarch - target/loongarch: Fix qtest test-hmp error when KVM-only build - target/loongarch/kvm: Enable LSX/LASX extension - target/loongarch: Set cpuid CSR register only once with kvm mode - configure: Add linux header compile support for LoongArch - hw/intc/loongarch_extioi: Add vmstate post_load support - hw/intc/loongarch_extioi: Add dynamic cpu number support - hw/loongarch/virt: Set iocsr address space per-board rather than percpu - hw/intc/loongarch_ipi: Use MemTxAttrs interface for ipi ops - target/loongarch: Add loongarch kvm into meson build - target/loongarch: Implement set vcpu intr for kvm - target/loongarch: Restrict TCG-specific code - target/loongarch: Implement kvm_arch_handle_exit - target/loongarch: Implement kvm_arch_init_vcpu - target/loongarch: Implement kvm_arch_init function - target/loongarch: Implement kvm get/set registers - target/loongarch: Supplement vcpu env initial when vcpu reset - target/loongarch: Define some kvm_arch interfaces - linux-headers: Synchronize linux headers from linux v6.7.0-rc8 - linux-headers: Update to Linux v6.7-rc5 - target/loongarch: move translate modules to tcg/ - target/loongarch/meson: move gdbstub.c to loongarch.ss - target/loongarch: Add timer information dump support - hw/loongarch/virt: Align high memory base address with super page size Signed-off-by: Jiabo Feng <fengjiabo1@huawei.com> (cherry picked from commit b2263e41ffa3428f1d9f9ff6e214c8e3a19e06e8)
58 lines
2.0 KiB
Diff
58 lines
2.0 KiB
Diff
From d271f623205c2984a30cfb12e160e219b2bbe974 Mon Sep 17 00:00:00 2001
|
|
From: Bibo Mao <maobibo@loongson.cn>
|
|
Date: Mon, 15 Jan 2024 16:51:21 +0800
|
|
Subject: [PATCH] target/loongarch: Set cpuid CSR register only once with kvm
|
|
mode
|
|
|
|
CSR cpuid register is used for routing irq to different vcpus, its
|
|
value is kept unchanged since poweron. So it is not necessary to
|
|
set CSR cpuid register after system resets, and it is only set at
|
|
vm creation stage.
|
|
|
|
Signed-off-by: Bibo Mao <maobibo@loongson.cn>
|
|
Reviewed-by: Song Gao <gaosong@loongson.cn>
|
|
Message-Id: <20240115085121.180524-1-maobibo@loongson.cn>
|
|
Signed-off-by: Song Gao <gaosong@loongson.cn>
|
|
---
|
|
target/loongarch/kvm/kvm.c | 9 ++++++---
|
|
1 file changed, 6 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/target/loongarch/kvm/kvm.c b/target/loongarch/kvm/kvm.c
|
|
index 84bcdf5f86..2230f029d0 100644
|
|
--- a/target/loongarch/kvm/kvm.c
|
|
+++ b/target/loongarch/kvm/kvm.c
|
|
@@ -250,7 +250,7 @@ static int kvm_loongarch_get_csr(CPUState *cs)
|
|
return ret;
|
|
}
|
|
|
|
-static int kvm_loongarch_put_csr(CPUState *cs)
|
|
+static int kvm_loongarch_put_csr(CPUState *cs, int level)
|
|
{
|
|
int ret = 0;
|
|
LoongArchCPU *cpu = LOONGARCH_CPU(cs);
|
|
@@ -322,8 +322,11 @@ static int kvm_loongarch_put_csr(CPUState *cs)
|
|
ret |= kvm_set_one_reg(cs, KVM_IOC_CSRID(LOONGARCH_CSR_RVACFG),
|
|
&env->CSR_RVACFG);
|
|
|
|
- ret |= kvm_set_one_reg(cs, KVM_IOC_CSRID(LOONGARCH_CSR_CPUID),
|
|
+ /* CPUID is constant after poweron, it should be set only once */
|
|
+ if (level >= KVM_PUT_FULL_STATE) {
|
|
+ ret |= kvm_set_one_reg(cs, KVM_IOC_CSRID(LOONGARCH_CSR_CPUID),
|
|
&env->CSR_CPUID);
|
|
+ }
|
|
|
|
ret |= kvm_set_one_reg(cs, KVM_IOC_CSRID(LOONGARCH_CSR_PRCFG1),
|
|
&env->CSR_PRCFG1);
|
|
@@ -598,7 +601,7 @@ int kvm_arch_put_registers(CPUState *cs, int level)
|
|
return ret;
|
|
}
|
|
|
|
- ret = kvm_loongarch_put_csr(cs);
|
|
+ ret = kvm_loongarch_put_csr(cs, level);
|
|
if (ret) {
|
|
return ret;
|
|
}
|
|
--
|
|
2.27.0
|
|
|