All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cornelia Huck <cornelia.huck@de.ibm.com>
To: "Andreas Färber" <afaerber@suse.de>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>,
	Jens Freimann <jfrei@linux.vnet.ibm.com>,
	Alexander Graf <agraf@suse.de>,
	qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 2/2] s390-virtio: Factor out some initialization code.
Date: Wed, 16 Jan 2013 14:05:07 +0100	[thread overview]
Message-ID: <20130116140507.554aa427@gondolin> (raw)
In-Reply-To: <50F69FE6.9030908@suse.de>

On Wed, 16 Jan 2013 13:41:10 +0100
Andreas Färber <afaerber@suse.de> wrote:

> Am 16.01.2013 12:57, schrieb Cornelia Huck:
> > diff --git a/hw/s390-virtio.h b/hw/s390-virtio.h
> > index cd88179..acd4846 100644
> > --- a/hw/s390-virtio.h
> > +++ b/hw/s390-virtio.h
> > @@ -20,4 +20,10 @@ typedef int (*s390_virtio_fn)(uint64_t reg2, uint64_t reg3, uint64_t reg4,
> >                                uint64_t reg5, uint64_t reg6, uint64_t reg7);
> >  void s390_register_virtio_hypercall(uint64_t code, s390_virtio_fn fn);
> >  
> > +CPUS390XState *s390_init_cpus(const char *cpu_model, uint8_t *storage_keys);
> > +void s390_set_up_kernel(CPUS390XState *env,
> > +                        const char *kernel_filename,
> > +                        const char *kernel_cmdline,
> > +                        const char *initrd_filename);
> 
> I don't like this interface: It reads "cpus" but appears to return a
> single CPUS390XState. Can't you at least use S390CPU* instead?
> 
> Alternatively it would be possible (although at some point to be
> changed) to use global first_cpu and to iterate over the CPUs rather
> than returning one from one function to the other.

An alternative might be to use s390_cpu_addr2state(0) to effectively
get to the same cpu.

> 
> However since the only usage I spot in the patch without looking up the
> file myself is s390_add_running_cpu(), can the call be moved out of the
> kernel setup function to avoid this dependency?

s390_set_up_kernel() uses it to specify the initial psw, and for
virtio-ccw, it will be needed to issue an ioctl. But both use cases
could be covered by grabbing cpu 0.

> 
> Andreas
> 
> > +void s390_create_virtio_net(BusState *bus, const char *name);
> >  #endif
> 

      reply	other threads:[~2013-01-16 13:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-16 11:57 [Qemu-devel] [PATCH 0/2] s390-virtio: Some cleanups Cornelia Huck
2013-01-16 11:57 ` [Qemu-devel] [PATCH 1/2] s390: Add a hypercall registration interface Cornelia Huck
2013-01-16 12:17   ` Alexander Graf
2013-01-16 12:51     ` Cornelia Huck
2013-01-16 11:57 ` [Qemu-devel] [PATCH 2/2] s390-virtio: Factor out some initialization code Cornelia Huck
2013-01-16 12:19   ` Alexander Graf
2013-01-16 12:41   ` Andreas Färber
2013-01-16 13:05     ` Cornelia Huck [this message]

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=20130116140507.554aa427@gondolin \
    --to=cornelia.huck@de.ibm.com \
    --cc=afaerber@suse.de \
    --cc=agraf@suse.de \
    --cc=borntraeger@de.ibm.com \
    --cc=jfrei@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 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.