From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>,
xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH 2/4] EFI/early: add /mapbs to map EfiBootServices{Code, Data}
Date: Tue, 9 Jun 2015 15:03:18 +0100 [thread overview]
Message-ID: <5576F226.6080104@citrix.com> (raw)
In-Reply-To: <55770BDF0200007800082A43@mail.emea.novell.com>
[-- Attachment #1.1: Type: text/plain, Size: 4191 bytes --]
On 09/06/15 14:53, Jan Beulich wrote:
> From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>
> To help on certain platforms to run.
>
> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>
> --- a/xen/arch/x86/efi/efi-boot.h
> +++ b/xen/arch/x86/efi/efi-boot.h
> @@ -148,12 +148,16 @@ static void __init efi_arch_process_memo
>
> switch ( desc->Type )
> {
> - default:
> - type = E820_RESERVED;
> - break;
> - case EfiConventionalMemory:
> case EfiBootServicesCode:
> case EfiBootServicesData:
> + if ( map_bs )
if ( !map_bs ) surely? It is the else case which sets a type of E820_RAM.
~Andrew
> + {
> + default:
> + type = E820_RESERVED;
> + break;
> + }
> + /* fall through */
> + case EfiConventionalMemory:
> if ( !trampoline_phys && desc->PhysicalStart + len <= 0x100000 &&
> len >= cfg.size && desc->PhysicalStart + len > cfg.addr )
> cfg.addr = (desc->PhysicalStart + len - cfg.size) & PAGE_MASK;
> --- a/xen/common/efi/boot.c
> +++ b/xen/common/efi/boot.c
> @@ -84,6 +84,7 @@ static SIMPLE_TEXT_OUTPUT_INTERFACE *__i
> static SIMPLE_TEXT_OUTPUT_INTERFACE *__initdata StdErr;
>
> static UINT32 __initdata mdesc_ver;
> +static bool_t __initdata map_bs;
>
> static struct file __initdata cfg;
> static struct file __initdata kernel;
> @@ -753,6 +754,8 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SY
> {
> if ( wstrcmp(ptr + 1, L"basevideo") == 0 )
> base_video = 1;
> + else if ( wstrcmp(ptr + 1, L"mapbs") == 0 )
> + map_bs = 1;
> else if ( wstrncmp(ptr + 1, L"cfg=", 4) == 0 )
> cfg_file_name = ptr + 5;
> else if ( i + 1 < argc && wstrcmp(ptr + 1, L"cfg") == 0 )
> @@ -762,6 +765,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SY
> {
> PrintStr(L"Xen EFI Loader options:\r\n");
> PrintStr(L"-basevideo retain current video mode\r\n");
> + PrintStr(L"-mapbs map EfiBootServices{Code,Data}\r\n");
> PrintStr(L"-cfg=<file> specify configuration file\r\n");
> PrintStr(L"-help, -? display this help\r\n");
> blexit(NULL);
> @@ -1158,7 +1162,8 @@ void __init efi_init_memory(void)
> } *extra, *extra_head = NULL;
> #endif
>
> - printk(XENLOG_INFO "EFI memory map:\n");
> + printk(XENLOG_INFO "EFI memory map:%s\n",
> + map_bs ? " (mapping BootServices)" : "");
> for ( i = 0; i < efi_memmap_size; i += efi_mdesc_size )
> {
> EFI_MEMORY_DESCRIPTOR *desc = efi_memmap + i;
> @@ -1171,7 +1176,11 @@ void __init efi_init_memory(void)
> desc->PhysicalStart, desc->PhysicalStart + len - 1,
> desc->Type, desc->Attribute);
>
> - if ( !efi_rs_enable || !(desc->Attribute & EFI_MEMORY_RUNTIME) )
> + if ( !efi_rs_enable ||
> + (!(desc->Attribute & EFI_MEMORY_RUNTIME) &&
> + (!map_bs ||
> + (desc->Type != EfiBootServicesCode &&
> + desc->Type != EfiBootServicesData))) )
> continue;
>
> desc->VirtualStart = INVALID_VIRTUAL_ADDRESS;
> @@ -1257,7 +1266,10 @@ void __init efi_init_memory(void)
> {
> const EFI_MEMORY_DESCRIPTOR *desc = efi_memmap + i;
>
> - if ( (desc->Attribute & EFI_MEMORY_RUNTIME) &&
> + if ( ((desc->Attribute & EFI_MEMORY_RUNTIME) ||
> + (map_bs &&
> + (desc->Type == EfiBootServicesCode ||
> + desc->Type == EfiBootServicesData))) &&
> desc->VirtualStart != INVALID_VIRTUAL_ADDRESS &&
> desc->VirtualStart != desc->PhysicalStart )
> copy_mapping(PFN_DOWN(desc->PhysicalStart),
>
>
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
[-- Attachment #1.2: Type: text/html, Size: 5336 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2015-06-09 14:03 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-09 13:49 [PATCH 0/4] misc EFI adjustments Jan Beulich
2015-06-09 13:52 ` [PATCH 1/4] x86/EFI: fix EFI_MEMORY_WP handling Jan Beulich
2015-06-09 13:57 ` Andrew Cooper
2015-06-09 13:53 ` [PATCH 2/4] EFI/early: add /mapbs to map EfiBootServices{Code, Data} Jan Beulich
2015-06-09 14:03 ` Andrew Cooper [this message]
2015-06-09 14:11 ` Konrad Rzeszutek Wilk
2015-06-09 15:26 ` Andrew Cooper
2015-06-09 15:24 ` Jan Beulich
2015-06-10 8:56 ` Ian Campbell
2015-06-10 9:15 ` Jan Beulich
2015-06-10 9:26 ` Ian Campbell
2015-06-10 9:37 ` Jan Beulich
2015-06-10 10:00 ` Ian Campbell
2015-06-10 10:00 ` Ian Campbell
2015-06-10 17:22 ` Roy Franz
2015-06-10 18:12 ` Andrew Cooper
2015-06-10 19:48 ` Konrad Rzeszutek Wilk
2015-06-10 19:55 ` Andrew Cooper
2015-06-10 20:06 ` Roy Franz
2015-06-11 6:34 ` Jan Beulich
2015-06-11 9:48 ` Ian Campbell
2015-06-11 19:33 ` Roy Franz
2015-06-09 13:53 ` [PATCH 3/4] EFI: support default attributes to map Runtime service areas with none given Jan Beulich
2015-06-09 14:08 ` Andrew Cooper
2015-06-09 15:26 ` Jan Beulich
2015-06-09 15:30 ` Andrew Cooper
2015-06-10 8:57 ` Ian Campbell
2015-06-09 13:54 ` [PATCH 4/4] x86/EFI: adjust EFI_MEMORY_WP handling for spec version 2.5 Jan Beulich
2015-06-09 14:08 ` Konrad Rzeszutek Wilk
2015-06-09 14:25 ` Konrad Rzeszutek Wilk
2015-06-09 15:28 ` Jan Beulich
2015-06-09 15:35 ` Konrad Rzeszutek Wilk
2015-06-09 14:15 ` Andrew Cooper
2015-06-09 15:35 ` [PATCH 0/4] misc EFI adjustments Konrad Rzeszutek Wilk
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=5576F226.6080104@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.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.