xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [MINIOS PATCH 0/4] x86: Use ELF notes and unfied linker script
@ 2016-08-17 12:35 Wei Liu
  2016-08-17 12:35 ` [MINIOS PATCH 1/4] gitignore: ignore vim swap file Wei Liu
                   ` (3 more replies)
  0 siblings, 4 replies; 17+ messages in thread
From: Wei Liu @ 2016-08-17 12:35 UTC (permalink / raw)
  To: Minios-devel; +Cc: Xen-devel, Wei Liu, Samuel Thibault

Wei Liu (4):
  gitignore: ignore vim swap file
  Introduce asm_macros.h
  x86: switch to use elfnote
  x86: use unified linker script

 .gitignore                 |   2 +
 Makefile                   |   6 +-
 arch/x86/Makefile          |   1 +
 arch/x86/minios-x86.lds.S  | 133 +++++++++++++++++++++++++++++++++++++++++++++
 arch/x86/minios-x86_32.lds |  74 -------------------------
 arch/x86/minios-x86_64.lds |  74 -------------------------
 arch/x86/x86_32.S          |  17 +++---
 arch/x86/x86_64.S          |  15 ++---
 include/asm_macros.h       |  36 ++++++++++++
 include/x86/asm_macros.h   |  28 ++++++++++
 10 files changed, 218 insertions(+), 168 deletions(-)
 create mode 100644 arch/x86/minios-x86.lds.S
 delete mode 100644 arch/x86/minios-x86_32.lds
 delete mode 100644 arch/x86/minios-x86_64.lds
 create mode 100644 include/asm_macros.h
 create mode 100644 include/x86/asm_macros.h

-- 
2.1.4


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

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

* [MINIOS PATCH 1/4] gitignore: ignore vim swap file
  2016-08-17 12:35 [MINIOS PATCH 0/4] x86: Use ELF notes and unfied linker script Wei Liu
@ 2016-08-17 12:35 ` Wei Liu
  2016-08-17 12:51   ` Samuel Thibault
  2016-08-17 12:35 ` [MINIOS PATCH 2/4] Introduce asm_macros.h Wei Liu
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 17+ messages in thread
From: Wei Liu @ 2016-08-17 12:35 UTC (permalink / raw)
  To: Minios-devel; +Cc: Xen-devel, Wei Liu, Samuel Thibault

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
 .gitignore | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.gitignore b/.gitignore
index 1c655a0..f21cc46 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,7 @@
 *~
 *.o
 *.a
+*.swp
 include/list.h
 mini-os
 mini-os.gz
-- 
2.1.4


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

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

* [MINIOS PATCH 2/4] Introduce asm_macros.h
  2016-08-17 12:35 [MINIOS PATCH 0/4] x86: Use ELF notes and unfied linker script Wei Liu
  2016-08-17 12:35 ` [MINIOS PATCH 1/4] gitignore: ignore vim swap file Wei Liu
