Re: [RFC v2] linux-user/riscv: Add syscall riscv_hwprobe

2023-06-05 Thread Robbin Ehn
On Fri, 2023-06-02 at 20:00 -0700, Richard Henderson wrote: > On 6/2/23 08:07, Andrew Jones wrote: > > On Fri, Jun 02, 2023 at 04:39:20PM +0200, Robbin Ehn wrote: > > > On Fri, 2023-06-02 at 16:02 +0200, Andrew Jones wrote: > > > > On Fri, Jun 02, 2023 at 11:41:11AM +0200, Robbin Ehn wrote: > > ...

Re: [RFC v2] linux-user/riscv: Add syscall riscv_hwprobe

2023-06-05 Thread Robbin Ehn
On Fri, 2023-06-02 at 19:57 -0700, Richard Henderson wrote: > > > +case RISCV_HWPROBE_KEY_CPUPERF_0: > > +pair->value = RISCV_HWPROBE_MISALIGNED_UNKNOWN; > > Is that really what you want to expose here? FAST is always going to be > true, in that > handling the unaligned ac

Re: [RFC v2] linux-user/riscv: Add syscall riscv_hwprobe

2023-06-03 Thread Richard Henderson
On 6/3/23 08:50, Andrew Jones wrote: On Fri, Jun 02, 2023 at 07:58:30PM -0700, Richard Henderson wrote: On 6/2/23 07:02, Andrew Jones wrote: +struct riscv_hwprobe { +int64_t key; +uint64_t value; +}; The above is all uapi so Linux's arch/riscv/include/uapi/asm/hwprobe.h should be pic

Re: [RFC v2] linux-user/riscv: Add syscall riscv_hwprobe

2023-06-03 Thread Andrew Jones
On Fri, Jun 02, 2023 at 07:58:30PM -0700, Richard Henderson wrote: > On 6/2/23 07:02, Andrew Jones wrote: > > > +struct riscv_hwprobe { > > > +int64_t key; > > > +uint64_t value; > > > +}; > > > > The above is all uapi so Linux's arch/riscv/include/uapi/asm/hwprobe.h > > should be picked

Re: [RFC v2] linux-user/riscv: Add syscall riscv_hwprobe

2023-06-02 Thread Richard Henderson
On 6/2/23 08:07, Andrew Jones wrote: On Fri, Jun 02, 2023 at 04:39:20PM +0200, Robbin Ehn wrote: On Fri, 2023-06-02 at 16:02 +0200, Andrew Jones wrote: On Fri, Jun 02, 2023 at 11:41:11AM +0200, Robbin Ehn wrote: ... +#if defined(TARGET_RISCV) +case TARGET_NR_riscv_hwprobe: +{ Th

Re: [RFC v2] linux-user/riscv: Add syscall riscv_hwprobe

2023-06-02 Thread Richard Henderson
On 6/2/23 07:02, Andrew Jones wrote: +struct riscv_hwprobe { +int64_t key; +uint64_t value; +}; The above is all uapi so Linux's arch/riscv/include/uapi/asm/hwprobe.h should be picked up on Linux header update. You'll need to modify the script, scripts/update-linux-headers.sh, to do th

Re: [RFC v2] linux-user/riscv: Add syscall riscv_hwprobe

2023-06-02 Thread Richard Henderson
On 6/2/23 02:41, Robbin Ehn wrote: +struct riscv_hwprobe { +int64_t key; +uint64_t value; +}; This needs to use abi_llong and abi_ullong, as the guest may not have the same alignment requirements as the host. +case RISCV_HWPROBE_KEY_MVENDORID: +pair->value = cf

Re: [RFC v2] linux-user/riscv: Add syscall riscv_hwprobe

2023-06-02 Thread Andrew Jones
On Fri, Jun 02, 2023 at 04:39:20PM +0200, Robbin Ehn wrote: > On Fri, 2023-06-02 at 16:02 +0200, Andrew Jones wrote: > > On Fri, Jun 02, 2023 at 11:41:11AM +0200, Robbin Ehn wrote: ... > > > +#if defined(TARGET_RISCV) > > > +case TARGET_NR_riscv_hwprobe: > > > +{ > > > > The { goes und

Re: [RFC v2] linux-user/riscv: Add syscall riscv_hwprobe

2023-06-02 Thread Robbin Ehn
On Fri, 2023-06-02 at 16:02 +0200, Andrew Jones wrote: > On Fri, Jun 02, 2023 at 11:41:11AM +0200, Robbin Ehn wrote: > > This patch adds the new syscall for the > > "RISC-V Hardware Probing Interface" > > (https://docs.kernel.org/riscv/hwprobe.html). > > > > Signed-off-by: Robbin Ehn > > --- > >

Re: [RFC v2] linux-user/riscv: Add syscall riscv_hwprobe

2023-06-02 Thread Andrew Jones
On Fri, Jun 02, 2023 at 11:41:11AM +0200, Robbin Ehn wrote: > This patch adds the new syscall for the > "RISC-V Hardware Probing Interface" > (https://docs.kernel.org/riscv/hwprobe.html). > > Signed-off-by: Robbin Ehn > --- > v1->v2: Moved to syscall.c > --- > linux-user/riscv/syscall32_nr.h |

[RFC v2] linux-user/riscv: Add syscall riscv_hwprobe

2023-06-02 Thread Robbin Ehn
This patch adds the new syscall for the "RISC-V Hardware Probing Interface" (https://docs.kernel.org/riscv/hwprobe.html). Signed-off-by: Robbin Ehn --- v1->v2: Moved to syscall.c --- linux-user/riscv/syscall32_nr.h | 1 + linux-user/riscv/syscall64_nr.h | 1 + linux-user/syscall.c