Implement the kvm_arch_init of loongarch, in the function, the
KVM_CAP_MP_STATE cap is checked by kvm ioctl.
Signed-off-by: Tianrui Zhao
Signed-off-by: xianglai li
Reviewed-by: Richard Henderson
Reviewed-by: Song Gao
---
target/loongarch/kvm/kvm.c | 1 +
1 file changed, 1 insertion(+)
diff
Define some functions in target/loongarch/kvm/kvm.c,
such as kvm_arch_put_registers, kvm_arch_get_registers
and kvm_arch_handle_exit, etc. which are needed by
kvm/kvm-all.c. Now the most functions has no content
and they will be implemented in the next patches.
Signed-off-by: Tianrui Zhao
Signed
SET_ONE_UREG64 macro in target/loongarch, and
use the common interface kvm_get/set_one_reg to replace it.
3. Resolve the compiling errors when LoongArch is built by other archs.
Tianrui Zhao (9):
linux-headers: Synchronize linux headers from linux v6.7.0-rc8
target/loongarch: Define some kvm_arc
Use the scripts/update-linux-headers.sh to synchronize linux
headers from linux v6.7.0-rc8. We mainly want to add the
loongarch linux headers and then add the loongarch kvm support
based on it.
Signed-off-by: Tianrui Zhao
Acked-by: Song Gao
---
include/standard-headers/drm/drm_fourcc.h
.
Signed-off-by: Tianrui Zhao
Signed-off-by: xianglai li
Reviewed-by: Song Gao
---
target/loongarch/cpu.h| 2 ++
target/loongarch/kvm/kvm.c| 23 +++
target/loongarch/trace-events | 2 ++
3 files changed, 27 insertions(+)
diff --git a/target/loongarch/cpu.h b/target
Add kvm.c into meson.build to compile it when kvm
is configed. Meanwhile in meson.build, we set the
kvm_targets to loongarch64-softmmu when the cpu is
loongarch. And fix the compiling error when config
is enable-kvm,disable-tcg.
Signed-off-by: Tianrui Zhao
Signed-off-by: xianglai li
Reviewed
Implement kvm_arch_handle_exit for loongarch. In this
function, the KVM_EXIT_LOONGARCH_IOCSR is handled,
we read or write the iocsr address space by the addr,
length and is_write argument in kvm_run.
Signed-off-by: Tianrui Zhao
Signed-off-by: xianglai li
Reviewed-by: Richard Henderson
Reviewed
Supplement vcpu env initial when vcpu reset, including
init vcpu CSR_CPUID,CSR_TID to cpu->cpu_index. The two
regs will be used in kvm_get/set_csr_ioctl.
Signed-off-by: Tianrui Zhao
Signed-off-by: xianglai li
Reviewed-by: Song Gao
---
target/loongarch/cpu.c | 2 ++
target/loongarch/cpu.h
Implement loongarch kvm set vcpu interrupt interface,
when a irq is set in vcpu, we use the KVM_INTERRUPT
ioctl to set intr into kvm.
Signed-off-by: Tianrui Zhao
Signed-off-by: xianglai li
Reviewed-by: Song Gao
---
target/loongarch/cpu.c | 34 +---
target
Implement kvm_arch_get/set_registers interfaces, many regs
can be get/set in the function, such as core regs, csr regs,
fpu regs, mp state, etc.
Signed-off-by: Tianrui Zhao
Signed-off-by: xianglai li
Reviewed-by: Song Gao
Change-Id: Ia8fc48fe08b1768853f7729e77d37cdf270031e4
---
meson.build
Implement loongarch kvm set vcpu interrupt interface,
when a irq is set in vcpu, we use the KVM_INTERRUPT
ioctl to set intr into kvm.
Signed-off-by: Tianrui Zhao
Signed-off-by: xianglai li
---
target/loongarch/cpu.c | 32 +++-
target/loongarch/kvm.c
Supplement vcpu env initial when vcpu reset, including
init vcpu CSR_CPUID,CSR_TID to cpu->cpu_index. The two
regs will be used in kvm_get/set_csr_ioctl.
Signed-off-by: Tianrui Zhao
Signed-off-by: xianglai li
---
target/loongarch/cpu.c | 2 ++
target/loongarch/cpu.h | 2 +-
2 files changed
Use the scripts/update-linux-headers.sh to synchronize linux
headers from linux v6.7.0-rc7. We mainly want to add the
loongarch linux headers and then add the loongarch kvm support
based on it.
Signed-off-by: Tianrui Zhao
---
include/standard-headers/drm/drm_fourcc.h | 2 +
include
.
Signed-off-by: Tianrui Zhao
Signed-off-by: xianglai li
---
target/loongarch/cpu.h| 2 ++
target/loongarch/kvm.c| 23 +++
target/loongarch/trace-events | 2 ++
3 files changed, 27 insertions(+)
diff --git a/target/loongarch/cpu.h b/target/loongarch/cpu.h
index
Implement kvm_arch_handle_exit for loongarch. In this
function, the KVM_EXIT_LOONGARCH_IOCSR is handled,
we read or write the iocsr address space by the addr,
length and is_write argument in kvm_run.
Signed-off-by: Tianrui Zhao
Signed-off-by: xianglai li
Reviewed-by: Richard Henderson
kvm_get/set_one_reg to replace it.
3. Resolve the compiling errors when LoongArch is built by other archs.
Tianrui Zhao (9):
linux-headers: Synchronize linux headers from linux v6.7.0-rc7
target/loongarch: Define some kvm_arch interfaces
target/loongarch: Supplement vcpu env initial when
Implement kvm_arch_get/set_registers interfaces, many regs
can be get/set in the function, such as core regs, csr regs,
fpu regs, mp state, etc.
Signed-off-by: Tianrui Zhao
Signed-off-by: xianglai li
---
meson.build | 1 +
target/loongarch/cpu.c| 3 +
target
Implement the kvm_arch_init of loongarch, in the function, the
KVM_CAP_MP_STATE cap is checked by kvm ioctl.
Signed-off-by: Tianrui Zhao
Signed-off-by: xianglai li
Reviewed-by: Richard Henderson
---
target/loongarch/kvm.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/target/loongarch
Define some functions in target/loongarch/kvm.c, such as
kvm_arch_put_registers, kvm_arch_get_registers and
kvm_arch_handle_exit, etc. which are needed by kvm/kvm-all.c.
Now the most functions has no content and they will be
implemented in the next patches.
Signed-off-by: Tianrui Zhao
Signed-off
Add kvm.c into meson.build to compile it when kvm
is configed. Meanwhile in meson.build, we set the
kvm_targets to loongarch64-softmmu when the cpu is
loongarch. And fix the compiling error when config
is enable-kvm,disable-tcg.
Signed-off-by: Tianrui Zhao
Signed-off-by: xianglai li
Reviewed
Supplement vcpu env initial when vcpu reset, including
init vcpu CSR_CPUID,CSR_TID to cpu->cpu_index. The two
regs will be used in kvm_get/set_csr_ioctl.
Signed-off-by: Tianrui Zhao
Signed-off-by: xianglai li
---
target/loongarch/cpu.c | 2 ++
target/loongarch/cpu.h | 2 +-
2 files changed
Use the scripts/update-linux-headers.sh to synchronize linux
headers from linux v6.7.0-rc6. We mainly want to add the
loongarch linux headers and then add the loongarch kvm support
based on it.
Signed-off-by: Tianrui Zhao
---
include/standard-headers/drm/drm_fourcc.h | 2 +
include
Implement the kvm_arch_init of loongarch, in the function, the
KVM_CAP_MP_STATE cap is checked by kvm ioctl.
Signed-off-by: Tianrui Zhao
Signed-off-by: xianglai li
Reviewed-by: Richard Henderson
---
target/loongarch/kvm.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/target/loongarch
Implement kvm_arch_handle_exit for loongarch. In this
function, the KVM_EXIT_LOONGARCH_IOCSR is handled,
we read or write the iocsr address space by the addr,
length and is_write argument in kvm_run.
Signed-off-by: Tianrui Zhao
Signed-off-by: xianglai li
Reviewed-by: Richard Henderson
KVM patch series are accepted.
2. Remove the DPRINTF macro in kvm.c and use trace events to replace
it, we add some trace functions such as trace_kvm_handle_exit,
trace_kvm_set_intr, trace_kvm_failed_get_csr, etc.
3. Remove the unused functions in kvm_stub.c and move stub function into
the suitable p
Implement kvm_arch_get/set_registers interfaces, many regs
can be get/set in the function, such as core regs, csr regs,
fpu regs, mp state, etc.
Signed-off-by: Tianrui Zhao
Signed-off-by: xianglai li
---
meson.build | 1 +
target/loongarch/cpu.c| 3 +
target
Add kvm.c into meson.build to compile it when kvm
is configed. Meanwhile in meson.build, we set the
kvm_targets to loongarch64-softmmu when the cpu is
loongarch.
Signed-off-by: Tianrui Zhao
Signed-off-by: xianglai li
Reviewed-by: Richard Henderson
---
meson.build | 2
Define some functions in target/loongarch/kvm.c, such as
kvm_arch_put_registers, kvm_arch_get_registers and
kvm_arch_handle_exit, etc. which are needed by kvm/kvm-all.c.
Now the most functions has no content and they will be
implemented in the next patches.
Signed-off-by: Tianrui Zhao
Signed-off
Implement loongarch kvm set vcpu interrupt interface,
when a irq is set in vcpu, we use the KVM_INTERRUPT
ioctl to set intr into kvm.
Signed-off-by: Tianrui Zhao
Signed-off-by: xianglai li
---
target/loongarch/cpu.c | 18 +-
target/loongarch/kvm.c | 15
.
Signed-off-by: Tianrui Zhao
Signed-off-by: xianglai li
---
target/loongarch/cpu.h| 2 ++
target/loongarch/kvm.c| 23 +++
target/loongarch/trace-events | 2 ++
3 files changed, 27 insertions(+)
diff --git a/target/loongarch/cpu.h b/target/loongarch/cpu.h
index
Use the scripts/update-linux-headers.sh to synchronize linux
headers from linux v6.7.0-rc1. We mainly want to add the
loongarch linux headers and then add the loongarch kvm support
based on it.
Signed-off-by: Tianrui Zhao
---
include/standard-headers/drm/drm_fourcc.h | 2 +
include
Add virtio-mmio bus support for LoongArch, so that devices
could be added in the virtio-mmio bus.
Signed-off-by: Tianrui Zhao
Change-Id: Ib882005106562e0dfe74122a7fa2430fa081bfb2
---
hw/loongarch/Kconfig | 1 +
hw/loongarch/acpi-build.c | 25 +
hw/loongarch
Add virtio-mmio bus support for LoongArch, so that devices
could be added in the virtio-mmio bus. And add it's address
info and interrupt number into fdt and dsdt.
Signed-off-by: Tianrui Zhao
---
hw/loongarch/Kconfig | 1 +
hw/loongarch/acpi-build.c | 20
hw
Add virtio-mmio bus support for LoongArch, so that devices
could be added in the virtio-mmio bus.
Signed-off-by: Tianrui Zhao
---
hw/loongarch/Kconfig | 1 +
hw/loongarch/virt.c | 3 +++
2 files changed, 4 insertions(+)
diff --git a/hw/loongarch/Kconfig b/hw/loongarch/Kconfig
index 1e7c5b43c5
Supplement LoongArch cpu topology arguments, including support socket
and threads per core.
Base-on:
https://patchew.org/QEMU/20230613122613.2471743-1-zhaotian...@loongson.cn/
Signed-off-by: Song Gao
Signed-off-by: Tianrui Zhao
---
hw/loongarch/acpi-build.c | 4
hw/loongarch/virt.c
From: Song Gao
1. Implement some functions for LoongArch numa support;
2. Implement fdt_add_memory_node() for fdt;
3. build_srat() fills node_id and adds build numa memory.
Base-on:
https://patchew.org/QEMU/20230613120552.2471420-1-zhaotian...@loongson.cn/
Signed-off-by: Tianrui Zhao
Signed
With acpi madt table, there is cpu physical coreid, which may
be different with logical id in qemu. This patch adds cpu arch_id
support, and fill madt table with arch_id. For the present cpu
arch_id is still equal to logical id.
Signed-off-by: Tianrui Zhao
Signed-off-by: Song Gao
---
hw
LoongArch ipi device uses physical cpuid to route to different
vcpus rather logical cpuid, and the physical cpuid is the same
with cpuid in acpi dsdt and srat table.
Signed-off-by: Tianrui Zhao
Signed-off-by: Song Gao
---
hw/intc/loongarch_ipi.c | 44
This patch add cpu arch_id for LoongArch:
1. Add LoongArch cpu arch_id support;
2. Fill Acpi table with arch_id;
3. set physical cpuid route for LoongArch ipi device.
changes for v2:
1. Fix core_id calculation in ms->possible_cpus, it should be
(n % smp.cores)
Tianrui Zhao (2):
hw/loonga
在 2023年05月31日 16:42, Zhao Liu 写道:
On Tue, May 30, 2023 at 08:20:34PM +0800, Tianrui Zhao wrote:
Date: Tue, 30 May 2023 20:20:34 +0800
From: Tianrui Zhao
Subject: [PATCH] hw/smbios: fix thead count field in type 4 table
X-Mailer: git-send-email 2.39.1
The thread_count value in smbios type_4
Supplement LoongArch cpu topology arguments, including support socket
and threads per core.
Based-on: <20230518014115.117869-1-gaos...@loongson.cn>
Signed-off-by: Tianrui Zhao
---
hw/loongarch/acpi-build.c | 4
hw/loongarch/virt.c | 9 -
2 files changed, 12 insertions
Characteristics: None
Signed-off-by: Tianrui Zhao
---
hw/smbios/smbios.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c
index d2007e70fb..56aeaa069d 100644
--- a/hw/smbios/smbios.c
+++ b/hw/smbios/smbios.c
@@ -713,6 +713,7 @@ s
+ms->possible_cpus->cpus[n].type = ms->cpu_type;
+ms->possible_cpus->cpus[n].arch_id = n;
+ms->possible_cpus->cpus[n].props.has_core_id = true;
+ms->possible_cpus->cpus[n].props.core_id = n;
Should this be core_id = (n / ms->smp.threads
em",
+
+memory_region_add_subregion(address_space_mem, 0, machine->ram);
Hi gaosong
Why need we add machine->ram into address_space_mem at 0 addr ? I think
it may break the previous system memory space and the address of
high_ram is VIRT_HIGHMEM_BASE, so it may should not add the whole ram
i
This patch is only a placeholder now, which is used to
show some kvm structures and macros for reviewers.
And it will be replaced by using update-linux-headers.sh
when the linux loongarch kvm patches are accepted.
Signed-off-by: Tianrui Zhao
---
linux-headers/asm-loongarch/kvm.h | 99
Implement kvm_arch_get/set_registers interfaces, many regs
can be get/set in the function, such as core regs, csr regs,
fpu regs, mp state, etc.
Signed-off-by: Tianrui Zhao
Reviewed-by: Richard Henderson
---
meson.build | 1 +
target/loongarch/cpu.c| 3 +
target
Implement loongarch kvm set vcpu interrupt interface,
when a irq is set in vcpu, we use the KVM_INTERRUPT
ioctl to set intr into kvm.
Signed-off-by: Tianrui Zhao
---
target/loongarch/cpu.c | 18 +-
target/loongarch/kvm-stub.c | 11 +++
target/loongarch
Add kvm.c and kvm-stub.c into meson.build to compile
it when kvm is configed. Meanwhile in meson.build,
we set the kvm_targets to loongarch64-softmmu when
the cpu is loongarch.
Signed-off-by: Tianrui Zhao
Reviewed-by: Richard Henderson
---
meson.build | 2 ++
target/loongarch
Implement kvm_arch_handle_exit for loongarch. In this
function, the KVM_EXIT_LOONGARCH_IOCSR is handled,
we read or write the iocsr address space by the addr,
length and is_write argument in kvm_run.
Signed-off-by: Tianrui Zhao
Reviewed-by: Richard Henderson
---
target/loongarch/kvm.c
such as trace_kvm_handle_exit,
trace_kvm_set_intr, trace_kvm_failed_get_csr, etc.
3. Remove the unused functions in kvm_stub.c and move stub function into
the suitable patch.
Tianrui Zhao (9):
linux-headers: Add KVM headers for loongarch
target/loongarch: Define some kvm_arch interfaces
target/loongarc
Supplement vcpu env initial when vcpu reset, including
init vcpu CSR_CPUID,CSR_TID to cpu->cpu_index. The two
regs will be used in kvm_get/set_csr_ioctl.
Signed-off-by: Tianrui Zhao
---
target/loongarch/cpu.c | 2 ++
target/loongarch/cpu.h | 1 +
2 files changed, 3 insertions(+)
diff --
Implement the kvm_arch_init of loongarch, in the function, the
KVM_CAP_MP_STATE cap is checked by kvm ioctl.
Signed-off-by: Tianrui Zhao
Reviewed-by: Richard Henderson
---
target/loongarch/kvm.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/target/loongarch/kvm.c b/target/loongarch/kvm.c
.
Signed-off-by: Tianrui Zhao
---
target/loongarch/cpu.h| 2 ++
target/loongarch/kvm.c| 23 +++
target/loongarch/trace-events | 2 ++
3 files changed, 27 insertions(+)
diff --git a/target/loongarch/cpu.h b/target/loongarch/cpu.h
index cf3fce4577..beb070de25 100644
Define some functions in target/loongarch/kvm.c, such as
kvm_arch_put_registers, kvm_arch_get_registers and
kvm_arch_handle_exit, etc. which are needed by kvm/kvm-all.c.
Now the most functions has no content and they will be
implemented in the next patches.
Signed-off-by: Tianrui Zhao
Reviewed
在 2023年05月02日 19:32, Richard Henderson 写道:
On 4/27/23 08:26, Tianrui Zhao wrote:
+static void kvm_loongarch_vm_stage_change(void *opaque, bool running,
Typo: state
+uint64_t counter_value;
I know naming is hard, but this is so generic it is difficult
在 2023年05月02日 19:24, Richard Henderson 写道:
On 4/27/23 08:26, Tianrui Zhao wrote:
Implement kvm_arch_get/set_registers interfaces, many regs
can be get/set in the function, such as core regs, csr regs,
fpu regs, mp state, etc.
Signed-off-by: Tianrui Zhao
---
meson.build
在 2023年05月02日 19:04, Richard Henderson 写道:
On 4/27/23 08:26, Tianrui Zhao wrote:
Supplement vcpu env initial when vcpu reset, including
init vcpu mp_state value to KVM_MP_STATE_RUNNABLE and
init vcpu CSR_CPUID,CSR_TID to cpu->cpu_index.
Signed-off-by: Tianrui Zhao
---
target/loonga
Implement kvm_arch_get/set_registers interfaces, many regs
can be get/set in the function, such as core regs, csr regs,
fpu regs, mp state, etc.
Signed-off-by: Tianrui Zhao
---
meson.build | 1 +
target/loongarch/kvm.c| 356 +-
target
.
Signed-off-by: Tianrui Zhao
---
target/loongarch/cpu.h| 1 +
target/loongarch/kvm.c| 23 +++
target/loongarch/trace-events | 2 ++
3 files changed, 26 insertions(+)
diff --git a/target/loongarch/cpu.h b/target/loongarch/cpu.h
index 86b9f26d60..473d9986f3 100644
Supplement vcpu env initial when vcpu reset, including
init vcpu mp_state value to KVM_MP_STATE_RUNNABLE and
init vcpu CSR_CPUID,CSR_TID to cpu->cpu_index.
Signed-off-by: Tianrui Zhao
---
target/loongarch/cpu.c | 3 +++
target/loongarch/cpu.h | 2 ++
2 files changed, 5 insertions(+)
diff --
Define some functions in target/loongarch/kvm.c, such as
kvm_arch_put_registers, kvm_arch_get_registers and
kvm_arch_handle_exit, etc. which are needed by kvm/kvm-all.c.
Now the most functions has no content and they will be
implemented in the next patches.
Signed-off-by: Tianrui Zhao
Implement kvm_arch_handle_exit for loongarch. In this
function, the KVM_EXIT_LOONGARCH_IOCSR is handled,
we read or write the iocsr address space by the addr,
length and is_write argument in kvm_run.
Signed-off-by: Tianrui Zhao
---
target/loongarch/kvm.c| 24
Implement loongarch kvm set vcpu interrupt interface,
when a irq is set in vcpu, we use the KVM_INTERRUPT
ioctl to set intr into kvm.
Signed-off-by: Tianrui Zhao
---
target/loongarch/cpu.c | 18 +-
target/loongarch/kvm-stub.c | 11 +++
target/loongarch
_stub.c and move stub function into
the suitable patch.
Tianrui Zhao (9):
linux-headers: Add KVM headers for loongarch
target/loongarch: Define some kvm_arch interfaces
target/loongarch: Supplement vcpu env initial when vcpu reset
target/loongarch: Implement kvm get/set registers
target/loon
Add kvm.c and kvm-stub.c into meson.build to compile
it when kvm is configed. Meanwhile in meson.build,
we set the kvm_targets to loongarch64-softmmu when
the cpu is loongarch.
Signed-off-by: Tianrui Zhao
---
meson.build | 2 ++
target/loongarch/meson.build | 1 +
2 files
This patch is only a placeholder now, which is used to
show some kvm structures and macros for reviewers.
And it will be replaced by using update-linux-headers.sh
when the linux loongarch kvm patches are accepted.
Signed-off-by: Tianrui Zhao
---
linux-headers/asm-loongarch/kvm.h | 99
Implement the kvm_arch_init of loongarch, in the function, the
KVM_CAP_MP_STATE cap is checked by kvm ioctl.
Signed-off-by: Tianrui Zhao
---
target/loongarch/kvm.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/target/loongarch/kvm.c b/target/loongarch/kvm.c
index 50662fd3fb..8dea294930
在 2023年04月20日 20:59, Tianrui Zhao 写道:
在 2023年04月20日 17:49, Cornelia Huck 写道:
On Thu, Apr 20 2023, Tianrui Zhao wrote:
Add asm-loongarch/kvm.h for loongarch KVM, and update
the linux/kvm.h about loongarch part. The structures in
the header are used as kvm_ioctl arguments.
Just
在 2023年04月20日 17:49, Cornelia Huck 写道:
On Thu, Apr 20 2023, Tianrui Zhao wrote:
Add asm-loongarch/kvm.h for loongarch KVM, and update
the linux/kvm.h about loongarch part. The structures in
the header are used as kvm_ioctl arguments.
Just a procedural note: It's probably best
在 2023年04月20日 18:04, Philippe Mathieu-Daudé 写道:
On 20/4/23 11:36, Tianrui Zhao wrote:
Add kvm-stub.c for loongarch, there are two stub functions:
kvm_loongarch_reset_vcpu and kvm_loongarch_set_interrupt.
Signed-off-by: Tianrui Zhao
---
target/loongarch/kvm-stub.c | 17
在 2023年04月20日 18:00, Philippe Mathieu-Daudé 写道:
On 20/4/23 11:36, Tianrui Zhao wrote:
Implement kvm_arch_handle_exit for loongarch. In this
function, the KVM_EXIT_LOONGARCH_IOCSR is handled,
we read or write the iocsr address space by the addr,
length and is_write argument in kvm_run
Define some functions in target/loongarch/kvm.c, such as
kvm_arch_put_registers, kvm_arch_get_registers and
kvm_arch_handle_exit, etc. which are needed by kvm/kvm-all.c.
Now the most functions has no content and they will be
implemented in the next patches.
Signed-off-by: Tianrui Zhao
Implement the kvm_arch_init of loongarch, in the function, the
KVM_CAP_MP_STATE cap is checked by kvm ioctl.
Signed-off-by: Tianrui Zhao
---
target/loongarch/kvm.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/target/loongarch/kvm.c b/target/loongarch/kvm.c
index 74d499b675..53f495a588
Implement kvm_arch_handle_exit for loongarch. In this
function, the KVM_EXIT_LOONGARCH_IOCSR is handled,
we read or write the iocsr address space by the addr,
length and is_write argument in kvm_run.
Signed-off-by: Tianrui Zhao
---
target/loongarch/kvm.c | 24 +++-
1 file
Implement loongarch kvm set vcpu interrupt interface,
when a irq is set in vcpu, we use the KVM_INTERRUPT
ioctl to set intr into kvm.
Signed-off-by: Tianrui Zhao
---
target/loongarch/cpu.c | 18 +-
target/loongarch/kvm.c | 16
target
Implement kvm_arch_get/set_registers interfaces, many regs
can be get/set in the function, such as core regs, csr regs,
fpu regs, mp state, etc.
Signed-off-by: Tianrui Zhao
---
target/loongarch/kvm.c | 353 -
1 file changed, 351 insertions(+), 2 deletions
Add kvm-stub.c for loongarch, there are two stub functions:
kvm_loongarch_reset_vcpu and kvm_loongarch_set_interrupt.
Signed-off-by: Tianrui Zhao
---
target/loongarch/kvm-stub.c | 17 +
target/loongarch/kvm_loongarch.h | 1 +
2 files changed, 18 insertions(+)
create mode
.
Signed-off-by: Tianrui Zhao
---
target/loongarch/cpu.h | 1 +
target/loongarch/kvm.c | 23 +++
2 files changed, 24 insertions(+)
diff --git a/target/loongarch/cpu.h b/target/loongarch/cpu.h
index 86b9f26d60..473d9986f3 100644
--- a/target/loongarch/cpu.h
+++ b/target/loongarch
Add asm-loongarch/kvm.h for loongarch KVM, and update
the linux/kvm.h about loongarch part. The structures in
the header are used as kvm_ioctl arguments.
Signed-off-by: Tianrui Zhao
---
linux-headers/asm-loongarch/kvm.h | 99 +++
linux-headers/linux/kvm.h
Supplement vcpu env initial when vcpu reset, including
init vcpu mp_state value to KVM_MP_STATE_RUNNABLE and
init vcpu CSR_CPUID,CSR_TID to cpu->cpu_index.
Signed-off-by: Tianrui Zhao
---
target/loongarch/cpu.c | 3 +++
target/loongarch/cpu.h | 2 ++
2 files changed, 5 insertions(+)
diff --
rial stdio -monitor telnet:localhost:4495,server,nowait \
-append "root=/dev/ram rdinit=/sbin/init console=ttyS0,115200" \
--nographic
Tianrui Zhao (10):
linux-headers: Add KVM headers for loongarch
target/loongarch: Define some kvm_arch interfaces
target/loongarch: Supplement v
Add kvm.c and kvm-stub.c into meson.build to compile
it when kvm is configed. Meanwhile in meson.build,
we set the kvm_targets to loongarch64-softmmu when
the cpu is loongarch.
Signed-off-by: Tianrui Zhao
---
meson.build | 2 ++
target/loongarch/meson.build | 1 +
2 files
在 2023年04月18日 20:45, Tianrui Zhao 写道:
在 2023年04月18日 20:40, Song Gao 写道:
Hi, Tianrui
在 2023/4/18 下午8:20, Tianrui Zhao 写道:
Add CSR_CPUID register in cpu_env to save the cpu_index
value.
Why do we need to do this?
For tcg mode, it is enough to use cpu_index. You need to explain
在 2023年04月18日 20:40, Song Gao 写道:
Hi, Tianrui
在 2023/4/18 下午8:20, Tianrui Zhao 写道:
Add CSR_CPUID register in cpu_env to save the cpu_index
value.
Why do we need to do this?
For tcg mode, it is enough to use cpu_index. You need to explain the
reason.
Thank.
Song Gao
We prepare to add
Add CSR_CPUID register in cpu_env to save the cpu_index
value.
Signed-off-by: Tianrui Zhao
---
target/loongarch/cpu.c | 1 +
target/loongarch/cpu.h | 1 +
target/loongarch/insn_trans/trans_privileged.c.inc | 8 +---
3 files changed, 3
The virt addr should mask TARGET_PHYS_ADDR_SPACE_BITS to
get the phys addr, and this is used by loading kernel elf.
Signed-off-by: Tianrui Zhao
---
hw/loongarch/virt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c
index b702c3f51e
This patch adds irq number property for loongarch msi interrupt
controller, and remove hard coding irq number macro.
Signed-off-by: Tianrui Zhao
Reviewed-by: Philippe Mathieu-Daud??
---
hw/intc/loongarch_pch_msi.c | 29 ++---
hw/loongarch/virt.c
Change the default irq number of pch pic to 32, so that the irq
number of pch msi is 224(256 - 32), and move the 'PCH_PIC_IRQ_NUM'
macro to pci-host/ls7a.h and add prefix 'VIRT' on it to keep standard
format.
Signed-off-by: Tianrui Zhao
Reviewed-by: Philippe Mathieu-Daud??
---
hw/intc
With loongarch 7A1000 manual, irq number supported can be set
in PCH_PIC_INT_ID_HI register. This patch adds irq number property
for loongarch_pch_pic, so that virt machine can set different
irq number when pch_pic intc is added.
Signed-off-by: Tianrui Zhao
---
hw/intc/loongarch_pch_pic.c
.
Tianrui Zhao (3):
hw/intc/loongarch_pch_msi: add irq number property
hw/intc/loongarch_pch_pic: add irq number property
hw/intc/loongarch_pch: Change default irq number of pch irq controller
hw/intc/loongarch_pch_msi.c | 29 +---
hw/intc/loongarch_pch_pic.c
With loongarch 7A1000 manual, irq number supported can be set
in PCH_PIC_INT_ID_HI register. This patch adds irq number property
for loongarch_pch_pic, so that virt machine can set different
irq number when pch_pic intc is added.
Signed-off-by: Tianrui Zhao
---
hw/intc/loongarch_pch_pic.c
Change the default irq number of pch pic to 32, so that the irq
number of pch msi is 224(256 - 32), and move the 'PCH_PIC_IRQ_NUM'
macro to pci-host/ls7a.h and add prefix 'VIRT' on it to keep standard
format.
Signed-off-by: Tianrui Zhao
---
hw/intc/loongarch_pch_pic.c | 3 ++-
hw
pch_msi_irq array in pch_msi_unrealize().
Changes for v1:
(1) Add irq number property for loongarch_pch_msi.
(2) Add irq number property for loongarch_pch_pic.
Tianrui Zhao (3):
hw/intc/loongarch_pch_msi: add irq number property
hw/intc/loongarch_pch_pic: add irq number property
hw/intc
This patch adds irq number property for loongarch msi interrupt
controller, and remove hard coding irq number macro.
Signed-off-by: Tianrui Zhao
---
hw/intc/loongarch_pch_msi.c | 33 ++---
hw/loongarch/virt.c | 13 +++-
include/hw/intc
With loongarch 7A1000 manual, irq number supported can be set
in PCH_PIC_INT_ID_HI register. This patch adds irq number property
for loongarch_pch_pic, so that virt machine can set different
irq number when pch_pic intc is added.
Signed-off-by: Tianrui Zhao
---
hw/intc/loongarch_pch_pic.c
This patch adds irq number property for loongarch msi interrupt
controller, and remove hard coding irq number macro.
Signed-off-by: Tianrui Zhao
---
hw/intc/loongarch_pch_msi.c | 33 ++---
hw/loongarch/virt.c | 13 +++-
include/hw/intc
to replace the 256 irq number.
Changes for v2:
(1) Free pch_msi_irq array in pch_msi_unrealize().
Changes for v1:
(1) Add irq number property for loongarch_pch_msi.
(2) Add irq number property for loongarch_pch_pic.
Tianrui Zhao (2):
hw/intc/loongarch_pch_msi: add irq number property
hw/intc
This patch adds irq number property for loongarch msi interrupt
controller, and remove hard coding irq number macro.
Signed-off-by: Tianrui Zhao
---
hw/intc/loongarch_pch_msi.c | 30 ++---
hw/loongarch/virt.c | 11 +++
include/hw/intc
This series add irq number property for loongarch pch_msi
and pch_pic interrupt controller.
Changes for v2:
(1) Free pch_msi_irq array in pch_msi_unrealize().
Changes for v1:
(1) Add irq number property for loongarch_pch_msi.
(2) Add irq number property for loongarch_pch_pic.
Tianrui Zhao (2
With loongarch 7A1000 manual, irq number supported can be set
in PCH_PIC_INT_ID_HI register. This patch adds irq number property
for loongarch_pch_pic, so that virt machine can set different
irq number when pch_pic intc is added.
Signed-off-by: Tianrui Zhao
---
hw/intc/loongarch_pch_pic.c
1 - 100 of 104 matches
Mail list logo