Re: [RFC v1 09/10] i386: split cpu.c and defer x86 models registration

2020-11-16 Thread Claudio Fontana
On 11/10/20 4:23 PM, Eduardo Habkost wrote: > On Tue, Nov 10, 2020 at 11:41:46AM +0100, Paolo Bonzini wrote: >> On 10/11/20 11:04, Daniel P. Berrangé wrote: >>> >>> ie, we should have one class hierarchy for CPU model definitions, and >>> one class hierarchy for accelerator CPU implementations. >>

Re: [RFC v1 09/10] i386: split cpu.c and defer x86 models registration

2020-11-11 Thread Claudio Fontana
On 11/10/20 7:14 PM, Eduardo Habkost wrote: > On Tue, Nov 10, 2020 at 06:38:49PM +0100, Claudio Fontana wrote: >> On 11/10/20 4:23 PM, Eduardo Habkost wrote: >>> On Tue, Nov 10, 2020 at 11:41:46AM +0100, Paolo Bonzini wrote: On 10/11/20 11:04, Daniel P. Berrangé wrote: > > ie, we shoul

Re: [RFC v1 09/10] i386: split cpu.c and defer x86 models registration

2020-11-10 Thread Eduardo Habkost
On Tue, Nov 10, 2020 at 09:39:37PM +0100, Paolo Bonzini wrote: > On 10/11/20 18:55, Eduardo Habkost wrote: > > > I think we should not try yo implement interfaces conditionally (i.e. have > > > TYPE_X86_ACCEL implemented only on qemu-system-{i386,x86_64} and not > > > qemu-system-arm), even if tech

Re: [RFC v1 09/10] i386: split cpu.c and defer x86 models registration

2020-11-10 Thread Paolo Bonzini
On 10/11/20 18:55, Eduardo Habkost wrote: I think we should not try yo implement interfaces conditionally (i.e. have TYPE_X86_ACCEL implemented only on qemu-system-{i386,x86_64} and not qemu-system-arm), even if technically the accel/ objects are per-target (specific_ss) rather than common. If t

Re: [RFC v1 09/10] i386: split cpu.c and defer x86 models registration

2020-11-10 Thread Eduardo Habkost
On Tue, Nov 10, 2020 at 06:38:49PM +0100, Claudio Fontana wrote: > On 11/10/20 4:23 PM, Eduardo Habkost wrote: > > On Tue, Nov 10, 2020 at 11:41:46AM +0100, Paolo Bonzini wrote: > >> On 10/11/20 11:04, Daniel P. Berrangé wrote: > >>> > >>> ie, we should have one class hierarchy for CPU model defini

Re: [RFC v1 09/10] i386: split cpu.c and defer x86 models registration

2020-11-10 Thread Eduardo Habkost
On Tue, Nov 10, 2020 at 05:05:27PM +0100, Paolo Bonzini wrote: > On 10/11/20 16:23, Eduardo Habkost wrote: > > On Tue, Nov 10, 2020 at 11:41:46AM +0100, Paolo Bonzini wrote: > > > On 10/11/20 11:04, Daniel P. Berrangé wrote: > > > > > > > > ie, we should have one class hierarchy for CPU model defi

Re: [RFC v1 09/10] i386: split cpu.c and defer x86 models registration

2020-11-10 Thread Claudio Fontana
On 11/10/20 4:23 PM, Eduardo Habkost wrote: > On Tue, Nov 10, 2020 at 11:41:46AM +0100, Paolo Bonzini wrote: >> On 10/11/20 11:04, Daniel P. Berrangé wrote: >>> >>> ie, we should have one class hierarchy for CPU model definitions, and >>> one class hierarchy for accelerator CPU implementations. >>

Re: [RFC v1 09/10] i386: split cpu.c and defer x86 models registration

2020-11-10 Thread Paolo Bonzini
On 10/11/20 16:23, Eduardo Habkost wrote: On Tue, Nov 10, 2020 at 11:41:46AM +0100, Paolo Bonzini wrote: On 10/11/20 11:04, Daniel P. Berrangé wrote: ie, we should have one class hierarchy for CPU model definitions, and one class hierarchy for accelerator CPU implementations. So at runtime w

Re: [RFC v1 09/10] i386: split cpu.c and defer x86 models registration

2020-11-10 Thread Eduardo Habkost
On Tue, Nov 10, 2020 at 11:41:46AM +0100, Paolo Bonzini wrote: > On 10/11/20 11:04, Daniel P. Berrangé wrote: > > > > ie, we should have one class hierarchy for CPU model definitions, and > > one class hierarchy for accelerator CPU implementations. > > > > So at runtime we then get two object in

Re: [RFC v1 09/10] i386: split cpu.c and defer x86 models registration

