* [PATCH] kexec: add more pages to v1 environment
@ 2015-06-09 12:03 Jan Beulich
2015-06-09 13:00 ` David Vrabel
2015-06-09 13:02 ` Andrew Cooper
0 siblings, 2 replies; 3+ messages in thread
From: Jan Beulich @ 2015-06-09 12:03 UTC (permalink / raw)
To: xen-devel; +Cc: David Vrabel
[-- Attachment #1: Type: text/plain, Size: 1669 bytes --]
Destination pages need mappings to be added to the page tables in the
v1 case (where nothing else calls machine_kexec_add_page() for them).
Further, without the tools mapping the low 1Mb (expected by at least
some Linux version), we need to do so in the hypervisor in the v1 case.
Suggested-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Alan Robinson <alan.robinson@ts.fujitsu.com>
--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -1003,6 +1003,24 @@ static int kexec_do_load_v1(xen_kexec_lo
if ( ret < 0 )
goto error;
+ if ( arch == EM_386 || arch == EM_X86_64 )
+ {
+ /*
+ * Ensure 0 - 1 MiB is mapped and accessible by the image.
+ *
+ * This allows access to VGA memory and the region purgatory copies
+ * in the crash case.
+ */
+ unsigned long addr;
+
+ for ( addr = 0; addr < (1UL << 20); addr += PAGE_SIZE )
+ {
+ ret = machine_kexec_add_page(kimage, addr, addr);
+ if ( ret < 0 )
+ goto error;
+ }
+ }
+
ret = kexec_load_slot(kimage);
if ( ret < 0 )
goto error;
--- a/xen/common/kimage.c
+++ b/xen/common/kimage.c
@@ -923,6 +923,11 @@ int kimage_build_ind(struct kexec_image
ret = kimage_add_page(image, page_to_maddr(xen_page));
if ( ret < 0 )
goto done;
+
+ ret = machine_kexec_add_page(image, dest, dest);
+ if ( ret < 0 )
+ goto done;
+
dest += PAGE_SIZE;
break;
}
[-- Attachment #2: kexec-v1-more-pages.patch --]
[-- Type: text/plain, Size: 1706 bytes --]
kexec: add more pages to v1 environment
Destination pages need mappings to be added to the page tables in the
v1 case (where nothing else calls machine_kexec_add_page() for them).
Further, without the tools mapping the low 1Mb (expected by at least
some Linux version), we need to do so in the hypervisor in the v1 case.
Suggested-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Alan Robinson <alan.robinson@ts.fujitsu.com>
--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -1003,6 +1003,24 @@ static int kexec_do_load_v1(xen_kexec_lo
if ( ret < 0 )
goto error;
+ if ( arch == EM_386 || arch == EM_X86_64 )
+ {
+ /*
+ * Ensure 0 - 1 MiB is mapped and accessible by the image.
+ *
+ * This allows access to VGA memory and the region purgatory copies
+ * in the crash case.
+ */
+ unsigned long addr;
+
+ for ( addr = 0; addr < (1UL << 20); addr += PAGE_SIZE )
+ {
+ ret = machine_kexec_add_page(kimage, addr, addr);
+ if ( ret < 0 )
+ goto error;
+ }
+ }
+
ret = kexec_load_slot(kimage);
if ( ret < 0 )
goto error;
--- a/xen/common/kimage.c
+++ b/xen/common/kimage.c
@@ -923,6 +923,11 @@ int kimage_build_ind(struct kexec_image
ret = kimage_add_page(image, page_to_maddr(xen_page));
if ( ret < 0 )
goto done;
+
+ ret = machine_kexec_add_page(image, dest, dest);
+ if ( ret < 0 )
+ goto done;
+
dest += PAGE_SIZE;
break;
}
[-- Attachment #3: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] kexec: add more pages to v1 environment
2015-06-09 12:03 [PATCH] kexec: add more pages to v1 environment Jan Beulich
@ 2015-06-09 13:00 ` David Vrabel
2015-06-09 13:02 ` Andrew Cooper
1 sibling, 0 replies; 3+ messages in thread
From: David Vrabel @ 2015-06-09 13:00 UTC (permalink / raw)
To: Jan Beulich, xen-devel
On 09/06/15 13:03, Jan Beulich wrote:
> Destination pages need mappings to be added to the page tables in the
> v1 case (where nothing else calls machine_kexec_add_page() for them).
>
> Further, without the tools mapping the low 1Mb (expected by at least
> some Linux version), we need to do so in the hypervisor in the v1 case.
Reviewed-by: David Vrabel <david.vrabel@citrix.com>
David
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] kexec: add more pages to v1 environment
2015-06-09 12:03 [PATCH] kexec: add more pages to v1 environment Jan Beulich
2015-06-09 13:00 ` David Vrabel
@ 2015-06-09 13:02 ` Andrew Cooper
1 sibling, 0 replies; 3+ messages in thread
From: Andrew Cooper @ 2015-06-09 13:02 UTC (permalink / raw)
To: Jan Beulich, xen-devel; +Cc: David Vrabel
[-- Attachment #1.1: Type: text/plain, Size: 1969 bytes --]
On 09/06/15 13:03, Jan Beulich wrote:
> Destination pages need mappings to be added to the page tables in the
> v1 case (where nothing else calls machine_kexec_add_page() for them).
>
> Further, without the tools mapping the low 1Mb (expected by at least
> some Linux version), we need to do so in the hypervisor in the v1 case.
>
> Suggested-by: David Vrabel <david.vrabel@citrix.com>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> Tested-by: Alan Robinson <alan.robinson@ts.fujitsu.com>
>
> --- a/xen/common/kexec.c
> +++ b/xen/common/kexec.c
> @@ -1003,6 +1003,24 @@ static int kexec_do_load_v1(xen_kexec_lo
> if ( ret < 0 )
> goto error;
>
> + if ( arch == EM_386 || arch == EM_X86_64 )
> + {
> + /*
> + * Ensure 0 - 1 MiB is mapped and accessible by the image.
> + *
> + * This allows access to VGA memory and the region purgatory copies
> + * in the crash case.
> + */
> + unsigned long addr;
> +
> + for ( addr = 0; addr < (1UL << 20); addr += PAGE_SIZE )
MB(1)
Otherwise, Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
> + {
> + ret = machine_kexec_add_page(kimage, addr, addr);
> + if ( ret < 0 )
> + goto error;
> + }
> + }
> +
> ret = kexec_load_slot(kimage);
> if ( ret < 0 )
> goto error;
> --- a/xen/common/kimage.c
> +++ b/xen/common/kimage.c
> @@ -923,6 +923,11 @@ int kimage_build_ind(struct kexec_image
> ret = kimage_add_page(image, page_to_maddr(xen_page));
> if ( ret < 0 )
> goto done;
> +
> + ret = machine_kexec_add_page(image, dest, dest);
> + if ( ret < 0 )
> + goto done;
> +
> dest += PAGE_SIZE;
> break;
> }
>
>
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
[-- Attachment #1.2: Type: text/html, Size: 3005 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-06-09 13:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-09 12:03 [PATCH] kexec: add more pages to v1 environment Jan Beulich
2015-06-09 13:00 ` David Vrabel
2015-06-09 13:02 ` Andrew Cooper
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.