xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/setup: do not relocate below the end of current Xen image placement
@ 2017-11-27 15:41 Daniel Kiper
  2017-11-27 16:51 ` Jan Beulich
  2017-11-27 16:58 ` Andrew Cooper
  0 siblings, 2 replies; 18+ messages in thread
From: Daniel Kiper @ 2017-11-27 15:41 UTC (permalink / raw)
  To: xen-devel; +Cc: andrew.cooper3, jbeulich, konrad.wilk

If it is possible we would like to have the Xen image higher than the
booloader put it and certainly do not overwrite the Xen code and data
during copy/relocation. Otherwise the Xen may crash silently at boot.

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
---
 xen/arch/x86/setup.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 32bb02e..be91d34 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -960,7 +960,13 @@ void __init noreturn __start_xen(unsigned long mbi_p)
         }
         else
             end = 0;
-        if ( end > s )
+
+        /*
+         * Is the region size greater than zero?
+         * Does the region begins above or at the
+         * end of current Xen image placement?
+         */
+        if ( end > s && (end - reloc_size >= _end - _start) )
         {
             l4_pgentry_t *pl4e;
             l3_pgentry_t *pl3e;
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2017-11-30  8:00 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-27 15:41 [PATCH] x86/setup: do not relocate below the end of current Xen image placement Daniel Kiper
2017-11-27 16:51 ` Jan Beulich
2017-11-28 12:41   ` Daniel Kiper
2017-11-28 14:28     ` Jan Beulich
2017-11-29 18:56       ` Daniel Kiper
2017-11-29 22:57         ` Daniel Kiper
2017-11-30  8:00         ` Jan Beulich
2017-11-27 16:58 ` Andrew Cooper
2017-11-27 19:54   ` Konrad Rzeszutek Wilk
2017-11-28  7:42     ` Jan Beulich
2017-11-28  7:37   ` Jan Beulich
2017-11-28 11:32   ` Daniel Kiper
2017-11-28 11:51     ` Jan Beulich
2017-11-28 12:47       ` Daniel Kiper
2017-11-28 13:37         ` Jan Beulich
2017-11-28 13:53           ` Daniel Kiper
2017-11-28 14:02             ` Jan Beulich
2017-11-28 14:27               ` Daniel Kiper

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).