G, so move
riscv_cpu_update_mip() to target/riscv/cpu.c from target/riscv/cpu_helper.c
Signed-off-by: Yifei Jiang
Signed-off-by: Mingwang Li
Reviewed-by: Alistair Francis
---
target/riscv/cpu.c| 34 ++
target/riscv/cpu_helper.c | 27 ---
target
Get GPR CSR and FP registers from kvm by KVM_GET_ONE_REG ioctl.
Signed-off-by: Yifei Jiang
Signed-off-by: Mingwang Li
Reviewed-by: Alistair Francis
---
target/riscv/kvm.c | 150 -
1 file changed, 149 insertions(+), 1 deletion(-)
diff --git a/target
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
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: Mingwang Li
---
target/riscv/kvm.c | 42 -
target/riscv/sbi_ecall_interface.h | 72
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: Mingwang Li
Reviewed-by: Alistair Francis
---
target/riscv/kvm.c | 141 -
1 file changed, 140 insertions(+), 1 deletion(-)
diff --git a/target
'host' type cpu is set isa to RV32 or RV64 simply, more isa info
will obtain from KVM in kvm_arch_init_vcpu()
Signed-off-by: Yifei Jiang
Signed-off-by: Mingwang Li
Reviewed-by: Alistair Francis
---
target/riscv/cpu.c | 15 +++
target/riscv/cpu.h | 1 +
2 files changed, 16
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: Mingwang Li
---
target/riscv/machine.c | 14 ++
1 file changed, 14 insertions(+)
diff --git a/target/riscv/machine.c
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: Mingwang Li
Reviewed-by: Alistair Francis
---
hw/riscv/boot.c | 11 +++
hw/riscv/virt.c
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: Mingwang Li
Reviewed-by: Alistair Francis
---
meson.build | 2 +
target/riscv/kvm.c | 133
Add asm-riscv/kvm.h for RISC-V KVM, and update linux/kvm.h
Signed-off-by: Yifei Jiang
Signed-off-by: Mingwang Li
---
linux-headers/asm-riscv/kvm.h | 128 ++
linux-headers/linux/kvm.h | 8 +++
2 files changed, 136 insertions(+)
create mode 100644 linux
scaling support(New patches 13, 14 and 15).
- Fix the bug that guest vm can't reboot.
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 suppo
Get isa info from kvm while kvm init.
Signed-off-by: Yifei Jiang
Signed-off-by: Mingwang Li
Reviewed-by: Alistair Francis
---
target/riscv/kvm.c | 32 +++-
1 file changed, 31 insertions(+), 1 deletion(-)
diff --git a/target/riscv/kvm.c b/target/riscv/kvm.c
index
Update linux-headers/linux/kvm.h from
https://github.com/avpatel/linux/tree/riscv_kvm_v19.
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: Mingwang Li
---
linux-headers
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: Mingwang Li
---
target/riscv/machine.c | 14 ++
1 file changed, 14 insertions(+)
diff --git a/target/riscv/machine.c
Get isa info from kvm while kvm init.
Signed-off-by: Yifei Jiang
Signed-off-by: Mingwang Li
Reviewed-by: Alistair Francis
---
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
G, so move
riscv_cpu_update_mip() to target/riscv/cpu.c from target/riscv/cpu_helper.c
Signed-off-by: Yifei Jiang
Signed-off-by: Mingwang Li
Reviewed-by: Alistair Francis
---
target/riscv/cpu.c| 34 ++
target/riscv/cpu_helper.c | 27 ---
target
Put GPR CSR and FP registers to kvm by KVM_SET_ONE_REG ioctl
Signed-off-by: Yifei Jiang
Signed-off-by: Mingwang Li
Reviewed-by: Alistair Francis
---
target/riscv/kvm.c | 141 -
1 file changed, 140 insertions(+), 1 deletion(-)
diff --git a/target
Get GPR CSR and FP registers from kvm by KVM_GET_ONE_REG ioctl.
Signed-off-by: Yifei Jiang
Signed-off-by: Mingwang Li
Reviewed-by: Alistair Francis
---
target/riscv/kvm.c | 150 -
1 file changed, 149 insertions(+), 1 deletion(-)
diff --git 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
d separate SBI ecall interface header.
- Add riscv32 kvm accel support.
Yifei Jiang (12):
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
target/riscv: Implement kvm_arch_get_regi
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: Mingwang Li
---
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 meson.build file.
Signed-off-by: Yifei Jiang
Signed-off-by: Mingwang Li
Reviewed-by: Alistair Francis
---
meson.build | 2 +
target/riscv/kvm.c | 133
'host' type cpu is set isa to RV32 or RV64 simply, more isa info
will obtain from KVM in kvm_arch_init_vcpu()
Signed-off-by: Yifei Jiang
Signed-off-by: Mingwang Li
Reviewed-by: Alistair Francis
---
target/riscv/cpu.c | 15 +++
target/riscv/cpu.h | 1 +
2 files changed, 16
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: Mingwang Li
Reviewed-by: Alistair Francis
---
hw/riscv/boot.c | 11 +++
hw/riscv/virt.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
'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
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
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/boot.c | 11 +++
hw/riscv/virt.c | 7 +++
include/hw
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
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
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
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
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/
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 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
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
Only support supervisor external interrupt currently.
Signed-off-by: Yifei Jiang
Signed-off-by: Yipeng Yin
---
hw/intc/sifive_plic.c| 29 -
target/riscv/kvm-stub.c | 5 +
target/riscv/kvm.c | 20
target/riscv/kvm_riscv.h | 1
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
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
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 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/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
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
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
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
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
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
---
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
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
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
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
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
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
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
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
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
== 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
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
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
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
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
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
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
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 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
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
70 matches
Mail list logo