All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aurelien Jarno <aurelien@aurel32.net>
To: Alexander Graf <agraf@suse.de>
Cc: peter.maydell@linaro.org,
	QEMU-devel Developers <qemu-devel@nongnu.org>,
	Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH 10/17] s390x: keep hint on virtio managing size
Date: Wed, 20 Apr 2011 12:21:42 +0200	[thread overview]
Message-ID: <20110420102142.GJ6388@volta.aurel32.net> (raw)
In-Reply-To: <136378BD-0C8C-48C2-BE67-953D73222A8C@suse.de>

On Mon, Apr 18, 2011 at 11:03:59PM +0200, Alexander Graf wrote:
> 
> On 18.04.2011, at 21:06, Aurelien Jarno wrote:
> 
> > On Fri, Apr 15, 2011 at 05:32:51PM +0200, Alexander Graf wrote:
> >> The s390x virtio bus keeps management information on virtio after the top
> >> of the guest's RAM. We need to be able to tell the guest the size of its
> >> RAM (without virtio stuff), but also be able to trap when the guest accesses
> >> RAM outside of its scope (including virtio stuff).
> >> 
> >> So we need a variable telling us the size of the virtio stuff, so we can
> >> calculate the highest available RAM address from that.
> >> 
> >> While at it, also increase the maximum number of virtio pages, so we play
> >> along well with more recent kernels that spawn a ridiculous number of virtio
> >> console adapters.
> >> 
> >> Signed-off-by: Alexander Graf <agraf@suse.de>
> >> ---
> >> hw/s390-virtio-bus.c |    3 +++
> >> hw/s390-virtio-bus.h |    2 +-
> >> target-s390x/cpu.h   |    3 +++
> >> 3 files changed, 7 insertions(+), 1 deletions(-)
> >> 
> >> diff --git a/hw/s390-virtio-bus.c b/hw/s390-virtio-bus.c
> >> index bb49e39..a90963b 100644
> >> --- a/hw/s390-virtio-bus.c
> >> +++ b/hw/s390-virtio-bus.c
> >> @@ -60,6 +60,9 @@ static const VirtIOBindings virtio_s390_bindings;
> >> 
> >> static ram_addr_t s390_virtio_device_num_vq(VirtIOS390Device *dev);
> >> 
> >> +/* length of VirtIO device pages */
> >> +target_phys_addr_t virtio_size = S390_DEVICE_PAGES * TARGET_PAGE_SIZE;
> >> +
> > 
> > If this variable is never written, can it be declared const?
> 
> Does that improve anything for exported variables? Do they get put into a ro section then?
> 

Unfortunately, that will still be an exported variable, and it's a pitty
to use that just because we can't have a #define in hw/* included in
target-*/* . That said I just realized that a lot of target are actually
doing that, maybe it's the solution here.

Adding a const here will clearly show to people reading the code that
it's nothing more than advanced #define.


-- 
Aurelien Jarno                          GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net

  reply	other threads:[~2011-04-20 10:22 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-15 15:32 [Qemu-devel] [PATCH 00/17] s390x emulation support v4 Alexander Graf
2011-04-15 15:32 ` [Qemu-devel] [PATCH 01/17] tcg: extend max tcg opcodes on 32bit Alexander Graf
2011-04-18 18:42   ` Aurelien Jarno
2011-04-15 15:32 ` [Qemu-devel] [PATCH 02/17] s390x: s390x-linux-user support Alexander Graf
2011-04-18 11:38   ` Riku Voipio
2011-04-18 12:06     ` Alexander Graf
2011-04-18 12:19       ` Riku Voipio
2011-04-18 13:21         ` Jan-Simon Möller
2011-04-18 13:31           ` Alexander Graf
2011-04-18 13:36           ` Aurelien Jarno
2011-04-18 13:42             ` Alexander Graf
2011-04-18 13:54               ` Aurelien Jarno
2011-04-15 15:32 ` [Qemu-devel] [PATCH 03/17] linux-user: define a couple of syscalls for non-uid16 targets Alexander Graf
2011-04-18 16:32   ` Riku Voipio
2011-04-18 21:11     ` Alexander Graf
2011-04-15 15:32 ` [Qemu-devel] [PATCH 04/17] linux-user: add s390x to llseek list Alexander Graf
2011-04-15 15:32 ` [Qemu-devel] [PATCH 05/17] kvm: add kvm stub for arch specific stuff Alexander Graf
2011-04-18 18:34   ` Aurelien Jarno
2011-05-03 14:17     ` Alexander Graf
2011-05-03 14:57       ` Jan Kiszka
2011-05-04  5:19         ` Alexander Graf
2011-05-04  8:31           ` Jan Kiszka
2011-05-04  8:40             ` Alexander Graf
2011-05-04  8:43               ` Jan Kiszka
2011-05-04  8:53                 ` Alexander Graf
2011-05-03 15:05       ` Peter Maydell
2011-04-15 15:32 ` [Qemu-devel] [PATCH 06/17] s390x: Prepare cpu.h for emulation Alexander Graf
2011-04-18 18:55   ` Aurelien Jarno
2011-04-15 15:32 ` [Qemu-devel] [PATCH 07/17] s390x: Enable s390x-softmmu target Alexander Graf
2011-04-18 18:56   ` Aurelien Jarno
2011-04-15 15:32 ` [Qemu-devel] [PATCH 08/17] s390x: Dispatch interrupts to KVM or the real CPU Alexander Graf
2011-04-18 19:01   ` Aurelien Jarno
2011-04-15 15:32 ` [Qemu-devel] [PATCH 09/17] s390x: virtio machine storage keys Alexander Graf
2011-04-18 19:02   ` Aurelien Jarno
2011-04-15 15:32 ` [Qemu-devel] [PATCH 10/17] s390x: keep hint on virtio managing size Alexander Graf
2011-04-18 19:06   ` Aurelien Jarno
2011-04-18 21:03     ` Alexander Graf
2011-04-20 10:21       ` Aurelien Jarno [this message]
2011-04-15 15:32 ` [Qemu-devel] [PATCH 11/17] s390x: helper functions for system emulation Alexander Graf
2011-04-20 10:38   ` Aurelien Jarno
2011-05-04  4:57     ` Alexander Graf
2011-04-15 15:32 ` [Qemu-devel] [PATCH 12/17] s390x: Implement opcode helpers Alexander Graf
2011-04-15 15:32 ` [Qemu-devel] [PATCH 13/17] s390x: Adjust internal kvm code Alexander Graf
2011-04-15 15:32 ` [Qemu-devel] [PATCH 14/17] s390x: translate engine for s390x CPU Alexander Graf
2011-04-15 15:32 ` [Qemu-devel] [PATCH 15/17] s390x: Adjust GDB stub Alexander Graf
2011-04-15 15:32 ` [Qemu-devel] [PATCH 16/17] s390x: remove compatibility cc field Alexander Graf
2011-04-15 15:32 ` [Qemu-devel] [PATCH 17/17] s390x: build s390x by default Alexander Graf
2011-04-27 14:35 ` [Qemu-devel] [PATCH 00/17] s390x emulation support v4 Aurelien Jarno

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=20110420102142.GJ6388@volta.aurel32.net \
    --to=aurelien@aurel32.net \
    --cc=agraf@suse.de \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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.