All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: "Jason Andryuk" <jason.andryuk@amd.com>,
	"Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>
Cc: "Stefano Stabellini" <sstabellini@kernel.org>,
	"Julien Grall" <julien@xen.org>,
	"Bertrand Marquis" <bertrand.marquis@arm.com>,
	"Michal Orzel" <michal.orzel@amd.com>,
	"Volodymyr Babchuk" <Volodymyr_Babchuk@epam.com>,
	"Daniel P. Smith" <dpsmith@apertussolutions.com>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Roger Pau Monné" <roger@xenproject.org>,
	"Teddy Astie" <teddy.astie@vates.tech>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH] xen/efi: Handle efi_memmap with Xen relocating itself
Date: Tue, 10 Nov 2026 16:14:41 +0100	[thread overview]
Message-ID: <f48effca-510a-4ec3-8e2d-cd6c879aa182@suse.com> (raw)
In-Reply-To: <864762ac-64c4-499c-aacf-5527390bd95d@amd.com>

On 10.11.2026 15:42, Jason Andryuk wrote:
> On 2026-11-10 03:42, Jan Beulich wrote:
>> On 07.11.2026 00:18, Jason Andryuk wrote:
>>> --- a/xen/arch/x86/efi/efi-boot.h
>>> +++ b/xen/arch/x86/efi/efi-boot.h
>>> @@ -224,6 +224,16 @@ static void *__init efi_arch_allocate_mmap_buffer(UINTN map_size)
>>>       return ebmalloc(map_size);
>>>   }
>>>   
>>> +static void *__init efi_arch_mmap_buffer_virt(void *ptr)
>>> +{
>>> +    unsigned long load_base;
>>> +
>>> +    /* RIP-relative address is the current Xen load address. */
>>> +    asm("lea __image_base__(%%rip), %0" : "=r" (load_base));
>>> +
>>> +    return ptr - load_base + XEN_VIRT_START;
>>> +}
>>
>> There's nothing specific to the mmap in this function, hence it's name is
>> a little odd.
> 
> It is paired with efi_arch_allocate_mmap_buffer() above, so I wanted the 
> name to indicate that it is converting mmap_buffer to a virt address. 

Hmm, right. And this is entirely different between x86 and Arm. So common
code wants to call a function of this name, but on x86 this may then want
to be a thin wrapper around ...

> Having said that, I am open to renaming if that is desired. 
> Alternatives could be:
> efi_arch_xen_phys_to_virt()
> or
> efi_arch_image_phys_to_virt()
> or
> efi_arch_xen_image_to_virt()

... a function of any of these names (which in turn would be possible to
use for other purposes). Marek - thoughts?

With this constraint on the x86 side, wouldn't you then better add an
ASSERT()-like construct to the actual translation function?

Jan


  reply	other threads:[~2026-11-10 15:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-06 23:18 [PATCH] xen/efi: Handle efi_memmap with Xen relocating itself Jason Andryuk
2026-11-09 15:11 ` Marek Marczykowski-Górecki
2026-11-10  8:42 ` Jan Beulich
2026-11-10 14:42   ` Jason Andryuk
2026-11-10 15:14     ` Jan Beulich [this message]
2026-11-10 15:16       ` 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=f48effca-510a-4ec3-8e2d-cd6c879aa182@suse.com \
    --to=jbeulich@suse.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=bertrand.marquis@arm.com \
    --cc=dpsmith@apertussolutions.com \
    --cc=jason.andryuk@amd.com \
    --cc=julien@xen.org \
    --cc=marmarek@invisiblethingslab.com \
    --cc=michal.orzel@amd.com \
    --cc=roger@xenproject.org \
    --cc=sstabellini@kernel.org \
    --cc=teddy.astie@vates.tech \
    --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.