All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Marcel Apfelbaum <marcel.a@redhat.com>
Cc: "Alexander Graf" <agraf@suse.de>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Jan Kiszka" <jan.kiszka@siemens.com>,
	"QEMU Developers" <qemu-devel@nongnu.org>,
	"Luiz Capitulino" <lcapitulino@redhat.com>,
	"Anthony Liguori" <aliguori@amazon.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Andreas Färber" <afaerber@suse.de>
Subject: Re: [Qemu-devel] [PATCH for-1.7 v2 1/8] exec: declare TARGET_PHYS_ADDR_SPACE_MAX to limit memory regions rendered by exec
Date: Thu, 7 Nov 2013 10:49:50 +0000	[thread overview]
Message-ID: <CAFEAcA8WcinA5bFCxCdJp7QRU2Zni5o_xLgpBxN0oUGUcjiKPw@mail.gmail.com> (raw)
In-Reply-To: <1383820884-29596-2-git-send-email-marcel.a@redhat.com>

On 7 November 2013 10:41, Marcel Apfelbaum <marcel.a@redhat.com> wrote:
> The page table logic in exec.c assumes
> that memory addresses are at most TARGET_PHYS_ADDR_SPACE_BITS.
> Use TARGET_PHYS_ADDR_SPACE_MAX as max size for memory regions
> rendered by exec.
>
> Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
> ---
>  include/exec/address-spaces.h | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/include/exec/address-spaces.h b/include/exec/address-spaces.h
> index 3d12cdd..174cc05 100644
> --- a/include/exec/address-spaces.h
> +++ b/include/exec/address-spaces.h
> @@ -23,6 +23,10 @@
>
>  #ifndef CONFIG_USER_ONLY
>
> +#define TARGET_PHYS_ADDR_SPACE_MAX                         \
> +    (TARGET_PHYS_ADDR_SPACE_BITS == 64 ?                   \
> +    UINT64_MAX : (0x1ULL << TARGET_PHYS_ADDR_SPACE_BITS))
> +

I think it's worth adding a comment that this is a
size intended for use in memory_region_init() calls and
so follows the odd convention used by that API that
it is a size in bytes with the exception that UINT64_MAX
represents 2^64.

(it follows from this that using the #define anywhere
except in a memory_region_init() call is probably a bug)

-- PMM

  reply	other threads:[~2013-11-07 10:50 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-07 10:41 [Qemu-devel] [PATCH for-1.7 v2 0/8] fix address space size issue Marcel Apfelbaum
2013-11-07 10:41 ` [Qemu-devel] [PATCH for-1.7 v2 1/8] exec: declare TARGET_PHYS_ADDR_SPACE_MAX to limit memory regions rendered by exec Marcel Apfelbaum
2013-11-07 10:49   ` Peter Maydell [this message]
2013-11-07 11:32     ` Marcel Apfelbaum
2013-11-07 12:04     ` Michael S. Tsirkin
2013-11-07 13:49       ` Paolo Bonzini
2013-11-07 15:40         ` Michael S. Tsirkin
2013-11-07 10:41 ` [Qemu-devel] [PATCH for-1.7 v2 2/8] hw/alpha: limit iommu-typhoon memory size Marcel Apfelbaum
2013-11-07 10:41 ` [Qemu-devel] [PATCH for-1.7 v2 3/8] hw/ppc: limit iommu-spapr " Marcel Apfelbaum
2013-11-07 10:41 ` [Qemu-devel] [PATCH for-1.7 v2 4/8] exec: don't ignore high address bits on lookup Marcel Apfelbaum
2013-11-07 10:41 ` [Qemu-devel] [PATCH for-1.7 v2 5/8] pci: fix address space size for bridge Marcel Apfelbaum
2013-11-07 10:41 ` [Qemu-devel] [PATCH for-1.7 v2 6/8] exec: don't ignore high address bits on set Marcel Apfelbaum
2013-11-07 10:41 ` [Qemu-devel] [PATCH for-1.7 v2 7/8] pc: s/INT64_MAX/UINT64_MAX/ Marcel Apfelbaum
2013-11-19 11:44   ` Paolo Bonzini
2013-11-19 12:04     ` Michael S. Tsirkin
2013-11-07 10:41 ` [Qemu-devel] [PATCH for-1.7 v2 8/8] spapr_pci: s/INT64_MAX/UINT64_MAX/ Marcel Apfelbaum
2013-11-07 11:07 ` [Qemu-devel] [PATCH for-1.7 v2 0/8] fix address space size issue Alexander Graf
2013-11-07 14:08 ` Paolo Bonzini
2013-11-07 15:05   ` Michael S. Tsirkin
2013-11-07 15:07     ` Paolo Bonzini
2013-11-07 15:20       ` Michael S. Tsirkin

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=CAFEAcA8WcinA5bFCxCdJp7QRU2Zni5o_xLgpBxN0oUGUcjiKPw@mail.gmail.com \
    --to=peter.maydell@linaro.org \
    --cc=afaerber@suse.de \
    --cc=agraf@suse.de \
    --cc=aliguori@amazon.com \
    --cc=ehabkost@redhat.com \
    --cc=jan.kiszka@siemens.com \
    --cc=lcapitulino@redhat.com \
    --cc=marcel.a@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.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.