qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: Jens Freimann <jfrei@linux.vnet.ibm.com>
Cc: Heinz Graalfs <graalfs@linux.vnet.ibm.com>,
	qemu-devel <qemu-devel@nongnu.org>,
	Alexander Graf <agraf@suse.de>,
	Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	Cornelia Huck <cornelia.huck@de.ibm.com>,
	Einar Lueck <elelueck@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [PATCH 1/3] S390: Basic CPU model support
Date: Fri, 23 Nov 2012 16:25:21 +0100	[thread overview]
Message-ID: <50AF9561.2090802@suse.de> (raw)
In-Reply-To: <1353665892-35445-2-git-send-email-jfrei@linux.vnet.ibm.com>

Am 23.11.2012 11:18, schrieb Jens Freimann:
> From: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
> 
> This enables qemu -cpu ? to return the list of supported CPU models
> on s390. Since only the host model is supported at this point in time
> this is pretty straight-forward. Further, a validity check for the
> requested CPU model was added.
> This change is needed to allow libvirt exploiters (like OpenStack)
> to specify a CPU model.
> 
> Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
> Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
> Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
> ---
>  hw/s390-virtio.c   | 5 +++++
>  target-s390x/cpu.c | 6 ++++++
>  target-s390x/cpu.h | 3 +++
>  3 files changed, 14 insertions(+)
> 
> diff --git a/hw/s390-virtio.c b/hw/s390-virtio.c
> index 685cb54..7144ac1 100644
> --- a/hw/s390-virtio.c
> +++ b/hw/s390-virtio.c
> @@ -209,6 +209,11 @@ static void s390_init(QEMUMachineInitArgs *args)
>          cpu_model = "host";
>      }
>  
> +    if (strcmp(cpu_model, "host")) {
> +        fprintf(stderr, "S390 only supports host CPU model\n");
> +        exit(1);
> +    }

When Cornelia introduces a second machine for virtio-ccw, you will have
to duplicate this logic. Other targets have an, e.g., cpu_s390_init()
function that encapsulates the instantiation logic.

Also, "host" doesn't make a lot of sense on non-s390 host, no?

> +
>      ipi_states = g_malloc(sizeof(S390CPU *) * smp_cpus);
>  
>      for (i = 0; i < smp_cpus; i++) {
> diff --git a/target-s390x/cpu.c b/target-s390x/cpu.c
> index 619b202..03fdc31 100644
> --- a/target-s390x/cpu.c
> +++ b/target-s390x/cpu.c
> @@ -25,6 +25,12 @@
>  #include "qemu-timer.h"
>  
>  
> +/* generate CPU information for cpu -? */
> +void s390_cpu_list(FILE *f, fprintf_function cpu_fprintf)
> +{
> +    (*cpu_fprintf)(f, "s390 %16s\n", "[host]");

The other targets don't use a target prefix ("s390 "), but then again
the text and layout are fully target-specific at this time. :)

Regards,
Andreas

> +}
> +
>  /* CPUClass::reset() */
>  static void s390_cpu_reset(CPUState *s)
>  {
> diff --git a/target-s390x/cpu.h b/target-s390x/cpu.h
> index 0f9a1f7..3513976 100644
> --- a/target-s390x/cpu.h
> +++ b/target-s390x/cpu.h
> @@ -350,6 +350,9 @@ static inline void cpu_set_tls(CPUS390XState *env, target_ulong newtls)
>  #define cpu_gen_code cpu_s390x_gen_code
>  #define cpu_signal_handler cpu_s390x_signal_handler
>  
> +void s390_cpu_list(FILE *f, fprintf_function cpu_fprintf);
> +#define cpu_list s390_cpu_list
> +
>  #include "exec-all.h"
>  
>  #ifdef CONFIG_USER_ONLY
> 


-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

  reply	other threads:[~2012-11-23 15:25 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-23 10:18 [Qemu-devel] [PATCH 0/3] s390: vcpu reset, -cpu ? and minor sclp fix Jens Freimann
2012-11-23 10:18 ` [Qemu-devel] [PATCH 1/3] S390: Basic CPU model support Jens Freimann
2012-11-23 15:25   ` Andreas Färber [this message]
2012-11-23 10:18 ` [Qemu-devel] [PATCH 2/3] s390: clear registers, psw and prefix at vcpu reset Jens Freimann
2012-11-23 13:40   ` Alexander Graf
2012-11-23 14:17     ` Jens Freimann
2012-11-23 14:32     ` Christian Borntraeger
2012-11-23 14:34       ` Alexander Graf
2012-11-23 14:52       ` Jens Freimann
2012-11-23 15:02   ` Peter Maydell
2012-11-23 15:13     ` Alexander Graf
2012-11-23 10:18 ` [Qemu-devel] [PATCH 3/3] sclp: Fix uninitialized var in handle_write_event_buf() Jens Freimann
2012-11-23 13:42   ` Alexander Graf

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=50AF9561.2090802@suse.de \
    --to=afaerber@suse.de \
    --cc=agraf@suse.de \
    --cc=borntraeger@de.ibm.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=elelueck@linux.vnet.ibm.com \
    --cc=graalfs@linux.vnet.ibm.com \
    --cc=jfrei@linux.vnet.ibm.com \
    --cc=mihajlov@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    /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: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).