Put GPR CSR and FP registers by kvm by KVM_SET_ONE_REG ioctl
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
target/riscv/kvm.c | 136 -
1 file changed, 135 insertions(+), 1 deletion(-)
diff --git a/target/riscv/kvm.c b/target/riscv/kvm.c
Get isa info from kvm while kvm init.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
target/riscv/kvm.c | 26 +-
1 file changed, 25 insertions(+), 1 deletion(-)
diff --git a/target/riscv/kvm.c b/target/riscv/kvm.c
index 8c386d9acf..3e8f8e7185 100644
Get GPR CSR and FP registers from kvm by KVM_GET_ONE_REG ioctl.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
target/riscv/kvm.c | 144 -
1 file changed, 143 insertions(+), 1 deletion(-)
diff --git a/target/riscv/kvm.c b/target/riscv
Add target/riscv/kvm.c to place kvm_arch_* function needed by kvm/kvm-all.c.
Meanwhile, add riscv64 kvm support to configure.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
configure | 1 +
target/riscv/Makefile.objs | 1 +
target/riscv/kvm.c | 128
Only support supervisor external interrupt currently.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
hw/riscv/sifive_plic.c | 31 ++-
target/riscv/kvm.c | 19 +++
target/riscv/kvm_riscv.h | 1 +
3 files changed, 42 insertions(+), 9
Use char-fe handler console sbi call, which implement early
console io while apply 'earlycon=sbi' into kernel parameters.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
target/riscv/kvm.c | 54 +-
1 file changed, 53 insertions(+), 1
Update linux/kvm.h to commit b9a6e4cd9 on https://github.com/kvm-riscv/linux.
Only use this header file, so do not update all linux headers.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
linux-headers/linux/kvm.h | 8
1 file changed, 8 insertions(+)
diff --git a/linux
Get kernel and fdt start address in virt.c, and pass them to KVM
when cpu reset.In addition,add kvm_riscv.h to place riscv specific
interface.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
hw/riscv/virt.c | 15 +--
target/riscv/cpu.c | 4
target
mat=raw,id=hd0 \
-device virtio-blk-device,drive=hd0 \
-append "root=/dev/vda rw console=ttyS0 earlycon=sbi"
Yifei Jiang (9):
linux-header: Update linux/kvm.h
target/riscv: Add target/riscv/kvm.c to place the public kvm interface
target/riscv: Implement functio
Currently, host cpu is inherited simply.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
target/riscv/cpu.c | 5 +
target/riscv/cpu.h | 1 +
2 files changed, 6 insertions(+)
diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index 3c3264869f..11557719cf 100644
--- a/target
Only support supervisor external interrupt currently.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
hw/riscv/sifive_plic.c | 31 ++-
target/riscv/kvm.c | 19 +++
target/riscv/kvm_riscv.h | 1 +
3 files changed, 42 insertions(+), 9
Get kernel and fdt start address in virt.c, and pass them to KVM
when cpu reset. In addition, add kvm_riscv.h to place riscv specific
interface.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
hw/riscv/virt.c | 16 +---
target/riscv/cpu.c | 4
target
Use char-fe handler console sbi call, which implement early
console io while apply 'earlycon=sbi' into kernel parameters.
The common SBI interface sbi_ecall_interface.h is introduced from
https://github.com/riscv/opensbi/blob/master/include/sbi/sbi_ecall_interface.h.
Signed-off-by: Yifei Jiang
Put GPR CSR and FP registers to kvm by KVM_SET_ONE_REG ioctl
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
target/riscv/kvm.c | 136 -
1 file changed, 135 insertions(+), 1 deletion(-)
diff --git a/target/riscv/kvm.c b/target/riscv/kvm.c
Currently, host cpu is inherited simply.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
target/riscv/cpu.c | 6 ++
target/riscv/cpu.h | 1 +
2 files changed, 7 insertions(+)
diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index 6a6af13ab9..e5b42c3a54 100644
--- a/target
Get GPR CSR and FP registers from kvm by KVM_GET_ONE_REG ioctl.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
target/riscv/kvm.c | 144 -
1 file changed, 143 insertions(+), 1 deletion(-)
diff --git a/target/riscv/kvm.c b/target/riscv
img,format=raw,id=hd0 \
-device virtio-blk-device,drive=hd0 \
-append "root=/dev/vda rw console=ttyS0 earlycon=sbi"
Changes since RFC v1
1、Add separate SBI ecall interface header.
2、Add riscv32 kvm accel support.
Yifei Jiang (9):
linux-header: Update linux/kvm.h
targ
Get isa info from kvm while kvm init.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
target/riscv/kvm.c | 26 +-
1 file changed, 25 insertions(+), 1 deletion(-)
diff --git a/target/riscv/kvm.c b/target/riscv/kvm.c
index 8c386d9acf..3e8f8e7185 100644
Add target/riscv/kvm.c to place kvm_arch_* function needed by kvm/kvm-all.c.
Meanwhile, add kvm support in configure file.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
configure | 1 +
target/riscv/Makefile.objs | 1 +
target/riscv/kvm.c | 128
Update linux/kvm.h to commit b9a6e4cd9 on https://github.com/kvm-riscv/linux.
Only use this header file, so do not update all linux headers.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
linux-headers/linux/kvm.h | 8
1 file changed, 8 insertions(+)
diff --git a/linux
the constant default type is "int", when the constant is shifted to the left,
it may exceed 32 bits, resulting in integer overflowing. So constant type need
change to "long"
Yifei Jiang (2):
tcg: avoid integer overflow
accel/tcg: avoid integer overflow
accel/tcg/cputl
ed using 32-bit arithmetic,
and then used in a context that expects an expression of type "target_ulong"
(64 bits, unsigned).
1525if (addr & ((1 << a_bits) - 1)) {
Signed-off-by: Yifei Jiang
Signed-off-by: Mingwang Li
Reported-by: Euler Robot
---
accel/tcg/cputlb.c
ed using 32-bit arithmetic, and
then used in a context that expects an expression of type "int64_t" (64 bits,
signed).
tcg_gen_muli_i64(t, t, (1 << nbit) - 1);
Signed-off-by: Yifei Jiang
Signed-off-by: Mingwang Li
Reported-by: Euler Robot
---
tcg/tcg-op-gvec.c | 18
/riscv/machine.c.
2. Regenerate some state of PMP at post_load hook.
Yifei Jiang (5):
target/riscv: Add basic vmstate description of CPU
target/riscv: Add PMP state description
target/riscv: Add H extension state description
target/riscv: Add V extension state description
target/riscv: Add
() and pmp_update_rule_nums() to update
'vmstate_pmp_addr' and 'num_rules' respectively.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
target/riscv/machine.c | 50 ++
target/riscv/pmp.c | 29 ++--
target/riscv/pmp.h | 2 ++
3
In the case of supporting V extension, add V extension description
to vmstate_riscv_cpu.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
Reviewed-by: Richard Henderson
---
target/riscv/machine.c | 25 +
1 file changed, 25 insertions(+)
diff --git a/target/riscv
In the case of supporting H extension, add H extension description
to vmstate_riscv_cpu.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
target/riscv/machine.c | 51 ++
1 file changed, 51 insertions(+)
diff --git a/target/riscv/machine.c b
Add basic CPU state description to the newly created machine.c
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
target/riscv/cpu.c | 7
target/riscv/cpu.h | 4 +++
target/riscv/machine.c | 77
target/riscv/meson.build | 3
Add sifive_plic vmstate for supporting sifive_plic migration.
Current vmstate framework only supports one structure parameter
as num field to describe variable length arrays, so introduce
num_enables.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
hw/intc/sifive_plic.c | 26
must be handled by HS-mode. So
introduce TRANSLATE_STAGE2_FAIL so that riscv_cpu_tlb_fill could
distinguish and raise it to HS-mode.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
target/riscv/cpu.h| 1 +
target/riscv/cpu_helper.c | 17 +++--
2 files changed, 16
must be handled by HS-mode. So
introduce TRANSLATE_STAGE2_FAIL so that riscv_cpu_tlb_fill could
distinguish and raise it to HS-mode.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
target/riscv/cpu.h| 10 +++---
target/riscv/cpu_helper.c | 35
Get GPR CSR and FP registers from kvm by KVM_GET_ONE_REG ioctl.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
target/riscv/kvm.c | 150 -
1 file changed, 149 insertions(+), 1 deletion(-)
diff --git a/target/riscv/kvm.c b/target/riscv
Get isa info from kvm while kvm init.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
target/riscv/kvm.c | 26 +-
1 file changed, 25 insertions(+), 1 deletion(-)
diff --git a/target/riscv/kvm.c b/target/riscv/kvm.c
index 8c386d9acf..7983f43f3f 100644
We hope that virtual time adjusts with vm state changing. When a vm
is stopped, guest virtual time should stop counting and kvm_timer
should be stopped. When the vm is resumed, guest virtual time should
continue to count and kvm_timer should be restored.
Signed-off-by: Yifei Jiang
Signed-off
Put GPR CSR and FP registers to kvm by KVM_SET_ONE_REG ioctl
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
target/riscv/kvm.c | 142 -
1 file changed, 141 insertions(+), 1 deletion(-)
diff --git a/target/riscv/kvm.c b/target/riscv/kvm.c
Use char-fe handler console sbi call, which implement early
console io while apply 'earlycon=sbi' into kernel parameters.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
target/riscv/kvm.c | 42 -
target/riscv/sbi_ecall_interface.h | 72
Add target/riscv/kvm.c to place kvm_arch_* function needed by kvm/kvm-all.c.
Meanwhile, add kvm support in configure file.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
Reviewed-by: Alistair Francis
---
configure| 1 +
target/riscv/kvm.c | 128
Describe gpr, fpr and csr in vmstate_riscv_cpu.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
target/riscv/cpu.c | 20 ++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index d8c32a8f84..b698f4adbb 100644
Get kernel and fdt start address in virt.c, and pass them to KVM
when cpu reset. In addition, add kvm_riscv.h to place riscv specific
interface.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
hw/riscv/virt.c | 8
target/riscv/cpu.c | 4
target/riscv
Update linux-headers/linux/kvm.h from https://github.com/kvm-riscv/linux.
Only use this header file, so here do not update all linux headers by
update-linux-headers.sh until above KVM series is accepted.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
linux-headers/linux/kvm.h | 8
on support.
Changes since RFC v1
1. Add separate SBI ecall interface header.
2. Add riscv32 kvm accel support.
Yifei Jiang (14):
linux-header: Update linux/kvm.h
target/riscv: Add target/riscv/kvm.c to place the public kvm interface
target/riscv: Implement function kvm_arch_init_vcpu
tar
Add virtual time context description to vmstate_riscv_cpu. After cpu being
loaded, virtual time context is updated to KVM.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
target/riscv/cpu.c | 11 +++
1 file changed, 11 insertions(+)
diff --git a/target/riscv/cpu.c b/target
Add sifive_plic vmstate for supporting sifive_plic migration.
Current vmstate framework only supports one structure parameter
as num field to describe variable length arrays, so introduce
num_enables.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
hw/riscv/sifive_plic.c | 24
== 0. It's better to adapt in KVM, but it doesn't matter
that adaping in QEMU.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
target/riscv/cpu.h | 6
target/riscv/kvm.c | 72 ++
2 files changed, 78 insertions(+)
diff --git a/target
Only support supervisor external interrupt currently.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
hw/riscv/sifive_plic.c | 31 ++-
target/riscv/kvm.c | 19 +++
target/riscv/kvm_riscv.h | 1 +
3 files changed, 42 insertions(+), 9
Currently, host cpu is inherited simply.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
target/riscv/cpu.c | 6 ++
target/riscv/cpu.h | 1 +
2 files changed, 7 insertions(+)
diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index 266e70cc47..d8c32a8f84 100644
--- a/target
must be handled by HS-mode. So
introduce TRANSLATE_STAGE2_FAIL so that riscv_cpu_tlb_fill could
distinguish and raise it to HS-mode.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
target/riscv/cpu.h| 1 +
target/riscv/cpu_helper.c | 12 ++--
2 files changed, 11
Add basic CPU state description to the newly created machine.c
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
target/riscv/cpu.c | 7 -
target/riscv/cpu.h | 4 +++
target/riscv/machine.c | 59
target/riscv/meson.build | 3
Add sifive_plic vmstate for supporting sifive_plic migration.
Current vmstate framework only supports one structure parameter
as num field to describe variable length arrays, so introduce
num_enables.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
hw/intc/sifive_plic.c | 26
In the case of supporting H extention, add H extention description
to vmstate_riscv_cpu.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
target/riscv/machine.c | 51 ++
1 file changed, 51 insertions(+)
diff --git a/target/riscv/machine.c b
In the case of supporting PMP feature, add PMP state description
to vmstate_riscv_cpu.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
target/riscv/machine.c | 49 ++
1 file changed, 49 insertions(+)
diff --git a/target/riscv/machine.c b/target
In the case of supporting V extention, add V extention description
to vmstate_riscv_cpu.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
target/riscv/machine.c | 25 +
1 file changed, 25 insertions(+)
diff --git a/target/riscv/machine.c b/target/riscv
found that tcg accelerated migration can be supported with a few
changes. Most of the devices have already implemented the migration
interface, so, to achieve the tcg accelerated migration, we just need to
add vmstate of both cpu and sifive_plic.
Yifei Jiang (5):
target/riscv: Add basic vmstate
mstatus/mstatush and vsstatus/vsstatush are two halved for RISCV32.
This patch expands mstatus and vsstatus to uint64_t instead of
target_ulong so that it can be saved as one unit and reduce some
ifdefs in the code.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
target/riscv/cpu.c
() and pmp_update_rule_nums() to update
'vmstate_pmp_addr' and 'num_rules' respectively.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
target/riscv/machine.c | 50 ++
target/riscv/pmp.c | 29 ++--
target/riscv/pmp.h | 2 ++
3
In the case of supporting H extension, add H extension description
to vmstate_riscv_cpu.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
target/riscv/machine.c | 47 ++
1 file changed, 47 insertions(+)
diff --git a/target/riscv/machine.c b
In the case of supporting V extension, add V extension description
to vmstate_riscv_cpu.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
Reviewed-by: Richard Henderson
---
target/riscv/machine.c | 25 +
1 file changed, 25 insertions(+)
diff --git a/target/riscv
declaration to internals.h.
2. Merge m/vsstatus and m/vsstatush into one uint64_t unit.
Changes since v1:
1. Add license head to target/riscv/machine.c.
2. Regenerate some state of PMP at post_load hook.
Yifei Jiang (6):
target/riscv: Merge m/vsstatus and m/vsstatush into one uint64_t unit
target
Add sifive_plic vmstate for supporting sifive_plic migration.
Current vmstate framework only supports one structure parameter
as num field to describe variable length arrays, so introduce
num_enables.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
hw/intc/sifive_plic.c | 26
Add basic CPU state description to the newly created machine.c
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
target/riscv/cpu.c | 8 +
target/riscv/internals.h | 4 +++
target/riscv/machine.c | 74
target/riscv/meson.build | 3
mstatus/mstatush and vsstatus/vsstatush are two halved for RISCV32.
This patch expands mstatus and vsstatus to uint64_t instead of
target_ulong so that it can be saved as one unit and reduce some
ifdefs in the code.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
Signed-off-by: Alistair
.
Changes since v1:
1. Add license head to target/riscv/machine.c.
2. Regenerate some state of PMP at post_load hook.
Yifei Jiang (6):
target/riscv: Merge m/vsstatus and m/vsstatush into one uint64_t unit
target/riscv: Add basic vmstate description of CPU
target/riscv: Add PMP state
Add sifive_plic vmstate for supporting sifive_plic migration.
Current vmstate framework only supports one structure parameter
as num field to describe variable length arrays, so introduce
num_enables.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
Reviewed-by: Alistair Francis
---
hw
Add basic CPU state description to the newly created machine.c
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
Reviewed-by: Alistair Francis
---
target/riscv/cpu.c | 8 +
target/riscv/internals.h | 4 +++
target/riscv/machine.c | 74
In the case of supporting H extension, add H extension description
to vmstate_riscv_cpu.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
Reviewed-by: Alistair Francis
---
target/riscv/machine.c | 47 ++
1 file changed, 47 insertions(+)
diff --git
In the case of supporting V extension, add V extension description
to vmstate_riscv_cpu.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
Reviewed-by: Richard Henderson
Reviewed-by: Alistair Francis
---
target/riscv/machine.c | 25 +
1 file changed, 25 insertions
() and pmp_update_rule_nums() to update
'vmstate_pmp_addr' and 'num_rules' respectively.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
Reviewed-by: Alistair Francis
---
target/riscv/machine.c | 50 ++
target/riscv/pmp.c | 29
_names. So
introduce riscv_cpu_get_trap_name to get the trap cause name.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
target/riscv/cpu.c| 11 +++
target/riscv/cpu.h| 1 +
target/riscv/cpu_helper.c | 4 ++--
3 files changed, 14 insertions(+), 2 deletions(-)
s.SUM is ignored."
But get_physical_address() doesn't ignore sstatus.SUM, when HLVX/HLV/HSV
accesses guest userspace memory. So this patch fixes it.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
target/riscv/cpu_helper.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Put GPR CSR and FP registers to kvm by KVM_SET_ONE_REG ioctl
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
target/riscv/kvm.c | 142 -
1 file changed, 141 insertions(+), 1 deletion(-)
diff --git a/target/riscv/kvm.c b/target/riscv/kvm.c
will be abort.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
target/riscv/machine.c | 8
1 file changed, 8 insertions(+)
diff --git a/target/riscv/machine.c b/target/riscv/machine.c
index ef2d5395a8..6955542fef 100644
--- a/target/riscv/machine.c
+++ b/target/riscv/machine.c
Add virtual time context description to vmstate_riscv_cpu. After cpu being
loaded, virtual time context is updated to KVM.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
target/riscv/machine.c | 14 ++
1 file changed, 14 insertions(+)
diff --git a/target/riscv/machine.c
Use char-fe to handle console sbi call, which implement early
console io while apply 'earlycon=sbi' into kernel parameters.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
target/riscv/kvm.c | 42 -
target/riscv/sbi_ecall_interface.h | 72
Get isa info from kvm while kvm init.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
target/riscv/kvm.c | 27 ++-
1 file changed, 26 insertions(+), 1 deletion(-)
diff --git a/target/riscv/kvm.c b/target/riscv/kvm.c
index 8c386d9acf..86660ba81b 100644
Currently, host cpu is inherited simply.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
target/riscv/cpu.c | 6 ++
target/riscv/cpu.h | 1 +
2 files changed, 7 insertions(+)
diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index faee98a58c..439dc89ee7 100644
--- a/target
We hope that virtual time adjusts with vm state changing. When a vm
is stopped, guest virtual time should stop counting and kvm_timer
should be stopped. When the vm is resumed, guest virtual time should
continue to count and kvm_timer should be restored.
Signed-off-by: Yifei Jiang
Signed-off
v2
- Fix checkpatch error at target/riscv/sbi_ecall_interface.h.
- Add riscv migration support.
Changes since RFC v1
- Add separate SBI ecall interface header.
- Add riscv32 kvm accel support.
Yifei Jiang (15):
linux-header: Update linux/kvm.h
target/riscv: Add target/riscv/kvm.c to place the
Get GPR CSR and FP registers from kvm by KVM_GET_ONE_REG ioctl.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
target/riscv/kvm.c | 150 -
1 file changed, 149 insertions(+), 1 deletion(-)
diff --git a/target/riscv/kvm.c b/target/riscv
Update linux-headers/linux/kvm.h from
https://github.com/avpatel/linux/tree/riscv_kvm_v15.
Only use this header file, so here do not update all linux headers by
update-linux-headers.sh before above KVM series is accepted.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
linux-headers
If vcpu's frequency is specified by cpu option 'frequency', it
will be set into KVM by KVM_SET_ONE_REG ioctl. Otherwise, vcpu's
frequency will follow KVM by KVM_GET_ONE_REG ioctl.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
target/riscv/kvm.c | 17 +
1 file changed
Only support supervisor external interrupt currently.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
hw/intc/sifive_plic.c| 31 ++-
target/riscv/kvm.c | 19 +++
target/riscv/kvm_riscv.h | 1 +
3 files changed, 42 insertions(+), 9
Add kvm_riscv_get/put_regs_timer to synchronize virtual time context
from KVM.
To set register of RISCV_TIMER_REG(state) will occur a error from KVM
on kvm_timer_state == 0. It's better to adapt in KVM, but it doesn't matter
that adaping in QEMU.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
hw/riscv/virt.c| 18 ++
target/riscv/cpu.c | 3 +++
target/riscv/cpu.h | 2 ++
3 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
index 47b7018193..788a7237b6 100644
---
Get kernel and fdt start address in virt.c, and pass them to KVM
when cpu reset. In addition, add kvm_riscv.h to place riscv specific
interface.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
hw/riscv/virt.c | 8
target/riscv/cpu.c | 4
target/riscv
Add target/riscv/kvm.c to place kvm_arch_* function needed by
kvm/kvm-all.c. Meanwhile, add kvm support in meson.build file.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
Reviewed-by: Alistair Francis
---
meson.build | 2 +
target/riscv/kvm.c | 128
Add the support needed for creating prstatus elf notes. Now elf notes
only contains user_regs. This allows us to use QMP dump-guest-memory.
Signed-off-by: Yifei Jiang
Signed-off-by: Mingwang Li
---
target/riscv/arch_dump.c | 189 +++
target/riscv/cpu.c
0x000485b3 0x00090633
0x8020: 0x046358fd 0x1d630118 0x08171305 0x0813
0x8030: 0x48854868 0x0118282f 0x12081463 0x0297
0x8040: 0x48428293 0x0317 0xfbc30313 0x0062b023
...
Yifei Jiang (1):
target-riscv: support QM
Add the support needed for creating prstatus elf notes. Now elf notes
only contains user_regs. This allows us to use QMP dump-guest-memory.
Signed-off-by: Yifei Jiang
Signed-off-by: Mingwang Li
---
target/riscv/arch_dump.c | 189 +++
target/riscv/cpu.c
e for RISC-V linux user.
Yifei Jiang (1):
target-riscv: support QMP dump-guest-memory
target/riscv/arch_dump.c | 189 +++
target/riscv/cpu.c | 2 +
target/riscv/cpu.h | 4 +
target/riscv/cpu_bits.h | 1 +
target/riscv/meson.build | 1 +
5 f
Add the support needed for creating prstatus elf notes. Now elf notes
only contains user_regs. This allows us to use QMP dump-guest-memory.
Signed-off-by: Yifei Jiang
Signed-off-by: Mingwang Li
---
target/riscv/arch_dump.c | 202 +++
target/riscv/cpu.c
s since v1
1. Fix the build failure for RISC-V linux user.
Yifei Jiang (1):
target-riscv: support QMP dump-guest-memory
target/riscv/arch_dump.c | 202 +++
target/riscv/cpu.c | 2 +
target/riscv/cpu.h | 4 +
target/riscv/cpu_bits.h | 1 +
Add the support needed for creating prstatus elf notes. This allows
us to use QMP dump-guest-memory.
Now ELF notes of RISC-V only contain prstatus elf notes.
Signed-off-by: Yifei Jiang
Signed-off-by: Mingwang Li
Reviewed-by: Alistair Francis
Reviewed-by: Andrew Jones
Reviewed-by: Palmer
ion and code comments
Changes since v2
1. Add build-bugs.
Changes since v1
1. Fix the build failure for RISC-V linux user.
Yifei Jiang (1):
target-riscv: support QMP dump-guest-memory
target/riscv/arch_dump.c | 202 +++
target/riscv/cpu.c | 2 +
target
Get isa info from kvm while kvm init.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
target/riscv/kvm.c | 27 ++-
1 file changed, 26 insertions(+), 1 deletion(-)
diff --git a/target/riscv/kvm.c b/target/riscv/kvm.c
index 687dd4b621..0d924be33f 100644
Add target/riscv/kvm.c to place kvm_arch_* function needed by
kvm/kvm-all.c. Meanwhile, add kvm support in meson.build file.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
Reviewed-by: Alistair Francis
---
meson.build | 2 +
target/riscv/kvm.c | 133
Update linux-headers/linux/kvm.h from
https://github.com/avpatel/linux/tree/riscv_kvm_v17.
Only use this header file, so here do not update all linux headers by
update-linux-headers.sh until above KVM series is accepted.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
linux-headers
'host' type cpu is set isa to RVXLEN simply, more isa info
will obtain from KVM in kvm_arch_init_vcpu()
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
target/riscv/cpu.c | 9 +
target/riscv/cpu.h | 1 +
2 files changed, 10 insertions(+)
diff --git a/target/riscv/cpu.c b
Add virtual time context description to vmstate_riscv_cpu. After cpu being
loaded, virtual time context is updated to KVM.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
target/riscv/machine.c | 14 ++
1 file changed, 14 insertions(+)
diff --git a/target/riscv/machine.c
Add kvm_riscv_get/put_regs_timer to synchronize virtual time context
from KVM.
To set register of RISCV_TIMER_REG(state) will occur a error from KVM
on kvm_timer_state == 0. It's better to adapt in KVM, but it doesn't matter
that adaping in QEMU.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng
Changes since RFC v2
- Fix checkpatch error at target/riscv/sbi_ecall_interface.h.
- Add riscv migration support.
Changes since RFC v1
- Add separate SBI ecall interface header.
- Add riscv32 kvm accel support.
Yifei Jiang (12):
linux-header: Update linux/kvm.h
target/riscv: Add target/
1 - 100 of 185 matches
Mail list logo