All of lore.kernel.org
 help / color / mirror / Atom feed
From: Demi Marie Obenour <demi@invisiblethingslab.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>,
	"Xen developer discussion" <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH] Make XEN_FW_EFI_MEM_INFO easier to use
Date: Thu, 25 Aug 2022 16:36:55 -0400	[thread overview]
Message-ID: <YwfdpPH9PyPXlMAa@itl-email> (raw)
In-Reply-To: <df443aab-a2eb-75c2-3a4d-df6d093b5788@suse.com>

[-- Attachment #1: Type: text/plain, Size: 1654 bytes --]

On Thu, Aug 25, 2022 at 09:59:56AM +0200, Jan Beulich wrote:
> On 24.08.2022 23:04, Demi Marie Obenour wrote:
> > The XEN_FW_EFI_MEM_INFO platform op has very surprising behavior: it
> > only sets info->mem.size if the initial value was *larger* than the size
> > of the memory region.
> 
> And intentionally so - the caller didn't ask for any bigger region,
> after all.

That needs to be documented, then.  I thought it provided the full
region that contained the address.

> >  This is not particularly useful and cost me most
> > of a day of debugging.  It also has some integer overflow problems,
> > though as the data comes from dom0 or the firmware (both of which are
> > trusted) these are not security issues.
> 
> I'm afraid we're trusting the firmware in this regard elsewhere as
> well. So if there was a need to change that, I guess it would need
> changing everywhere, not just here. But we trust the E820 map as
> well, when on non-EFI platforms, so I don't see why we would need
> to change that. In any event such would want to be a separate
> change imo.

That is valid.

> > Fix both of these problems by unconditionally setting the memory region
> > size
> 
> If you were to report a larger ending address, why would you not also
> report a smaller starting address?
> 
> But before you go that route - I don't think we can change the API
> now that it has been in use this way for many years. If a "give me
> the full enclosing range" variant is wanted, it will need to be
> fully separate.

Does anyone use this API?

-- 
Sincerely,
Demi Marie Obenour (she/her/hers)
Invisible Things Lab

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2022-08-25 20:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-24 21:04 [PATCH] Make XEN_FW_EFI_MEM_INFO easier to use Demi Marie Obenour
2022-08-25  7:59 ` Jan Beulich
2022-08-25 20:36   ` Demi Marie Obenour [this message]
2022-08-26  7:18     ` Jan Beulich
2022-08-26 18:15       ` Demi Marie Obenour
2022-09-06  6:54         ` Jan Beulich

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=YwfdpPH9PyPXlMAa@itl-email \
    --to=demi@invisiblethingslab.com \
    --cc=jbeulich@suse.com \
    --cc=marmarek@invisiblethingslab.com \
    --cc=xen-devel@lists.xenproject.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.