@ 2016-08-17 12:35 ` Wei Liu
  2016-08-17 12:56   ` Samuel Thibault
  2016-08-17 14:01   ` Andrew Cooper
  2016-08-17 12:35 ` [MINIOS PATCH 3/4] x86: switch to use elfnote Wei Liu
  2016-08-17 12:35 ` [MINIOS PATCH 4/4] x86: use unified linker script Wei Liu
  3 siblings, 2 replies; 17+ messages in thread
From: Wei Liu @ 2016-08-17 12:35 UTC (permalink / raw)
  To: Minios-devel; +Cc: Xen-devel, Wei Liu, Samuel Thibault

Ported from xtf.git.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
 include/asm_macros.h     | 36 ++++++++++++++++++++++++++++++++++++
 include/x86/asm_macros.h | 28 ++++++++++++++++++++++++++++
 2 files changed, 64 insertions(+)
 create mode 100644 include/asm_macros.h
 create mode 100644 include/x86/asm_macros.h

diff --git a/include/asm_macros.h b/include/asm_macros.h
new file mode 100644
index 0000000..15dd377
--- /dev/null
+++ b/include/asm_macros.h
@@ -0,0 +1,36 @@
+/*
+ * Macros for assembly files.
+ */
+
+#ifndef _ASM_MACRO_H_
+#define _ASM_MACRO_H_
+
+#include <x86/asm_macros.h>
+
+#ifdef __ASSEMBLY__
+
+#define ELFNOTE(name, type, desc)           \
+    .pushsection .note.name               ; \
+    .align 4                              ; \
+    .long 2f - 1f       /* namesz */      ; \
+    .long 4f - 3f       /* descsz */      ; \
+    .long type          /* type   */      ; \
+1:.asciz #name          /* name   */      ; \
+2:.align 4                                ; \
+3:desc                  /* desc   */      ; \
+4:.align 4                                ; \
+    .popsection
+
+#endif  /* __ASSEMBLY__ */
+
+#endif  /* _ASM_MACRO_H_ */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/include/x86/asm_macros.h b/include/x86/asm_macros.h
new file mode 100644
index 0000000..e718e0b
--- /dev/null
+++ b/include/x86/asm_macros.h
@@ -0,0 +1,28 @@
+#ifndef _X86_ASM_MACRO_H_
+#define _X86_ASM_MACRO_H_
+
+#ifdef  __ASSEMBLY__
+# if defined(__x86_64__)
+#  define _WORD .quad
+# elif defined(__i386__)
+#  define _WORD .long
+# endif
+#else
+# if defined(__x86_64__)
+#  define _WORD ".quad"
+# elif defined(__i386__)
+#  define _WORD ".long"
+# endif
+#endif
+
+#endif	/* _X86_ASM_MACRO_H_ */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
-- 
2.1.4


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

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

* [MINIOS PATCH 3/4] x86: switch to use elfnote
  2016-08-17 12:35 [MINIOS PATCH 0/4] x86: Use ELF notes and unfied linker script Wei Liu
  2016-08-17 12:35 ` [MINIOS PATCH 1/4] gitignore: ignore vim swap file Wei Liu
  2016-08-17 12:35 ` [MINIOS PATCH 2/4] Introduce asm_macros.h Wei Liu
@ 2016-08-17 12:35 ` Wei Liu
  2016-08-17 14:00   ` [Minios-devel] " Juergen Gross
  2016-08-17 12:35 ` [MINIOS PATCH 4/4] x86: use unified linker script Wei Liu
  3 siblings, 1 reply; 17+ messages in thread
From: Wei Liu @ 2016-08-17 12:35 UTC (permalink / raw)
  To: Minios-devel; +Cc: Xen-devel, Wei Liu, Samuel Thibault

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

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

* [MINIOS PATCH 4/4] x86: use unified linker script
  2016-08-17 12:35 [MINIOS PATCH 0/4] x86: Use ELF notes and unfied linker script Wei Liu
                   ` (2 preceding siblings ...)
  2016-08-17 12:35 ` [MINIOS PATCH 3/4] x86: switch to use elfnote Wei Liu
