From: David Gibson <david@gibson.dropbear.id.au> To: Eduardo Habkost <ehabkost@redhat.com> Cc: qemu-devel@nongnu.org, Laurent Vivier <laurent@vivier.eu>, Paolo Bonzini <pbonzini@redhat.com>, Riku Voipio <riku.voipio@iki.fi>, Like Xu <like.xu@linux.intel.com>, Richard Henderson <rth@twiddle.net>, Thomas Huth <thuth@redhat.com>, Igor Mammedov <imammedo@redhat.com>, qemu-ppc@nongnu.org, Markus Armbruster <armbru@redhat.com>, Peter Maydell <peter.maydell@linaro.org>, Artyom Tarasenko <atar4qemu@gmail.com>, Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Subject: Re: [Qemu-devel] [PATCH 4/5] bsd-user: Use lookup_cpu_class() Date: Wed, 17 Apr 2019 15:23:56 +1000 [thread overview] Message-ID: <20190417052356.GP32705@umbus.fritz.box> (raw) In-Reply-To: <20190417025944.16154-5-ehabkost@redhat.com> [-- Attachment #1: Type: text/plain, Size: 1437 bytes --] On Tue, Apr 16, 2019 at 11:59:43PM -0300, Eduardo Habkost wrote: > The hardcoded CPU models in the code are just CPU models and > don't include any extra options. We don't need to call > parse_cpu_options(). > > Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> > --- > bsd-user/main.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/bsd-user/main.c b/bsd-user/main.c > index a6c055f5fb..d2915a9951 100644 > --- a/bsd-user/main.c > +++ b/bsd-user/main.c > @@ -732,6 +732,7 @@ int main(int argc, char **argv) > TaskState ts1, *ts = &ts1; > CPUArchState *env; > CPUState *cpu; > + CPUClass *cc; > int optind; > const char *r; > int gdbstub_port = 0; > @@ -903,7 +904,8 @@ int main(int argc, char **argv) > /* init tcg before creating CPUs and to get qemu_host_page_size */ > tcg_exec_init(0); > > - cpu_type = parse_cpu_option(cpu_model); > + cc = lookup_cpu_class(cpu_model, &error_fatal); > + cpu_type = object_class_get_name(OBJECT_CLASS(cc)); > cpu = cpu_create(cpu_type); > env = cpu->env_ptr; > #if defined(TARGET_SPARC) || defined(TARGET_PPC) -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: David Gibson <david@gibson.dropbear.id.au> To: Eduardo Habkost <ehabkost@redhat.com> Cc: Peter Maydell <peter.maydell@linaro.org>, Thomas Huth <thuth@redhat.com>, Like Xu <like.xu@linux.intel.com>, Markus Armbruster <armbru@redhat.com>, Riku Voipio <riku.voipio@iki.fi>, Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>, qemu-devel@nongnu.org, Laurent Vivier <laurent@vivier.eu>, qemu-ppc@nongnu.org, Igor Mammedov <imammedo@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Artyom Tarasenko <atar4qemu@gmail.com>, Richard Henderson <rth@twiddle.net> Subject: Re: [Qemu-devel] [PATCH 4/5] bsd-user: Use lookup_cpu_class() Date: Wed, 17 Apr 2019 15:23:56 +1000 [thread overview] Message-ID: <20190417052356.GP32705@umbus.fritz.box> (raw) Message-ID: <20190417052356.sIAZDegOCyEAq3DTT76sfaAv2pc8_D4QcvaoSx6tgGA@z> (raw) In-Reply-To: <20190417025944.16154-5-ehabkost@redhat.com> [-- Attachment #1: Type: text/plain, Size: 1437 bytes --] On Tue, Apr 16, 2019 at 11:59:43PM -0300, Eduardo Habkost wrote: > The hardcoded CPU models in the code are just CPU models and > don't include any extra options. We don't need to call > parse_cpu_options(). > > Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> > --- > bsd-user/main.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/bsd-user/main.c b/bsd-user/main.c > index a6c055f5fb..d2915a9951 100644 > --- a/bsd-user/main.c > +++ b/bsd-user/main.c > @@ -732,6 +732,7 @@ int main(int argc, char **argv) > TaskState ts1, *ts = &ts1; > CPUArchState *env; > CPUState *cpu; > + CPUClass *cc; > int optind; > const char *r; > int gdbstub_port = 0; > @@ -903,7 +904,8 @@ int main(int argc, char **argv) > /* init tcg before creating CPUs and to get qemu_host_page_size */ > tcg_exec_init(0); > > - cpu_type = parse_cpu_option(cpu_model); > + cc = lookup_cpu_class(cpu_model, &error_fatal); > + cpu_type = object_class_get_name(OBJECT_CLASS(cc)); > cpu = cpu_create(cpu_type); > env = cpu->env_ptr; > #if defined(TARGET_SPARC) || defined(TARGET_PPC) -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2019-04-17 6:11 UTC|newest] Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-04-17 2:59 [Qemu-devel] [PATCH 0/5] Remove qdev_get_machine() call from ppc_cpu_parse_featurestr() Eduardo Habkost 2019-04-17 2:59 ` Eduardo Habkost 2019-04-17 2:59 ` [Qemu-devel] [PATCH 1/5] cpu: Rename parse_cpu_model() to parse_cpu_option() Eduardo Habkost 2019-04-17 2:59 ` Eduardo Habkost 2019-04-17 5:21 ` David Gibson 2019-04-17 5:21 ` David Gibson 2019-04-18 11:07 ` Igor Mammedov 2019-04-18 11:07 ` Igor Mammedov 2019-04-17 2:59 ` [Qemu-devel] [PATCH 2/5] cpu: Extract CPU class lookup from parse_cpu_option() Eduardo Habkost 2019-04-17 2:59 ` Eduardo Habkost 2019-04-17 5:22 ` David Gibson 2019-04-17 5:22 ` David Gibson 2019-04-17 5:41 ` Markus Armbruster 2019-04-17 5:41 ` Markus Armbruster 2019-04-17 13:55 ` Eduardo Habkost 2019-04-17 13:55 ` Eduardo Habkost 2019-04-17 2:59 ` [Qemu-devel] [PATCH 3/5] linux-user: Use lookup_cpu_class() Eduardo Habkost 2019-04-17 2:59 ` Eduardo Habkost 2019-04-17 5:23 ` David Gibson 2019-04-17 5:23 ` David Gibson 2019-04-18 4:52 ` Eduardo Habkost 2019-04-18 4:52 ` Eduardo Habkost 2019-04-17 2:59 ` [Qemu-devel] [PATCH 4/5] bsd-user: " Eduardo Habkost 2019-04-17 2:59 ` Eduardo Habkost 2019-04-17 5:23 ` David Gibson [this message] 2019-04-17 5:23 ` David Gibson 2019-04-17 2:59 ` [Qemu-devel] [PATCH 5/5] cpu: Add MachineState parameter to parse_features() Eduardo Habkost 2019-04-17 2:59 ` Eduardo Habkost 2019-04-17 5:25 ` David Gibson 2019-04-17 5:25 ` David Gibson 2019-04-17 5:45 ` Markus Armbruster 2019-04-17 5:45 ` Markus Armbruster 2019-04-17 5:45 ` [Qemu-devel] [PATCH 0/5] Remove qdev_get_machine() call from ppc_cpu_parse_featurestr() Markus Armbruster 2019-04-17 5:45 ` Markus Armbruster 2019-04-18 3:35 ` Eduardo Habkost 2019-04-18 3:35 ` Eduardo Habkost
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20190417052356.GP32705@umbus.fritz.box \ --to=david@gibson.dropbear.id.au \ --cc=armbru@redhat.com \ --cc=atar4qemu@gmail.com \ --cc=ehabkost@redhat.com \ --cc=imammedo@redhat.com \ --cc=laurent@vivier.eu \ --cc=like.xu@linux.intel.com \ --cc=mark.cave-ayland@ilande.co.uk \ --cc=pbonzini@redhat.com \ --cc=peter.maydell@linaro.org \ --cc=qemu-devel@nongnu.org \ --cc=qemu-ppc@nongnu.org \ --cc=riku.voipio@iki.fi \ --cc=rth@twiddle.net \ --cc=thuth@redhat.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.