qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>,
	Markus Armbruster <armbru@redhat.com>
Cc: qemu-devel@nongnu.org, Michael Tokarev <mjt@tls.msk.ru>,
	Peter Xu <peterx@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>,
	qemu-trivial@nongnu.org,
	"Dr. David Alan Gilbert" <dave@treblig.org>,
	Richard Henderson <richard.henderson@linaro.org>,
	Laurent Vivier <laurent@vivier.eu>,
	David Hildenbrand <david@redhat.com>
Subject: Re: [PATCH 3/3] system/physmem: Assign global system I/O Memory to machine
Date: Fri, 9 Feb 2024 17:41:01 +0100	[thread overview]
Message-ID: <06da11bb-424c-49d8-a650-b846acb82298@linaro.org> (raw)
In-Reply-To: <CAFEAcA9+6aK_uPa6tFV2-yh3g_2oeuvFaOs=nd=2dexm=uxN9Q@mail.gmail.com>

(+Markus I forgot to Cc)

On 9/2/24 17:06, Peter Maydell wrote:
> On Fri, 9 Feb 2024 at 15:01, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>>
>> So far there is only one system I/O and one system
>> memory per machine.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> ---
>>   system/physmem.c | 7 ++++---
>>   1 file changed, 4 insertions(+), 3 deletions(-)
>>
>> diff --git a/system/physmem.c b/system/physmem.c
>> index 5e66d9ae36..50947a374e 100644
>> --- a/system/physmem.c
>> +++ b/system/physmem.c
>> @@ -2554,12 +2554,13 @@ static void memory_map_init(void)
>>   {
>>       system_memory = g_malloc(sizeof(*system_memory));
>>
>> -    memory_region_init(system_memory, NULL, "system", UINT64_MAX);
>> +    memory_region_init(system_memory, OBJECT(current_machine),
>> +                       "system", UINT64_MAX);
>>       address_space_init(&address_space_memory, system_memory, "memory");
>>
>>       system_io = g_malloc(sizeof(*system_io));
>> -    memory_region_init_io(system_io, NULL, &unassigned_io_ops, NULL, "io",
>> -                          65536);
>> +    memory_region_init_io(system_io, OBJECT(current_machine),
>> +                          &unassigned_io_ops, NULL, "io", 65535);
>>       address_space_init(&address_space_io, system_io, "I/O");
>>   }
> 
> What's the intention in doing this? What does it change?

We want to remove access to pre-QOM and possibly hotplug QOM paths
from external API (CLI & QMP so far).

When the parent object is obvious and missing we simply have to
explicit it.

> It seems to be OK to pass a non-Device owner in for
> memory_region_init() (whereas it is *not* OK to do that
> for memory_region_init_ram()), but this seems to be
> getting a bit tricky.

Yes, memory_region_init_ram() is problematic; I'm hardly trying
to ignore it at this point.


  reply	other threads:[~2024-02-09 16:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-09 15:00 [PATCH 0/3] system/memory: Trivial fixes Philippe Mathieu-Daudé
2024-02-09 15:00 ` [PATCH 1/3] cpu-target: Include missing 'exec/memory.h' header Philippe Mathieu-Daudé
2024-02-09 16:01   ` Peter Maydell
2024-02-09 16:31     ` Philippe Mathieu-Daudé
2024-02-09 15:00 ` [PATCH 2/3] monitor/target: " Philippe Mathieu-Daudé
2024-02-09 16:01   ` Peter Maydell
2024-02-09 15:00 ` [PATCH 3/3] system/physmem: Assign global system I/O Memory to machine Philippe Mathieu-Daudé
2024-02-09 16:06   ` Peter Maydell
2024-02-09 16:41     ` Philippe Mathieu-Daudé [this message]
2024-02-09 21:33 ` [PATCH 0/3] system/memory: Trivial fixes Michael Tokarev

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=06da11bb-424c-49d8-a650-b846acb82298@linaro.org \
    --to=philmd@linaro.org \
    --cc=armbru@redhat.com \
    --cc=dave@treblig.org \
    --cc=david@redhat.com \
    --cc=laurent@vivier.eu \
    --cc=mjt@tls.msk.ru \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=richard.henderson@linaro.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).