@ 2016-08-17 12:35 ` Wei Liu
  2016-08-17 12:37   ` Wei Liu
  2016-08-17 12:52   ` Andrew Cooper
  3 siblings, 2 replies; 17+ messages in thread
From: Wei Liu @ 2016-08-17 12:35 UTC (permalink / raw)
  To: Minios-devel; +Cc: Xen-devel, Wei Liu, Samuel Thibault

There are only a few differences between i386 and x86-64 linker scripts.
Unify them into one. Re-indent the file at the same time.

Construct a special rule in top-level directory to cope with the change.
Ideally the build system should also be made more elegant, but
overhauling the build system is out of scope of this patch.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
 .gitignore                 |   1 +
 Makefile                   |   6 +-
 arch/x86/Makefile          |   1 +
 arch/x86/minios-x86.lds.S  | 133 +++++++++++++++++++++++++++++++++++++++++++++
 arch/x86/minios-x86_32.lds |  78 --------------------------
 arch/x86/minios-x86_64.lds |  78 --------------------------
 6 files changed, 140 insertions(+), 157 deletions(-)
 create mode 100644 arch/x86/minios-x86.lds.S
 delete mode 100644 arch/x86/minios-x86_32.lds
 delete mode 100644 arch/x86/minios-x86_64.lds

diff --git a/.gitignore b/.gitignore
index f21cc46..efc193c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,6 +2,7 @@
 *.o
 *.a
 *.swp
+arch/x86/minios-x86*.lds
 include/list.h
 mini-os
 mini-os.gz
diff --git a/Makefile b/Makefile
index 5464e89..779bc91 100644
--- a/Makefile
+++ b/Makefile
@@ -148,7 +148,11 @@ ifneq ($(APP_OBJS),)
 APP_O=$(OBJ_DIR)/$(TARGET)_app.o 
 endif
 
-$(OBJ_DIR)/$(TARGET): $(OBJS) $(APP_O) arch_lib
+# Special rule for x86 for now
+arch/x86/minios-x86%.lds:  arch/x86/minios-x86.lds.S
+	$(CPP) $(ASFLAGS) -P $< -o $@
+
+$(OBJ_DIR)/$(TARGET): $(OBJS) $(APP_O) arch_lib $(TARGET_ARCH_DIR)/minios-$(MINIOS_TARGET_ARCH).lds
 	$(LD) -r $(LDFLAGS) $(HEAD_OBJ) $(APP_O) $(OBJS) $(LDARCHLIB) $(LDLIBS) -o $@.o
 	$(OBJCOPY) -w -G $(GLOBAL_PREFIX)* -G _start $@.o $@.o
 	$(LD) $(LDFLAGS) $(LDFLAGS_FINAL) $@.o $(EXTRA_OBJS) -o $@
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 0052b4c..dbe9ca6 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -24,4 +24,5 @@ $(OBJ_DIR)/$(ARCH_LIB): $(ARCH_OBJS) $(OBJ_DIR)/$(HEAD_ARCH_OBJ)
 
 clean:
 	rm -f $(OBJ_DIR)/$(ARCH_LIB) $(ARCH_OBJS) $(OBJ_DIR)/$(HEAD_ARCH_OBJ)
+	rm -f minios-x86_32.lds minios-x86_64.lds
 
diff --git a/arch/x86/minios-x86.lds.S b/arch/x86/minios-x86.lds.S
new file mode 100644
index 0000000..65650ab
--- /dev/null
+++ b/arch/x86/minios-x86.lds.S
@@ -0,0 +1,133 @@
+#if defined(__x86_64__)
+
+OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64")
+OUTPUT_ARCH(i386:x86-64)
+
+#elif defined(__i386__)
+#undef i386
+OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
+OUTPUT_ARCH(i386)
+
+#else
+# error Bad architecture to link with
+#endif
+
+ENTRY(_start)
+SECTIONS
+{
+        . = 0x0;
+        _text = .;			/* Text and read-only data */
+        .text : {
+                *(.text)
+                *(.gnu.warning)
+        } = 0x9090
+
+        _etext = .;			/* End of text section */
+
+        .rodata : {
+                *(.rodata)
+                *(.rodata.*)
+        }
+        . = ALIGN(4096);
+        _erodata = .;
+
+        .note : {
+                *(.note)
+                *(.note.*)
+        }
+
+        /* newlib initialization functions */
+#if defined(__x86_64__)
+        . = ALIGN(64 / 8);
+#else /* __i386 __ */
+        . = ALIGN(64 / 8);
+#endif
+        PROVIDE (__preinit_array_start = .);
+        .preinit_array : {
+                *(.preinit_array)
+        }
+        PROVIDE (__preinit_array_end = .);
+        PROVIDE (__init_array_start = .);
+        .init_array : {
+                *(.init_array)
+        }
+        PROVIDE (__init_array_end = .);
+        PROVIDE (__fini_array_start = .);
+        .fini_array : {
+                *(.fini_array)
+        }
+        PROVIDE (__fini_array_end = .);
+
+        .ctors : {
+                __CTOR_LIST__ = .;
+                *(.ctors)
+                CONSTRUCTORS
+#if defined(__x86_64__)
+                QUAD(0)
+#else /* __i386__ */
+                LONG(0)
+#endif
+                __CTOR_END__ = .;
+        }
+
+        .dtors : {
+                __DTOR_LIST__ = .;
+                *(.dtors)
+#if defined(__x86_64__)
+                QUAD(0)
+#else /* __i386__ */
+                LONG(0)
+#endif
+                __DTOR_END__ = .;
+        }
+
+        .data : {			/* Data */
+                *(.data)
+        }
+
+        _edata = .;			/* End of data section */
+
+        __bss_start = .;		/* BSS */
+        .bss : {
+                *(.bss)
+                *(.app.bss)
+        }
+        _end = . ;
+
+        /* Sections to be discarded */
+        /DISCARD/ : {
+                *(.text.exit)
+                *(.data.exit)
+                *(.exitcall.exit)
+        }
+
+        /* Stabs debugging sections.  */
+        .stab 0 : {
+                *(.stab)
+        }
+        .stabstr 0 : {
+                *(.stabstr)
+        }
+        .stab.excl 0 : {
+                *(.stab.excl)
+        }
+        .stab.exclstr 0 : {
+                *(.stab.exclstr)
+        }
+        .stab.index 0 : {
+                *(.stab.index)
+        }
+        .stab.indexstr 0 : {
+                *(.stab.indexstr)
+        }
+        .comment 0 : {
+                *(.comment)
+        }
+}
+
+/*
+ * Local variables:
+ * tab-width: 8
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/arch/x86/minios-x86_32.lds b/arch/x86/minios-x86_32.lds
deleted file mode 100644
index e4e18cb..0000000
--- a/arch/x86/minios-x86_32.lds
+++ /dev/null
@@ -1,78 +0,0 @@
-OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
-OUTPUT_ARCH(i386)
-ENTRY(_start)
-SECTIONS
-{
-  . = 0x0;
-  _text = .;			/* Text and read-only data */
-  .text : {
-	*(.text)
-	*(.gnu.warning)
-	} = 0x9090
-
-  _etext = .;			/* End of text section */
-
-  .rodata : { *(.rodata) *(.rodata.*) }
-  . = ALIGN(4096);
-  _erodata = .;
-  .note : {
-	*(.note)
-	*(.note.*)
-  }
-
-  /* newlib initialization functions */
-  . = ALIGN(32 / 8);
-  PROVIDE (__preinit_array_start = .);
-  .preinit_array     : { *(.preinit_array) }
-  PROVIDE (__preinit_array_end = .);
-  PROVIDE (__init_array_start = .);
-  .init_array     : { *(.init_array) }
-  PROVIDE (__init_array_end = .);
-  PROVIDE (__fini_array_start = .);
-  .fini_array     : { *(.fini_array) }
-  PROVIDE (__fini_array_end = .);
-
-  .ctors : {
-        __CTOR_LIST__ = .;
-        *(.ctors)
-	CONSTRUCTORS
-        LONG(0)
-        __CTOR_END__ = .;
-        }
-
-  .dtors : {
-        __DTOR_LIST__ = .;
-        *(.dtors)
-        LONG(0)
-        __DTOR_END__ = .;
-        }
-
-  .data : {			/* Data */
-	*(.data)
-	}
-
-  _edata = .;			/* End of data section */
-
-  __bss_start = .;		/* BSS */
-  .bss : {
-	*(.bss)
-        *(.app.bss)
-	}
-  _end = . ;
-
-  /* Sections to be discarded */
-  /DISCARD/ : {
-	*(.text.exit)
-	*(.data.exit)
-	*(.exitcall.exit)
-	}
-
-  /* Stabs debugging sections.  */
-  .stab 0 : { *(.stab) }
-  .stabstr 0 : { *(.stabstr) }
-  .stab.excl 0 : { *(.stab.excl) }
-  .stab.exclstr 0 : { *(.stab.exclstr) }
-  .stab.index 0 : { *(.stab.index) }
-  .stab.indexstr 0 : { *(.stab.indexstr) }
-  .comment 0 : { *(.comment) }
-}
diff --git a/arch/x86/minios-x86_64.lds b/arch/x86/minios-x86_64.lds
deleted file mode 100644
index f6462f3..0000000
--- a/arch/x86/minios-x86_64.lds
+++ /dev/null
@@ -1,78 +0,0 @@
-OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64")
-OUTPUT_ARCH(i386:x86-64)
-ENTRY(_start)
-SECTIONS
-{
-  . = 0x0;
-  _text = .;			/* Text and read-only data */
-  .text : {
-	*(.text)
-	*(.gnu.warning)
-	} = 0x9090
-
-  _etext = .;			/* End of text section */
-
-  .rodata : { *(.rodata) *(.rodata.*) }
-  . = ALIGN(4096);
-  _erodata = .;
-  .note : {
-	*(.note)
-	*(.note.*)
-  }
-
-  /* newlib initialization functions */
-  . = ALIGN(64 / 8);
-  PROVIDE (__preinit_array_start = .);
-  .preinit_array     : { *(.preinit_array) }
-  PROVIDE (__preinit_array_end = .);
-  PROVIDE (__init_array_start = .);
-  .init_array     : { *(.init_array) }
-  PROVIDE (__init_array_end = .);
-  PROVIDE (__fini_array_start = .);
-  .fini_array     : { *(.fini_array) }
-  PROVIDE (__fini_array_end = .);
-
-  .ctors : {
-        __CTOR_LIST__ = .;
-        *(.ctors)
-	CONSTRUCTORS
-        QUAD(0)
-        __CTOR_END__ = .;
-        }
-
-  .dtors : {
-        __DTOR_LIST__ = .;
-        *(.dtors)
-        QUAD(0)
-        __DTOR_END__ = .;
-        }
-
-  .data : {			/* Data */
-	*(.data)
-	}
-
-  _edata = .;			/* End of data section */
-
-  __bss_start = .;		/* BSS */
-  .bss : {
-	*(.bss)
-        *(.app.bss)
-	}
-  _end = . ;
-
-  /* Sections to be discarded */
-  /DISCARD/ : {
-	*(.text.exit)
-	*(.data.exit)
-	*(.exitcall.exit)
-	}
-
-  /* Stabs debugging sections.  */
-  .stab 0 : { *(.stab) }
-  .stabstr 0 : { *(.stabstr) }
-  .stab.excl 0 : { *(.stab.excl) }
-  .stab.exclstr 0 : { *(.stab.exclstr) }
-  .stab.index 0 : { *(.stab.index) }
-  .stab.indexstr 0 : { *(.stab.indexstr) }
-  .comment 0 : { *(.comment) }
-}
-- 
2.1.4


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

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

* Re: [MINIOS PATCH 4/4] x86: use unified linker script
  2016-08-17 12:35 ` [MINIOS PATCH 4/4] x86: use unified linker script Wei Liu
