Re: [PATCH v3 01/27] target: Set CPUClass::vmsd instead of DeviceClass::vmsd

2021-04-22 Thread Philippe Mathieu-Daudé
On 4/22/21 5:53 PM, Peter Maydell wrote: > On Thu, 22 Apr 2021 at 16:41, Philippe Mathieu-Daudé wrote: >> IOW new targets should use type 1. >> >> >> Looking at type 2: >> >> a) targets added 'recently' with the incorrect type 2: >> >> target/avr/cpu.c:216:cc->vmsd = &vms_avr_cpu; >> target/ri

Re: [PATCH v3 01/27] target: Set CPUClass::vmsd instead of DeviceClass::vmsd

2021-04-22 Thread Peter Maydell
On Thu, 22 Apr 2021 at 16:41, Philippe Mathieu-Daudé wrote: > IOW new targets should use type 1. > > > Looking at type 2: > > a) targets added 'recently' with the incorrect type 2: > > target/avr/cpu.c:216:cc->vmsd = &vms_avr_cpu; > target/riscv/cpu.c:627:cc->vmsd = &vmstate_riscv_cpu; > >

Re: [PATCH v3 01/27] target: Set CPUClass::vmsd instead of DeviceClass::vmsd

2021-04-22 Thread Philippe Mathieu-Daudé
On 4/22/21 1:01 PM, Philippe Mathieu-Daudé wrote: > On 4/22/21 12:28 PM, Peter Maydell wrote: >> On Thu, 22 Apr 2021 at 10:55, Philippe Mathieu-Daudé wrote: >>> My guess is CPUState is the only device used in user emulation, >>> so it would be a way to restrict the vmstate_dummy to CPU and >>> not

Re: [PATCH v3 01/27] target: Set CPUClass::vmsd instead of DeviceClass::vmsd

2021-04-22 Thread Philippe Mathieu-Daudé
On 4/22/21 12:28 PM, Peter Maydell wrote: > On Thu, 22 Apr 2021 at 10:55, Philippe Mathieu-Daudé wrote: >> My guess is CPUState is the only device used in user emulation, >> so it would be a way to restrict the vmstate_dummy to CPU and >> not to any DeviceState? >> >> But looking at the introducto

Re: [PATCH v3 01/27] target: Set CPUClass::vmsd instead of DeviceClass::vmsd

2021-04-22 Thread Peter Maydell
On Thu, 22 Apr 2021 at 10:55, Philippe Mathieu-Daudé wrote: > My guess is CPUState is the only device used in user emulation, > so it would be a way to restrict the vmstate_dummy to CPU and > not to any DeviceState? > > But looking at the introductory commit: > > commit b170fce3dd06372f7bfec9a780e

Re: [PATCH v3 01/27] target: Set CPUClass::vmsd instead of DeviceClass::vmsd

2021-04-22 Thread Philippe Mathieu-Daudé
+Juan On 4/22/21 12:03 AM, Eduardo Habkost wrote: > On Tue, Mar 02, 2021 at 03:57:52PM +0100, Philippe Mathieu-Daudé wrote: >> The cpu model is the single device available in user-mode. >> Since we want to restrict some fields to user-mode emulation, >> we prefer to set the vmsd field of CPUClass,

Re: [PATCH v3 01/27] target: Set CPUClass::vmsd instead of DeviceClass::vmsd

2021-04-21 Thread Eduardo Habkost
On Tue, Mar 02, 2021 at 03:57:52PM +0100, Philippe Mathieu-Daudé wrote: > The cpu model is the single device available in user-mode. > Since we want to restrict some fields to user-mode emulation, > we prefer to set the vmsd field of CPUClass, rather than the > DeviceClass one. > > Signed-off-by:

[PATCH v3 01/27] target: Set CPUClass::vmsd instead of DeviceClass::vmsd

2021-03-02 Thread Philippe Mathieu-Daudé
The cpu model is the single device available in user-mode. Since we want to restrict some fields to user-mode emulation, we prefer to set the vmsd field of CPUClass, rather than the DeviceClass one. Signed-off-by: Philippe Mathieu-Daudé --- target/alpha/cpu.c | 2 +- target/cris/cpu.c