qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Ani Sinha <anisinha@redhat.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Eduardo Habkost" <eduardo@habkost.net>,
	"Igor Mammedov" <imammedo@redhat.com>,
	"Xiao Guangrong" <xiaoguangrong.eric@gmail.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Yanan Wang" <wangyanan55@huawei.com>,
	qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [PATCH] mem/x86: add processor address space check for VM memory
Date: Mon, 18 Sep 2023 13:02:38 +0200	[thread overview]
Message-ID: <3aa2bd37-c9d3-558a-5cc1-7c5b0cb8337a@redhat.com> (raw)
In-Reply-To: <CAK3XEhO9DAWE6SXd4Nmham3Q=MMLU6Dda1O=EHwz55iMELv3zQ@mail.gmail.com>

On 18.09.23 13:00, Ani Sinha wrote:
> On Mon, Sep 18, 2023 at 4:28 PM David Hildenbrand <david@redhat.com> wrote:
>>
>> On 18.09.23 12:54, Ani Sinha wrote:
>>> On Mon, Sep 18, 2023 at 3:49 PM David Hildenbrand <david@redhat.com> wrote:
>>>>
>>>> On 18.09.23 12:11, Ani Sinha wrote:
>>>>
>>>>>
>>>>>       Ok hopefully my last question. I am still confused on something.
>>>>>       Does the above mean that the hole64 will actually start from an
>>>>>       address that is beyond maxram? Like basically if you added all of
>>>>>       ram_below_4G, ram_above_4G, hot plug_mem and pci_hole64 then can it
>>>>>       exceed maxram? I think it will. Does this not an issue?
>>>>
>>>> If you'd have a 2 GiB VM, the device memory region and hole64 would
>>>> always be placed >= 4 GiB address, yes.
>>>>
>>>> As maxram is just a size, and not a PFN, I don't think there is any
>>>> issue with that.
>>>
>>> So this is all just a scheme to decide what to place where with maxram
>>> amount of memory available. When the processor needs to access the
>>
>> Yes. ram_size and maxram_size are only used to create the memory layout.
>>
>>> memory mapped PCI device, its simply dynamically mapped to the
>>> available physical ram. Is my understanding correct here?
>>
>> I'm no expert on that, but from my understanding that's what the
>> pci/pci64 hole is for -- mapping PCI BARs into these areas, such that
>> they don't conflict with actual guest RAM. That's why we still account
>> these "holes" as valid GFN that could be used+accessed by the VM once a
>> PCI BAR gets mapped in there.
> 
> Yes that was my understanding too but since device drivers need to
> access those BAR addresses, they need to be mapped to the actual
> available physical ram.

These devices supply their own RAM memory regions for BARs, that will 
get mapped into the holes. They are not using any boot/hotplug memory. 
It's confusing.

-- 
Cheers,

David / dhildenb



  parent reply	other threads:[~2023-09-18 11:03 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-08  9:50 [PATCH] mem/x86: add processor address space check for VM memory Ani Sinha
2023-09-08 10:28 ` David Hildenbrand
2023-09-08 14:12   ` Ani Sinha
2023-09-08 14:16     ` David Hildenbrand
2023-09-08 15:13       ` Ani Sinha
2023-09-08 16:02         ` David Hildenbrand
2023-09-08 16:04           ` David Hildenbrand
2023-09-12 10:41           ` Ani Sinha
2023-09-12 15:34             ` David Hildenbrand
2023-09-14  5:53               ` Ani Sinha
2023-09-14  8:37                 ` David Hildenbrand
2023-09-14 11:21                   ` Ani Sinha
2023-09-14 11:49                     ` David Hildenbrand
2023-09-15 10:38                       ` Ani Sinha
2023-09-18  9:33                         ` David Hildenbrand
2023-09-18 10:07                           ` Ani Sinha
2023-09-18 10:09                             ` David Hildenbrand
2023-09-18 10:11                               ` Ani Sinha
2023-09-18 10:14                                 ` Ani Sinha
2023-09-18 10:19                                 ` David Hildenbrand
2023-09-18 10:54                                   ` Ani Sinha
2023-09-18 10:58                                     ` David Hildenbrand
2023-09-18 11:00                                       ` Ani Sinha
2023-09-18 11:02                                         ` Ani Sinha
2023-09-18 11:02                                         ` David Hildenbrand [this message]
2023-09-18 11:04                                           ` Ani Sinha
2023-09-14 17:11                   ` Ani Sinha
2023-09-16  5:17                   ` Ani Sinha
2023-09-08 16:04         ` Philippe Mathieu-Daudé

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=3aa2bd37-c9d3-558a-5cc1-7c5b0cb8337a@redhat.com \
    --to=david@redhat.com \
    --cc=anisinha@redhat.com \
    --cc=eduardo@habkost.net \
    --cc=imammedo@redhat.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=wangyanan55@huawei.com \
    --cc=xiaoguangrong.eric@gmail.com \
    /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).