@ 2016-08-17 12:37   ` Wei Liu
  2016-08-17 12:52   ` Andrew Cooper
  1 sibling, 0 replies; 17+ messages in thread
From: Wei Liu @ 2016-08-17 12:37 UTC (permalink / raw)
  To: Minios-devel; +Cc: Xen-devel, Wei Liu, Samuel Thibault

On Wed, Aug 17, 2016 at 01:35:14PM +0100, Wei Liu wrote:
> There are only a few differences between i386 and x86-64 linker scripts.
> Unify them into one. Re-indent the file at the same time.
> 
> Construct a special rule in top-level directory to cope with the change.
> Ideally the build system should also be made more elegant, but
> overhauling the build system is out of scope of this patch.
> 
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
[...]
> +        /* newlib initialization functions */
> +#if defined(__x86_64__)
> +        . = ALIGN(64 / 8);
> +#else /* __i386 __ */
> +        . = ALIGN(64 / 8);

Oops, this should be 32 / 8.

Wei.

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

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

* Re: [MINIOS PATCH 1/4] gitignore: ignore vim swap file
  2016-08-17 12:35 ` [MINIOS PATCH 1/4] gitignore: ignore vim swap file Wei Liu
@ 2016-08-17 12:51   ` Samuel Thibault
  2016-08-18 10:13     ` Wei Liu
  0 siblings, 1 reply; 17+ messages in thread
From: Samuel Thibault @ 2016-08-17 12:51 UTC (permalink / raw)
  To: Wei Liu; +Cc: Minios-devel, Xen-devel

Wei Liu, on Wed 17 Aug 2016 13:35:11 +0100, wrote:
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>

Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

> ---
>  .gitignore | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/.gitignore b/.gitignore
> index 1c655a0..f21cc46 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -1,6 +1,7 @@
>  *~
>  *.o
>  *.a
> +*.swp
>  include/list.h
>  mini-os
>  mini-os.gz
> -- 
> 2.1.4
> 

-- 
Samuel
Accroche-toi au terminal, j'enlève le shell...
 -+- nojhan -+-

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

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

* Re: [MINIOS PATCH 4/4] x86: use unified linker script
  2016-08-17 12:35 ` [MINIOS PATCH 4/4] x86: use unified linker script Wei Liu
  2016-08-17 12:37   ` Wei Liu
@ 2016-08-17 12:52   ` Andrew Cooper
  1 sibling, 0 replies; 17+ messages in thread
