From: "Michael S. Tsirkin" <mst@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>, Ani Sinha <ani@anisinha.ca>,
Gregory Price <gourry.memverge@gmail.com>,
qemu-devel@nongnu.org, marcel.apfelbaum@gmail.com,
jonathan.cameron@huawei.com, linux-cxl@vger.kernel.org,
alison.schofield@intel.com, dave@stgolabs.net,
a.manzanares@samsung.com, bwidawsk@kernel.org,
gregory.price@memverge.com, hchkuo@avery-design.com.tw,
cbrowy@avery-design.com, ira.weiny@intel.com
Subject: Re: [BUG] hw/i386/pc.c: CXL Fixed Memory Window should not reserve e820 in bios
Date: Fri, 11 Nov 2022 09:37:25 -0500 [thread overview]
Message-ID: <20221111093704-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20221111133602.6ixmvy7tu3whg422@sirius.home.kraxel.org>
On Fri, Nov 11, 2022 at 02:36:02PM +0100, Gerd Hoffmann wrote:
> > if (pcmc->has_reserved_memory && machine->device_memory->base) {
> > [...]
> >
> > if (pcms->cxl_devices_state.is_enabled) {
> > res_mem_end = cxl_resv_end;
> >
> > that should be handled by this line
> >
> > }
> >
> > *val = cpu_to_le64(ROUND_UP(res_mem_end, 1 * GiB));
> > fw_cfg_add_file(fw_cfg, "etc/reserved-memory-end", val, sizeof(*val));
> > }
> >
> > so SeaBIOS shouldn't intrude into CXL address space
>
> Yes, looks good, so with this in place already everyting should be fine.
>
> > (I assume EDK2 behave similarly here)
>
> Correct, ovmf reads that fw_cfg file too.
>
> > > I suspect the reason for these entries to exist in the first place is to
> > > inform the firmware that it should not place stuff there, and if we
> > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > just to educate me, can you point out what SeaBIOS code does with reservations.
>
> They are added to the e820 map which gets passed on to the OS. seabios
> uses (and updateas) the e820 map too, when allocating memory for
> example. While thinking about it I'm not fully sure it actually looks
> at reservations, maybe it only uses (and updates) ram entries when
> allocating memory.
>
> > > remove that to conform with the spec we need some alternative way for
> > > that ...
> >
> > with etc/reserved-memory-end set as above,
> > is E820_RESERVED really needed here?
>
> No. Setting etc/reserved-memory-end is enough.
>
> So for the original patch:
> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
>
> take care,
> Gerd
It's upstream already, sorry I can't add your tag.
--
MST
prev parent reply other threads:[~2022-11-11 14:38 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-17 23:40 [BUG] hw/i386/pc.c: CXL Fixed Memory Window should not reserve e820 in bios Gregory Price
2022-10-18 2:58 ` Gupta, Pankaj
2022-10-18 14:49 ` Gregory Price
2022-10-18 6:05 ` Ani Sinha
2022-10-18 14:45 ` Gregory Price
2022-10-18 15:00 ` Ani Sinha
2022-11-08 11:21 ` Gerd Hoffmann
2022-11-11 10:51 ` Igor Mammedov
2022-11-11 11:40 ` Gerd Hoffmann
2022-11-11 13:24 ` Igor Mammedov
2022-11-11 13:36 ` Gerd Hoffmann
2022-11-11 14:37 ` Michael S. Tsirkin [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=20221111093704-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=a.manzanares@samsung.com \
--cc=alison.schofield@intel.com \
--cc=ani@anisinha.ca \
--cc=bwidawsk@kernel.org \
--cc=cbrowy@avery-design.com \
--cc=dave@stgolabs.net \
--cc=gourry.memverge@gmail.com \
--cc=gregory.price@memverge.com \
--cc=hchkuo@avery-design.com.tw \
--cc=imammedo@redhat.com \
--cc=ira.weiny@intel.com \
--cc=jonathan.cameron@huawei.com \
--cc=kraxel@redhat.com \
--cc=linux-cxl@vger.kernel.org \
--cc=marcel.apfelbaum@gmail.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 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).