2020-11-10 Thread Paolo Bonzini
On 10/11/20 11:04, Daniel P. Berrangé wrote: ie, we should have one class hierarchy for CPU model definitions, and one class hierarchy for accelerator CPU implementations. So at runtime we then get two object instances - a CPU implementation and a CPU definition. The CPU implementation object

Re: [RFC v1 09/10] i386: split cpu.c and defer x86 models registration

2020-11-10 Thread Claudio Fontana
On 11/10/20 11:04 AM, Daniel P. Berrangé wrote: > On Tue, Nov 10, 2020 at 10:40:04AM +0100, Claudio Fontana wrote: >> On 11/9/20 7:03 PM, Daniel P. Berrangé wrote: >>> On Mon, Nov 09, 2020 at 06:27:54PM +0100, Claudio Fontana wrote: split cpu.c into: cpu.ccpuid and common

Re: [RFC v1 09/10] i386: split cpu.c and defer x86 models registration

2020-11-10 Thread Daniel P . Berrangé
On Tue, Nov 10, 2020 at 10:40:04AM +0100, Claudio Fontana wrote: > On 11/9/20 7:03 PM, Daniel P. Berrangé wrote: > > On Mon, Nov 09, 2020 at 06:27:54PM +0100, Claudio Fontana wrote: > >> split cpu.c into: > >> > >> cpu.ccpuid and common x86 cpu functionality > >> host-cpu.c host x

Re: [RFC v1 09/10] i386: split cpu.c and defer x86 models registration

2020-11-10 Thread Claudio Fontana
Hello Eduardo, thank you for your answer, On 11/9/20 8:04 PM, Eduardo Habkost wrote: > On Mon, Nov 09, 2020 at 06:27:54PM +0100, Claudio Fontana wrote: >> split cpu.c into: >> >> cpu.ccpuid and common x86 cpu functionality >> host-cpu.c host x86 cpu functions and "host" cpu type

Re: [RFC v1 09/10] i386: split cpu.c and defer x86 models registration

2020-11-10 Thread Claudio Fontana
On 11/9/20 7:03 PM, Daniel P. Berrangé wrote: > On Mon, Nov 09, 2020 at 06:27:54PM +0100, Claudio Fontana wrote: >> split cpu.c into: >> >> cpu.ccpuid and common x86 cpu functionality >> host-cpu.c host x86 cpu functions and "host" cpu type >> kvm-cpu-type.c KVM x86 cpu type >>

Re: [RFC v1 09/10] i386: split cpu.c and defer x86 models registration

2020-11-09 Thread Eduardo Habkost
On Mon, Nov 09, 2020 at 06:27:54PM +0100, Claudio Fontana wrote: > split cpu.c into: > > cpu.ccpuid and common x86 cpu functionality > host-cpu.c host x86 cpu functions and "host" cpu type > kvm-cpu-type.c KVM x86 cpu type > hvf-cpu-type.c HVF x86 cpu type > tcg-cpu-type.c

Re: [RFC v1 09/10] i386: split cpu.c and defer x86 models registration

2020-11-09 Thread Daniel P . Berrangé
On Mon, Nov 09, 2020 at 06:27:54PM +0100, Claudio Fontana wrote: > split cpu.c into: > > cpu.ccpuid and common x86 cpu functionality > host-cpu.c host x86 cpu functions and "host" cpu type > kvm-cpu-type.c KVM x86 cpu type > hvf-cpu-type.c HVF x86 cpu type > tcg-cpu-type.c

Re: [RFC v1 09/10] i386: split cpu.c and defer x86 models registration

2020-11-09 Thread Paolo Bonzini
On 09/11/20 18:27, Claudio Fontana wrote: Defer the x86 models registration to MODULE_INIT_ACCEL_CPU, so that accel-specific types can be used as parent types for all cpu models. Use the generic TYPE_X86_CPU only if no accel-specific specialization is enabled. Can we use an accel-specific ops

Re: [RFC v1 09/10] i386: split cpu.c and defer x86 models registration

2020-11-09 Thread Paolo Bonzini
On 09/11/20 18:27, Claudio Fontana wrote: |softmmu/vl.c | 2 +- target/i386/accel/hvf/hvf-cpu-type.c | 78 + target/i386/accel/hvf/meson.build | 1 + target/i386/accel/kvm/kvm-cpu-type.c | 161 ++ target/i386/accel/kvm/kvm-cpu-type.h | 41 +++ target/i386/accel/kvm/kvm.c | 3 +- target/i

[RFC v1 09/10] i386: split cpu.c and defer x86 models registration

2020-11-09 Thread Claudio Fontana
split cpu.c into: cpu.ccpuid and common x86 cpu functionality host-cpu.c host x86 cpu functions and "host" cpu type kvm-cpu-type.c KVM x86 cpu type hvf-cpu-type.c HVF x86 cpu type tcg-cpu-type.c TCG x86 cpu type Defer the x86 models registration to MODULE_INIT_ACCEL_CPU, s