From: Andrew Cooper @ 2016-08-17 12:52 UTC (permalink / raw)
  To: Wei Liu, Minios-devel; +Cc: Xen-devel, Samuel Thibault

On 17/08/16 13:35, Wei Liu wrote:
> diff --git a/arch/x86/minios-x86.lds.S b/arch/x86/minios-x86.lds.S
> new file mode 100644
> index 0000000..65650ab
> --- /dev/null
> +++ b/arch/x86/minios-x86.lds.S
> @@ -0,0 +1,133 @@
> +#if defined(__x86_64__)
> +
> +OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64")
> +OUTPUT_ARCH(i386:x86-64)
> +
> +#elif defined(__i386__)
> +#undef i386
> +OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
> +OUTPUT_ARCH(i386)

While merging, it would be worth switching to the single-parameter form
of OUTPUT_FORMAT().  x86 does not exist in big-endian[1].

~Andrew

[1] despite what the OpenSSL authors might believe -
http://opensslrampage.org/post/83031733755/remove-support-for-big-endian-i386-and
or https://lwn.net/Articles/595697/

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

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

* Re: [MINIOS PATCH 2/4] Introduce asm_macros.h
  2016-08-17 12:35 ` [MINIOS PATCH 2/4] Introduce asm_macros.h Wei Liu
@ 2016-08-17 12:56   ` Samuel Thibault
  2016-08-17 13:40     ` Wei Liu
  2016-08-17 14:01   ` Andrew Cooper
  1 sibling, 1 reply; 17+ messages in thread
From: Samuel Thibault @ 2016-08-17 12:56 UTC (permalink / raw)
  To: Wei Liu; +Cc: Minios-devel, Xen-devel

Hello,

Wei Liu, on Wed 17 Aug 2016 13:35:12 +0100, wrote:
> Ported from xtf.git.

