Re: [PATCH] target/riscv/kvm.c: fix mvendorid size in vcpu_set_machine_ids()

2023-08-11 Thread Daniel Henrique Barboza
On 8/10/23 14:01, Alistair Francis wrote: On Wed, Aug 9, 2023 at 6:17 PM Daniel Henrique Barboza wrote: Drew, On 8/3/23 09:05, Andrew Jones wrote: On Thu, Aug 03, 2023 at 08:36:57AM -0300, Daniel Henrique Barboza wrote: On 8/3/23 06:29, Andrew Jones wrote: On Wed, Aug 02, 2023 at 03:0

Re: [PATCH] target/riscv/kvm.c: fix mvendorid size in vcpu_set_machine_ids()

2023-08-10 Thread Alistair Francis
On Wed, Aug 9, 2023 at 6:17 PM Daniel Henrique Barboza wrote: > > Drew, > > On 8/3/23 09:05, Andrew Jones wrote: > > On Thu, Aug 03, 2023 at 08:36:57AM -0300, Daniel Henrique Barboza wrote: > >> > >> > >> On 8/3/23 06:29, Andrew Jones wrote: > >>> On Wed, Aug 02, 2023 at 03:00:58PM -0300, Daniel H

Re: [PATCH] target/riscv/kvm.c: fix mvendorid size in vcpu_set_machine_ids()

2023-08-10 Thread Alistair Francis
On Wed, Aug 2, 2023 at 2:02 PM Daniel Henrique Barboza wrote: > > cpu->cfg.mvendorid is a 32 bit field and kvm_set_one_reg() always write > a target_ulong val, i.e. a 64 bit field in a 64 bit host. > > Given that we're passing a pointer to the mvendorid field, the reg is > reading 64 bits starting

Re: [PATCH] target/riscv/kvm.c: fix mvendorid size in vcpu_set_machine_ids()

2023-08-10 Thread Alistair Francis
On Wed, Aug 2, 2023 at 2:02 PM Daniel Henrique Barboza wrote: > > cpu->cfg.mvendorid is a 32 bit field and kvm_set_one_reg() always write > a target_ulong val, i.e. a 64 bit field in a 64 bit host. > > Given that we're passing a pointer to the mvendorid field, the reg is > reading 64 bits starting

Re: [PATCH] target/riscv/kvm.c: fix mvendorid size in vcpu_set_machine_ids()

2023-08-10 Thread Andrew Jones
On Wed, Aug 09, 2023 at 07:16:00PM -0300, Daniel Henrique Barboza wrote: > Drew, > > On 8/3/23 09:05, Andrew Jones wrote: > > On Thu, Aug 03, 2023 at 08:36:57AM -0300, Daniel Henrique Barboza wrote: ... > > So, I think we need a helper that has a switch on the KVM register type > > and provides th

Re: [PATCH] target/riscv/kvm.c: fix mvendorid size in vcpu_set_machine_ids()

2023-08-10 Thread Andrew Jones
On Wed, Aug 02, 2023 at 03:00:58PM -0300, Daniel Henrique Barboza wrote: > cpu->cfg.mvendorid is a 32 bit field and kvm_set_one_reg() always write > a target_ulong val, i.e. a 64 bit field in a 64 bit host. > > Given that we're passing a pointer to the mvendorid field, the reg is > reading 64 bits

Re: [PATCH] target/riscv/kvm.c: fix mvendorid size in vcpu_set_machine_ids()

2023-08-09 Thread Daniel Henrique Barboza
Drew, On 8/3/23 09:05, Andrew Jones wrote: On Thu, Aug 03, 2023 at 08:36:57AM -0300, Daniel Henrique Barboza wrote: On 8/3/23 06:29, Andrew Jones wrote: On Wed, Aug 02, 2023 at 03:00:58PM -0300, Daniel Henrique Barboza wrote: cpu->cfg.mvendorid is a 32 bit field and kvm_set_one_reg() always

Re: [PATCH] target/riscv/kvm.c: fix mvendorid size in vcpu_set_machine_ids()

2023-08-03 Thread Daniel Henrique Barboza
On 8/3/23 09:05, Andrew Jones wrote: On Thu, Aug 03, 2023 at 08:36:57AM -0300, Daniel Henrique Barboza wrote: On 8/3/23 06:29, Andrew Jones wrote: On Wed, Aug 02, 2023 at 03:00:58PM -0300, Daniel Henrique Barboza wrote: cpu->cfg.mvendorid is a 32 bit field and kvm_set_one_reg() always wri

Re: [PATCH] target/riscv/kvm.c: fix mvendorid size in vcpu_set_machine_ids()

2023-08-03 Thread Andrew Jones
On Thu, Aug 03, 2023 at 08:36:57AM -0300, Daniel Henrique Barboza wrote: > > > On 8/3/23 06:29, Andrew Jones wrote: > > On Wed, Aug 02, 2023 at 03:00:58PM -0300, Daniel Henrique Barboza wrote: > > > cpu->cfg.mvendorid is a 32 bit field and kvm_set_one_reg() always write > > > a target_ulong val,

Re: [PATCH] target/riscv/kvm.c: fix mvendorid size in vcpu_set_machine_ids()

2023-08-03 Thread Daniel Henrique Barboza
On 8/3/23 06:29, Andrew Jones wrote: On Wed, Aug 02, 2023 at 03:00:58PM -0300, Daniel Henrique Barboza wrote: cpu->cfg.mvendorid is a 32 bit field and kvm_set_one_reg() always write a target_ulong val, i.e. a 64 bit field in a 64 bit host. Given that we're passing a pointer to the mvendorid

Re: [PATCH] target/riscv/kvm.c: fix mvendorid size in vcpu_set_machine_ids()

2023-08-03 Thread Andrew Jones
On Wed, Aug 02, 2023 at 03:00:58PM -0300, Daniel Henrique Barboza wrote: > cpu->cfg.mvendorid is a 32 bit field and kvm_set_one_reg() always write > a target_ulong val, i.e. a 64 bit field in a 64 bit host. > > Given that we're passing a pointer to the mvendorid field, the reg is > reading 64 bits

[PATCH] target/riscv/kvm.c: fix mvendorid size in vcpu_set_machine_ids()

2023-08-02 Thread Daniel Henrique Barboza
cpu->cfg.mvendorid is a 32 bit field and kvm_set_one_reg() always write a target_ulong val, i.e. a 64 bit field in a 64 bit host. Given that we're passing a pointer to the mvendorid field, the reg is reading 64 bits starting from mvendorid and going 32 bits in the next field, marchid. Here's an ex