On Sun, Jan 10, 2021 at 11:55 AM Peter Maydell <peter.mayd...@linaro.org> wrote: > > On Fri, 18 Dec 2020 at 06:01, Alistair Francis <alistair.fran...@wdc.com> > wrote: > > > > Instead of using string compares to determine if a RISC-V machine is > > using 32-bit or 64-bit CPUs we can use the initalised CPUs. This avoids > > us having to maintain a list of CPU names to compare against. > > > > This commit also fixes the name of the function to match the > > riscv_cpu_is_32bit() function. > > > > Signed-off-by: Alistair Francis <alistair.fran...@wdc.com> > > Reviewed-by: Richard Henderson <richard.hender...@linaro.org> > > Message-id: > > 8ab7614e5df93ab5267788b73dcd75f9f5615e82.1608142916.git.alistair.fran...@wdc.com > > Hi; coverity points out a probably-unintentional inefficiency here > (CID 1438099, CID 1438100, CID 1438101): > > > --- a/hw/riscv/boot.c > > +++ b/hw/riscv/boot.c > > @@ -33,28 +33,16 @@ > > > > #include <libfdt.h> > > > > -bool riscv_is_32_bit(MachineState *machine) > > +bool riscv_is_32bit(RISCVHartArrayState harts) > > The RISCVHartArrayState type is 824 bytes long. That's a very > big type to be passing by value. You probably wanted to pass a > pointer to it instead. Similarly for the arguments to > riscv_calc_kernel_start_addr() and riscv_setup_rom_reset_vec().
Thanks Peter, I'll send a patch. Alistair > > thanks > -- PMM