What is xtf.git? Does it use the same BSD licencing?
To my knowledge this is coming from the linux kernel source.

> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> ---
>  include/asm_macros.h     | 36 ++++++++++++++++++++++++++++++++++++
>  include/x86/asm_macros.h | 28 ++++++++++++++++++++++++++++
>  2 files changed, 64 insertions(+)
>  create mode 100644 include/asm_macros.h
>  create mode 100644 include/x86/asm_macros.h
> 
> diff --git a/include/asm_macros.h b/include/asm_macros.h
> new file mode 100644
> index 0000000..15dd377
> --- /dev/null
> +++ b/include/asm_macros.h
> @@ -0,0 +1,36 @@
> +/*
> + * Macros for assembly files.
> + */
> +
> +#ifndef _ASM_MACRO_H_
> +#define _ASM_MACRO_H_
> +
> +#include <x86/asm_macros.h>
> +
> +#ifdef __ASSEMBLY__
> +
> +#define ELFNOTE(name, type, desc)           \
> +    .pushsection .note.name               ; \
> +    .align 4                              ; \
> +    .long 2f - 1f       /* namesz */      ; \
> +    .long 4f - 3f       /* descsz */      ; \
> +    .long type          /* type   */      ; \
> +1:.asciz #name          /* name   */      ; \
> +2:.align 4                                ; \
> +3:desc                  /* desc   */      ; \
> +4:.align 4                                ; \
> +    .popsection
> +
> +#endif  /* __ASSEMBLY__ */
> +
> +#endif  /* _ASM_MACRO_H_ */
> +
> +/*
> + * Local variables:
> + * mode: C
> + * c-file-style: "BSD"
> + * c-basic-offset: 4
> + * tab-width: 4
> + * indent-tabs-mode: nil
> + * End:
> + */
> diff --git a/include/x86/asm_macros.h b/include/x86/asm_macros.h
> new file mode 100644
> index 0000000..e718e0b
> --- /dev/null
> +++ b/include/x86/asm_macros.h
> @@ -0,0 +1,28 @@
> +#ifndef _X86_ASM_MACRO_H_
> +#define _X86_ASM_MACRO_H_
> +
> +#ifdef  __ASSEMBLY__
> +# if defined(__x86_64__)
> +#  define _WORD .quad
> +# elif defined(__i386__)
> +#  define _WORD .long
> +# endif
> +#else
> +# if defined(__x86_64__)
> +#  define _WORD ".quad"
> +# elif defined(__i386__)
> +#  define _WORD ".long"
> +# endif
> +#endif
> +
> +#endif	/* _X86_ASM_MACRO_H_ */
> +
> +/*
> + * Local variables:
> + * mode: C
> + * c-file-style: "BSD"
> + * c-basic-offset: 4
> + * tab-width: 4
> + * indent-tabs-mode: nil
> + * End:
> + */
> -- 
> 2.1.4
> 

-- 
Samuel
"And the next time you consider complaining that running Lucid Emacs
19.05 via NFS from a remote Linux machine in Paraguay doesn't seem to
get the background colors right, you'll know who to thank."
(By Matt Welsh)

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

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

* Re: [MINIOS PATCH 2/4] Introduce asm_macros.h
  2016-08-17 12:56   ` Samuel Thibault
@ 2016-08-17 13:40     ` Wei Liu
  2016-08-17 13:44       ` Wei Liu
  2016-08-17 13:49       ` Andrew Cooper
  0 siblings, 2 replies; 17+ messages in thread
From: Wei Liu @ 2016-08-17 13:40 UTC (permalink / raw)
  To: Samuel Thibault, Wei Liu, Minios-devel, Xen-devel; +Cc: Andrew Cooper

On Wed, Aug 17, 2016 at 02:56:00PM +0200, Samuel Thibault wrote:
> Hello,
> 
> Wei Liu, on Wed 17 Aug 2016 13:35:12 +0100, wrote:
> > Ported from xtf.git.
> 
> What is xtf.git? Does it use the same BSD licencing?
> To my knowledge this is coming from the linux kernel source.

This:
http://xenbits.xen.org/gitweb/?p=people/andrewcoop/xen-test-framework.git;a=summary

The official repository is not yet ready. That project is BSD licensed.

Andrew, can you clarify whether you copied this from Linux by mistake?

Wei.

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

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

