diff mbox series

[1/3] target/riscv/kvm: change kvm_reg_id to uint64_t

Message ID 20240123161714.160149-2-dbarboza@ventanamicro.com
State New
Headers show
Series target/riscv/kvm: support 'vlenb' and vregs[] | expand

Commit Message

Daniel Henrique Barboza Jan. 23, 2024, 4:17 p.m. UTC
The field isn't big enough to hold an uint64_t kvm register and Vector
registers will end up overflowing it.

Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
---
 target/riscv/kvm/kvm-cpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Alistair Francis Jan. 25, 2024, 3:20 a.m. UTC | #1
On Wed, Jan 24, 2024 at 2:18 AM Daniel Henrique Barboza
<dbarboza@ventanamicro.com> wrote:
>
> The field isn't big enough to hold an uint64_t kvm register and Vector
> registers will end up overflowing it.
>
> Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  target/riscv/kvm/kvm-cpu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/target/riscv/kvm/kvm-cpu.c b/target/riscv/kvm/kvm-cpu.c
> index 4dec91740b..902180e8a5 100644
> --- a/target/riscv/kvm/kvm-cpu.c
> +++ b/target/riscv/kvm/kvm-cpu.c
> @@ -145,7 +145,7 @@ typedef struct KVMCPUConfig {
>      const char *name;
>      const char *description;
>      target_ulong offset;
> -    int kvm_reg_id;
> +    uint64_t kvm_reg_id;
>      bool user_set;
>      bool supported;
>  } KVMCPUConfig;
> --
> 2.43.0
>
>
diff mbox series

Patch

diff --git a/target/riscv/kvm/kvm-cpu.c b/target/riscv/kvm/kvm-cpu.c
index 4dec91740b..902180e8a5 100644
--- a/target/riscv/kvm/kvm-cpu.c
+++ b/target/riscv/kvm/kvm-cpu.c
@@ -145,7 +145,7 @@  typedef struct KVMCPUConfig {
     const char *name;
     const char *description;
     target_ulong offset;
-    int kvm_reg_id;
+    uint64_t kvm_reg_id;
     bool user_set;
     bool supported;
 } KVMCPUConfig;