[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 18/33] target/nios2: Implement cpuid
From: |
Peter Maydell |
Subject: |
Re: [PATCH v4 18/33] target/nios2: Implement cpuid |
Date: |
Tue, 8 Mar 2022 10:52:51 +0000 |
On Tue, 8 Mar 2022 at 07:20, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Copy the existing cpu_index into the space reserved for CR_CPUID.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> target/nios2/cpu.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/target/nios2/cpu.c b/target/nios2/cpu.c
> index 189adf111c..fbcb4da737 100644
> --- a/target/nios2/cpu.c
> +++ b/target/nios2/cpu.c
> @@ -159,6 +159,7 @@ static ObjectClass *nios2_cpu_class_by_name(const char
> *cpu_model)
> static void nios2_cpu_realizefn(DeviceState *dev, Error **errp)
> {
> CPUState *cs = CPU(dev);
> + Nios2CPU *cpu = NIOS2_CPU(cs);
> Nios2CPUClass *ncc = NIOS2_CPU_GET_CLASS(dev);
> Error *local_err = NULL;
>
> @@ -171,6 +172,9 @@ static void nios2_cpu_realizefn(DeviceState *dev, Error
> **errp)
> qemu_init_vcpu(cs);
> cpu_reset(cs);
>
> + /* We have reserved storage for ctrl[CR_CPUID]; might as well use it. */
> + cpu->env.cpuid = cs->cpu_index;
> +
> ncc->parent_realize(dev, errp);
> }
I guess. This will have no effect as all our nios2 boards are
single-CPU.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
-- PMM
- [PATCH v4 28/33] target/nios2: Clean up nios2_cpu_do_interrupt, (continued)
- [PATCH v4 28/33] target/nios2: Clean up nios2_cpu_do_interrupt, Richard Henderson, 2022/03/08
- [PATCH v4 11/33] target/nios2: Use hw/registerfields.h for CR_STATUS fields, Richard Henderson, 2022/03/08
- [PATCH v4 14/33] target/nios2: Use hw/registerfields.h for CR_TLBACC fields, Richard Henderson, 2022/03/08
- [PATCH v4 26/33] target/nios2: Update helper_eret for shadow registers, Richard Henderson, 2022/03/08
- [PATCH v4 22/33] target/nios2: Introduce dest_gpr, Richard Henderson, 2022/03/08
- [PATCH v4 18/33] target/nios2: Implement cpuid, Richard Henderson, 2022/03/08
- Re: [PATCH v4 18/33] target/nios2: Implement cpuid,
Peter Maydell <=
- [PATCH v4 27/33] target/nios2: Create EXCP_SEMIHOST for semi-hosting, Richard Henderson, 2022/03/08
- [PATCH v4 29/33] target/nios2: Implement EIC interrupt processing, Richard Henderson, 2022/03/08
- [PATCH v4 15/33] target/nios2: Use hw/registerfields.h for CR_TLBMISC fields, Richard Henderson, 2022/03/08
- [PATCH v4 31/33] hw/nios2: Introduce Nios2MachineState, Richard Henderson, 2022/03/08