* Re: [MINIOS PATCH 2/4] Introduce asm_macros.h
  2016-08-17 13:40     ` Wei Liu
@ 2016-08-17 13:44       ` Wei Liu
  2016-08-17 13:49       ` Andrew Cooper
  1 sibling, 0 replies; 17+ messages in thread
From: Wei Liu @ 2016-08-17 13:44 UTC (permalink / raw)
  To: Samuel Thibault, Wei Liu, Minios-devel, Xen-devel; +Cc: Andrew Cooper

On Wed, Aug 17, 2016 at 02:40:09PM +0100, Wei Liu wrote:
> On Wed, Aug 17, 2016 at 02:56:00PM +0200, Samuel Thibault wrote:
> > Hello,
> > 
> > Wei Liu, on Wed 17 Aug 2016 13:35:12 +0100, wrote:
> > > Ported from xtf.git.
> > 
> > What is xtf.git? Does it use the same BSD licencing?
> > To my knowledge this is coming from the linux kernel source.
> 
> This:
> http://xenbits.xen.org/gitweb/?p=people/andrewcoop/xen-test-framework.git;a=summary
> 
> The official repository is not yet ready. That project is BSD licensed.
> 
> Andrew, can you clarify whether you copied this from Linux by mistake?
> 

Actually I think FreeBSD has similar construct in
i386/include/asmacros.h. We should be fine here.

Wei.

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

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

* Re: [MINIOS PATCH 2/4] Introduce asm_macros.h
  2016-08-17 13:40     ` Wei Liu
  2016-08-17 13:44       ` Wei Liu
@ 2016-08-17 13:49       ` Andrew Cooper
  1 sibling, 0 replies; 17+ messages in thread
From: Andrew Cooper @ 2016-08-17 13:49 UTC (permalink / raw)
  To: Wei Liu, Samuel Thibault, Minios-devel, Xen-devel

On 17/08/16 14:40, Wei Liu wrote:
> On Wed, Aug 17, 2016 at 02:56:00PM +0200, Samuel Thibault wrote:
>> Hello,
>>
>> Wei Liu, on Wed 17 Aug 2016 13:35:12 +0100, wrote:
>>> Ported from xtf.git.
>> What is xtf.git? Does it use the same BSD licencing?
>> To my knowledge this is coming from the linux kernel source.
> This:
> http://xenbits.xen.org/gitweb/?p=people/andrewcoop/xen-test-framework.git;a=summary
>
> The official repository is not yet ready. That project is BSD licensed.
>
> Andrew, can you clarify whether you copied this from Linux by mistake?

This definitely isn't Linux.  Their version is unnecessarily complicated.

I wrote this code myself, but there are only so many ways of arranging
the construction of a legal note field in a readable way.

Arguably, my code actually looks closer to its FreeBSD equivalent than
Linux.

~Andrew

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

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

* Re: [Minios-devel] [MINIOS PATCH 3/4] x86: switch to use elfnote
  2016-08-17 12:35 ` [MINIOS PATCH 3/4] x86: switch to use elfnote Wei Liu
@ 2016-08-17 14:00   ` Juergen Gross
  0 siblings, 0 replies; 17+ messages in thread
From: Juergen Gross @ 2016-08-17 14:00 UTC (permalink / raw)
  To: Wei Liu, Minios-devel; +Cc: Xen-devel, Samuel Thibault

On 17/08/16 14:35, Wei Liu wrote:
> 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>

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

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

* Re: [MINIOS PATCH 2/4] Introduce asm_macros.h
  2016-08-17 12:35 ` [MINIOS PATCH 2/4] Introduce asm_macros.h Wei Liu
  2016-08-17 12:56   ` Samuel Thibault
@ 2016-08-17 14:01   ` Andrew Cooper
  2016-08-17 14:03     ` Wei Liu
  1 sibling, 1 reply; 17+ messages in thread
From: Andrew Cooper @ 2016-08-17 14:01 UTC (permalink / raw)
  To: Wei Liu, Minios-devel; +Cc: Xen-devel, Samuel Thibault

On 17/08/16 13:35, Wei Liu wrote:
> diff --git a/include/asm_macros.h b/include/asm_macros.h
> new file mode 100644
> index 0000000..15dd377
> --- /dev/null
> +++ b/include/asm_macros.h
> @@ -0,0 +1,36 @@
> +/*
> + * Macros for assembly files.
> + */
> +
> +#ifndef _ASM_MACRO_H_
> +#define _ASM_MACRO_H_
> +
> +#include <x86/asm_macros.h>

This presumably should be <mini-os/arch_asm_macros.h>, and a stub file
for ARM ?

~Andrew

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

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

