Re: [RFC PATCH v2 1/2] hw/riscv: hart: replace array access with qemu_get_cpu()

2023-09-18 Thread Nikita Shubin
Hello Alistair! On Mon, 2023-09-18 at 11:50 +1000, Alistair Francis wrote: > On Thu, Sep 14, 2023 at 6:09 PM Nikita Shubin > wrote: > > > > From: Nikita Shubin > > > > Replace all RISCVHartArrayState->harts[idx] with > > qemu_get_cpu()/cpu_by_arch_id(). > > Thanks for the patch > > Why do we

Re: [RFC PATCH v2 1/2] hw/riscv: hart: replace array access with qemu_get_cpu()

2023-09-17 Thread Alistair Francis
On Thu, Sep 14, 2023 at 6:09 PM Nikita Shubin wrote: > > From: Nikita Shubin > > Replace all RISCVHartArrayState->harts[idx] with > qemu_get_cpu()/cpu_by_arch_id(). Thanks for the patch Why do we want this change though? > > cpu_index is guaranteed to be continuus by cpu_get_free_index(), so t

[RFC PATCH v2 1/2] hw/riscv: hart: replace array access with qemu_get_cpu()

2023-09-14 Thread Nikita Shubin
From: Nikita Shubin Replace all RISCVHartArrayState->harts[idx] with qemu_get_cpu()/cpu_by_arch_id(). cpu_index is guaranteed to be continuus by cpu_get_free_index(), so they can be accessed in same order they were added. "Hart IDs might not necessarily be numbered contiguously in a multiproces