xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Minios-devel <minios-devel@lists.xenproject.org>
Cc: Juergen Gross <jgross@suse.com>,
	Xen-devel <xen-devel@lists.xenproject.org>,
	Wei Liu <wei.liu2@citrix.com>,
	Samuel Thibault <samuel.thibault@ens-lyon.org>
Subject: [MINIOS PATCH 2/3] x86: switch to use elfnote
Date: Thu, 18 Aug 2016 11:15:25 +0100	[thread overview]
Message-ID: <1471515326-4610-3-git-send-email-wei.liu2@citrix.com> (raw)
In-Reply-To: <1471515326-4610-1-git-send-email-wei.liu2@citrix.com>

Use the newer ELF note interface. The generated ELF notes results in
equivalent configuration.

Also need to modify linker script to provide a note section.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
---
 arch/x86/minios-x86_32.lds |  4 ++++
 arch/x86/minios-x86_64.lds |  4 ++++
 arch/x86/x86_32.S          | 17 +++++++----------
 arch/x86/x86_64.S          | 15 ++++++---------
 4 files changed, 21 insertions(+), 19 deletions(-)

diff --git a/arch/x86/minios-x86_32.lds b/arch/x86/minios-x86_32.lds
index f5cabb6..e4e18cb 100644
--- a/arch/x86/minios-x86_32.lds
+++ b/arch/x86/minios-x86_32.lds
@@ -15,6 +15,10 @@ SECTIONS
   .rodata : { *(.rodata) *(.rodata.*) }
   . = ALIGN(4096);
   _erodata = .;
+  .note : {
+	*(.note)
+	*(.note.*)
+  }
 
   /* newlib initialization functions */
   . = ALIGN(32 / 8);
diff --git a/arch/x86/minios-x86_64.lds b/arch/x86/minios-x86_64.lds
index 3da0a9f..f6462f3 100644
--- a/arch/x86/minios-x86_64.lds
+++ b/arch/x86/minios-x86_64.lds
@@ -15,6 +15,10 @@ SECTIONS
   .rodata : { *(.rodata) *(.rodata.*) }
   . = ALIGN(4096);
   _erodata = .;
+  .note : {
+	*(.note)
+	*(.note.*)
+  }
 
   /* newlib initialization functions */
   . = ALIGN(64 / 8);
diff --git a/arch/x86/x86_32.S b/arch/x86/x86_32.S
index b9aa392..6dc985a 100644
--- a/arch/x86/x86_32.S
+++ b/arch/x86/x86_32.S
@@ -1,17 +1,14 @@
 #include <mini-os/os.h>
 #include <mini-os/x86/arch_limits.h>
+#include <mini-os/asm_macros.h>
+#include <xen/elfnote.h>
 #include <xen/arch-x86_32.h>
 
-.section __xen_guest
-	.ascii	"GUEST_OS=Mini-OS"
-	.ascii	",XEN_VER=xen-3.0"
-	.ascii	",VIRT_BASE=0x0" /* &_text from minios_x86_32.lds */
-	.ascii	",ELF_PADDR_OFFSET=0x0"
-	.ascii	",HYPERCALL_PAGE=0x2"
-	.ascii	",PAE=yes[extended-cr3]"
-	.ascii	",LOADER=generic"
-	.byte	0
-.text
+ELFNOTE(Xen, XEN_ELFNOTE_GUEST_OS, .asciz "Mini-OS")
+ELFNOTE(Xen, XEN_ELFNOTE_LOADER, .asciz "generic")
+ELFNOTE(Xen, XEN_ELFNOTE_HYPERCALL_PAGE, _WORD hypercall_page)
+ELFNOTE(Xen, XEN_ELFNOTE_XEN_VERSION, .asciz "xen-3.0")
+ELFNOTE(Xen, XEN_ELFNOTE_PAE_MODE, .asciz "yes")
 
 .globl _start, shared_info, hypercall_page
                         
diff --git a/arch/x86/x86_64.S b/arch/x86/x86_64.S
index 72921b1..8ed452f 100644
--- a/arch/x86/x86_64.S
+++ b/arch/x86/x86_64.S
@@ -1,16 +1,13 @@
 #include <mini-os/os.h>
 #include <mini-os/x86/arch_limits.h>
+#include <mini-os/asm_macros.h>
+#include <xen/elfnote.h>
 #include <xen/features.h>
 
-.section __xen_guest
-	.ascii	"GUEST_OS=Mini-OS"
-	.ascii	",XEN_VER=xen-3.0"
-	.ascii	",VIRT_BASE=0x0" /* &_text from minios_x86_64.lds */
-	.ascii	",ELF_PADDR_OFFSET=0x0"
-	.ascii	",HYPERCALL_PAGE=0x2"
-	.ascii	",LOADER=generic"
-	.byte	0
-.text
+ELFNOTE(Xen, XEN_ELFNOTE_GUEST_OS, .asciz "Mini-OS")
+ELFNOTE(Xen, XEN_ELFNOTE_LOADER, .asciz "generic")
+ELFNOTE(Xen, XEN_ELFNOTE_HYPERCALL_PAGE, _WORD hypercall_page)
+ELFNOTE(Xen, XEN_ELFNOTE_XEN_VERSION, .asciz "xen-3.0")
 
 #define ENTRY(X) .globl X ; X :
 .globl _start, shared_info, hypercall_page
-- 
2.1.4


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

  parent reply	other threads:[~2016-08-18 10:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-18 10:15 [MINIOS PATCH 0/3] x86: use ELF notes and unified linker script Wei Liu
2016-08-18 10:15 ` [MINIOS PATCH 1/3] Introduce asm_macros.h Wei Liu
2016-08-18 10:34   ` Juergen Gross
2016-08-20 11:03     ` Samuel Thibault
2016-08-18 10:15 ` Wei Liu [this message]
2016-08-20 11:04   ` [MINIOS PATCH 2/3] x86: switch to use elfnote Samuel Thibault
2016-08-18 10:15 ` [MINIOS PATCH 3/3] x86: use unified linker script Wei Liu
2016-08-18 10:39   ` Juergen Gross
2016-08-20 11:05     ` Samuel Thibault
2016-08-18 10:20 ` [MINIOS PATCH 0/3] x86: use ELF notes and " Andrew Cooper
2016-08-22  9:41 ` Wei Liu

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=1471515326-4610-3-git-send-email-wei.liu2@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=jgross@suse.com \
    --cc=minios-devel@lists.xenproject.org \
    --cc=samuel.thibault@ens-lyon.org \
    --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 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).