* Re: [MINIOS PATCH 2/4] Introduce asm_macros.h
  2016-08-17 14:01   ` Andrew Cooper
@ 2016-08-17 14:03     ` Wei Liu
  2016-08-17 14:05       ` Wei Liu
  0 siblings, 1 reply; 17+ messages in thread
From: Wei Liu @ 2016-08-17 14:03 UTC (permalink / raw)
  To: Andrew Cooper; +Cc: Minios-devel, Xen-devel, Wei Liu, Samuel Thibault

On Wed, Aug 17, 2016 at 03:01:07PM +0100, Andrew Cooper wrote:
> On 17/08/16 13:35, Wei Liu wrote:
> > diff --git a/include/asm_macros.h b/include/asm_macros.h
> > new file mode 100644
> > index 0000000..15dd377
> > --- /dev/null
> > +++ b/include/asm_macros.h
> > @@ -0,0 +1,36 @@
> > +/*
> > + * Macros for assembly files.
> > + */
> > +
> > +#ifndef _ASM_MACRO_H_
> > +#define _ASM_MACRO_H_
> > +
> > +#include <x86/asm_macros.h>
> 
> This presumably should be <mini-os/arch_asm_macros.h>, and a stub file
> for ARM ?
> 

Don't want to rearrange build system and directory hierarchy just yet.

Good point on ARM stub, though. I will add one for ARM.

Wei.

> ~Andrew

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

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

* Re: [MINIOS PATCH 2/4] Introduce asm_macros.h
  2016-08-17 14:03     ` Wei Liu
@ 2016-08-17 14:05       ` Wei Liu
  0 siblings, 0 replies; 17+ messages in thread
From: Wei Liu @ 2016-08-17 14:05 UTC (permalink / raw)
  To: Andrew Cooper; +Cc: Minios-devel, Xen-devel, Wei Liu, Samuel Thibault

On Wed, Aug 17, 2016 at 03:03:44PM +0100, Wei Liu wrote:
> On Wed, Aug 17, 2016 at 03:01:07PM +0100, Andrew Cooper wrote:
> > On 17/08/16 13:35, Wei Liu wrote:
> > > diff --git a/include/asm_macros.h b/include/asm_macros.h
> > > new file mode 100644
> > > index 0000000..15dd377
> > > --- /dev/null
> > > +++ b/include/asm_macros.h
> > > @@ -0,0 +1,36 @@
> > > +/*
> > > + * Macros for assembly files.
> > > + */
> > > +
> > > +#ifndef _ASM_MACRO_H_
> > > +#define _ASM_MACRO_H_
> > > +
> > > +#include <x86/asm_macros.h>
> > 
> > This presumably should be <mini-os/arch_asm_macros.h>, and a stub file
> > for ARM ?
> > 
> 
> Don't want to rearrange build system and directory hierarchy just yet.

Oops, I misunderstood. I think your suggestion on arch_asm_macros.h is
sensible.

Wei.

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

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

* Re: [MINIOS PATCH 1/4] gitignore: ignore vim swap file
  2016-08-17 12:51   ` Samuel Thibault
@ 2016-08-18 10:13     ` Wei Liu
  0 siblings, 0 replies; 17+ messages in thread
From: Wei Liu @ 2016-08-18 10:13 UTC (permalink / raw)
  To: Samuel Thibault, Wei Liu, Minios-devel, Xen-devel

On Wed, Aug 17, 2016 at 02:51:21PM +0200, Samuel Thibault wrote:
> Wei Liu, on Wed 17 Aug 2016 13:35:11 +0100, wrote:
> > Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> 
> Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
> 

Pushed this patch to reduce path queue length.

Wei.

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

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

end of thread, other threads:[~2016-08-18 10:13 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-17 12:35 [MINIOS PATCH 0/4] x86: Use ELF notes and unfied linker script Wei Liu
2016-08-17 12:35 ` [MINIOS PATCH 1/4] gitignore: ignore vim swap file Wei Liu
2016-08-17 12:51   ` Samuel Thibault
2016-08-18 10:13     ` Wei Liu
2016-08-17 12:35 ` [MINIOS PATCH 2/4] Introduce asm_macros.h Wei Liu
2016-08-17 12:56   ` Samuel Thibault
2016-08-17 13:40     ` Wei Liu
2016-08-17 13:44       ` Wei Liu
2016-08-17 13:49       ` Andrew Cooper
2016-08-17 14:01   ` Andrew Cooper
2016-08-17 14:03     ` Wei Liu
2016-08-17 14:05       ` Wei Liu
2016-08-17 12:35 ` [MINIOS PATCH 3/4] x86: switch to use elfnote Wei Liu
2016-08-17 14:00   ` [Minios-devel] " Juergen Gross
2016-08-17 12:35 ` [MINIOS PATCH 4/4] x86: use unified linker script Wei Liu
2016-08-17 12:37   ` Wei Liu
2016-08-17 12:52   ` Andrew Cooper

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