Skip to contentSkip to conversation

mini-os: test and document config variations

PATCH In review Juergen Gross 3 participants 9 messages Sep 2, 2016 – Sep 5, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover mini-os: test and document config variations

Add a "testbuild" target to Makefile which builds various configurations. Repair some minor issues uncovered by those test builds. Document the config framework.

Juergen Gross (3):
mini-os: fix builds with uncommon config settings
mini-os: add testbuild target to Makefile
mini-os: update README to reflect recent changes

 Makefile                      | 10 ++++++++++
 README                        | 31 +++++++++++++++++++++++++++++++
 arch/x86/arch.mk              |  2 ++
 arch/x86/testbuild/all-no     | 18 ++++++++++++++++++
 arch/x86/testbuild/all-yes    | 19 +++++++++++++++++++
 arch/x86/testbuild/balloon    |  2 ++
 arch/x86/testbuild/newxen     |  1 +
 arch/x86/testbuild/newxen-yes | 20 ++++++++++++++++++++
 arch/x86/testbuild/std        |  0
 include/x86/os.h              |  5 +++++
 include/xenbus.h              |  6 ++++--
 11 files changed, 112 insertions(+), 2 deletions(-)
 create mode 100644 arch/x86/testbuild/all-no
 create mode 100644 arch/x86/testbuild/all-yes
 create mode 100644 arch/x86/testbuild/balloon
 create mode 100644 arch/x86/testbuild/newxen
 create mode 100644 arch/x86/testbuild/newxen-yes
 create mode 100644 arch/x86/testbuild/std
Signature · 7 lines
2.6.6


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#1 lore raw

PATCH 1/3 mini-os: fix builds with uncommon config settings

Some config settings won't build standalone. Fix the following cases:

- all CONFIG_* set to "n"
- standard config with latest Xen interface version

---
 include/x86/os.h | 5 +++++
 include/xenbus.h | 6 ++++--
 2 files changed, 9 insertions(+), 2 deletions(-)
include/x86/os.h +5 -0
index 90ab6e6..0f5dd6c 100644
@@ -514,6 +514,11 @@ static __inline__ unsigned long __ffs(unsigned long word)
 #endif /* ifdef __INSIDE_MINIOS */
 
 /********************* common i386 and x86_64  ****************************/
+#define xen_mb()  mb()
+#define xen_rmb() rmb()
+#define xen_wmb() wmb()
+#define xen_barrier() asm volatile ( "" : : : "memory")
+
 #define wrmsr(msr,val1,val2) \
       __asm__ __volatile__("wrmsr" \
                            : /* no outputs */ \
include/xenbus.h +4 -2
index c254652..12391b9 100644
@@ -7,10 +7,14 @@ typedef unsigned long xenbus_transaction_t;
 #define XBT_NIL ((xenbus_transaction_t)0)
 
 #ifdef CONFIG_XENBUS
+extern uint32_t xenbus_evtchn;
+
 /* Initialize the XenBus system. */
 void init_xenbus(void);
 void get_xenbus(void *p);
 #else
+#define xenbus_evtchn ~0
+
 static inline void init_xenbus(void)
 {
 }
@@ -33,8 +37,6 @@ struct xenbus_event {
 };
 typedef struct xenbus_event *xenbus_event_queue;
 
-extern uint32_t xenbus_evtchn;
-
 char *xenbus_watch_path_token(xenbus_transaction_t xbt, const char *path, const char *token, xenbus_event_queue *events);
 char *xenbus_unwatch_path_token(xenbus_transaction_t xbt, const char *path, const char *token);
 extern struct wait_queue_head xenbus_watch_queue;
Signature · 7 lines
2.6.6


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#3 lore raw

PATCH 2/3 mini-os: add testbuild target to Makefile

In reply to Juergen Gross

Add a "testbuild" target to the Makefile to test building a set of pre-defined configurations.

Configurations tested are stored under arch/<arch>/testbuild in form of configuration files. All configurations found there are built in a local directory.

---
 Makefile                      | 10 ++++++++++
 arch/x86/arch.mk              |  2 ++
 arch/x86/testbuild/all-no     | 18 ++++++++++++++++++
 arch/x86/testbuild/all-yes    | 19 +++++++++++++++++++
 arch/x86/testbuild/balloon    |  2 ++
 arch/x86/testbuild/newxen     |  1 +
 arch/x86/testbuild/newxen-yes | 20 ++++++++++++++++++++
 arch/x86/testbuild/std        |  0
 8 files changed, 72 insertions(+)
 create mode 100644 arch/x86/testbuild/all-no
 create mode 100644 arch/x86/testbuild/all-yes
 create mode 100644 arch/x86/testbuild/balloon
 create mode 100644 arch/x86/testbuild/newxen
 create mode 100644 arch/x86/testbuild/newxen-yes
 create mode 100644 arch/x86/testbuild/std
Makefile +10 -0
index 8e8e56e..81b936f 100644
@@ -178,6 +178,16 @@ clean:	arch_clean
 	$(RM) $(OBJ_DIR)/lwip.a $(LWO)
 	rm -f tags TAGS
 
+.PHONY: testbuild
+TEST_CONFIGS := $(wildcard $(CURDIR)/$(TARGET_ARCH_DIR)/testbuild/*)
+testbuild:
+	for arch in $(MINIOS_TARGET_ARCHS); do \
+		for conf in $(TEST_CONFIGS); do \
+			$(MAKE) clean; \
+			MINIOS_TARGET_ARCH=$$arch MINIOS_CONFIG=$$conf $(MAKE) || exit 1; \
+		done; \
+	done
+	$(MAKE) clean
 
 define all_sources
      ( find . -name '*.[chS]' -print )
arch/x86/arch.mk +2 -0
index 673a19d..c87885f 100644
@@ -3,6 +3,8 @@
 # (including x86_32, x86_32y and x86_64).
 #
 
+MINIOS_TARGET_ARCHS := x86_32 x86_64
+
 ifeq ($(MINIOS_TARGET_ARCH),x86_32)
 ARCH_CFLAGS  := -m32 -march=i686
 ARCH_LDFLAGS := -m elf_i386
arch/x86/testbuild/all-no new file +18 -0
new file mode 100644
index 0000000..78720c3
@@ -0,0 +1,18 @@
+CONFIG_PARAVIRT = n
+CONFIG_START_NETWORK = n
+CONFIG_SPARSE_BSS = n
+CONFIG_QEMU_XS_ARGS = n
+CONFIG_TEST = n
+CONFIG_PCIFRONT = n
+CONFIG_BLKFRONT = n
+CONFIG_TPMFRONT = n
+CONFIG_TPM_TIS = n
+CONFIG_TPMBACK = n
+CONFIG_NETFRONT = n
+CONFIG_FBFRONT = n
+CONFIG_KBDFRONT = n
+CONFIG_CONSFRONT = n
+CONFIG_XENBUS = n
+CONFIG_XC = n
+CONFIG_LWIP = n
+CONFIG_BALLOON = n
arch/x86/testbuild/all-yes new file +19 -0
new file mode 100644
index 0000000..303c56b
@@ -0,0 +1,19 @@
+CONFIG_PARAVIRT = y
+CONFIG_START_NETWORK = y
+CONFIG_SPARSE_BSS = y
+CONFIG_QEMU_XS_ARGS = y
+CONFIG_TEST = y
+CONFIG_PCIFRONT = y
+CONFIG_BLKFRONT = y
+CONFIG_TPMFRONT = y
+CONFIG_TPM_TIS = y
+CONFIG_TPMBACK = y
+CONFIG_NETFRONT = y
+CONFIG_FBFRONT = y
+CONFIG_KBDFRONT = y
+CONFIG_CONSFRONT = y
+CONFIG_XENBUS = y
+CONFIG_XC = y
+# LWIP is special: it needs support from outside
+CONFIG_LWIP = n
+CONFIG_BALLOON = y
arch/x86/testbuild/balloon new file +2 -0
new file mode 100644
index 0000000..6fa5eef
@@ -0,0 +1,2 @@
+CONFIG_PARAVIRT = n
+CONFIG_BALLOON = y
arch/x86/testbuild/newxen new file +1 -0
new file mode 100644
index 0000000..b412924
@@ -0,0 +1 @@
+XEN_INTERFACE_VERSION=__XEN_LATEST_INTERFACE_VERSION__
arch/x86/testbuild/newxen-yes new file +20 -0
new file mode 100644
index 0000000..907a8a0
@@ -0,0 +1,20 @@
+CONFIG_PARAVIRT = y
+CONFIG_START_NETWORK = y
+CONFIG_SPARSE_BSS = y
+CONFIG_QEMU_XS_ARGS = y
+CONFIG_TEST = y
+CONFIG_PCIFRONT = y
+CONFIG_BLKFRONT = y
+CONFIG_TPMFRONT = y
+CONFIG_TPM_TIS = y
+CONFIG_TPMBACK = y
+CONFIG_NETFRONT = y
+CONFIG_FBFRONT = y
+CONFIG_KBDFRONT = y
+CONFIG_CONSFRONT = y
+CONFIG_XENBUS = y
+CONFIG_XC = y
+# LWIP is special: it needs support from outside
+CONFIG_LWIP = n
+CONFIG_BALLOON = y
+XEN_INTERFACE_VERSION=__XEN_LATEST_INTERFACE_VERSION__
arch/x86/testbuild/std new file +0 -0
new file mode 100644
index 0000000..e69de29
Signature · 7 lines
2.6.6


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#6 lore raw

PATCH 3/3 mini-os: update README to reflect recent changes

In reply to Juergen Gross

Add some notes to README regarding configuration of Mini-OS via config files.

---
 README | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
README +31 -0
index 7e9c07a..abd8440 100644
@@ -19,6 +19,37 @@ This includes:
 
 - to build it just type make.
 
+- Mini-OS can be configured in various ways by specifying a config file:
+
+  MINIOS_CONFIG=config-file make
+
+  config-file can contain various CONFIG_* items set to either "y" or "n".
+  Their defaults can be found in Config.mk.
+  It is possible to specify the interface version of Xen via setting
+
+  XEN_INTERFACE_VERSION=<version>
+
+  in the config file. This defaults to 0x00030205, which is the minimal
+  version supported. The latest available version is specified by setting
+
+  XEN_INTERFACE_VERSION=__XEN_LATEST_INTERFACE_VERSION__
+
+- By typing
+
+  make testbuild
+
+  it is possible to test builds of various configurations. This should be
+  done always after modifying Mini-OS.
+
+  The configurations which are build tested can be found in the directory
+  arch/*/testbuild with one file per configuration. Those configurations are
+  being built for each sub-architecture (e.g. x86_32 and x86_64 for the
+  x86 architecture).
+
+  Please update the current configuration files when adding a new CONFIG_
+  item and maybe even add a new configuration file if the new item interacts
+  with other CONFIG_ items.
+
 - to build it with TCP/IP support, download LWIP 1.3.2 source code and type
 
   make LWIPDIR=/path/to/lwip/source
Signature · 7 lines
2.6.6


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Reviewed-by on v1 1/3
#2 lore raw

Re: [PATCH 1/3] mini-os: fix builds with uncommon config settings

In reply to Juergen Gross
Quoted 6 lines · Juergen Gross, on Fri 02 Sep 2016 10:56:45 +0200, wrote:

Some config settings won't build standalone. Fix the following cases:

- all CONFIG_* set to "n"
- standard config with latest Xen interface version

Quoted 52 lines
---
 include/x86/os.h | 5 +++++
 include/xenbus.h | 6 ++++--
 2 files changed, 9 insertions(+), 2 deletions(-)
include/x86/os.h +5 -0
index 90ab6e6..0f5dd6c 100644
@@ -514,6 +514,11 @@ static __inline__ unsigned long __ffs(unsigned long word)
 #endif /* ifdef __INSIDE_MINIOS */
 
 /********************* common i386 and x86_64  ****************************/
+#define xen_mb()  mb()
+#define xen_rmb() rmb()
+#define xen_wmb() wmb()
+#define xen_barrier() asm volatile ( "" : : : "memory")
+
 #define wrmsr(msr,val1,val2) \
       __asm__ __volatile__("wrmsr" \
                            : /* no outputs */ \
include/xenbus.h +4 -2
index c254652..12391b9 100644
@@ -7,10 +7,14 @@ typedef unsigned long xenbus_transaction_t;
 #define XBT_NIL ((xenbus_transaction_t)0)
 
 #ifdef CONFIG_XENBUS
+extern uint32_t xenbus_evtchn;
+
 /* Initialize the XenBus system. */
 void init_xenbus(void);
 void get_xenbus(void *p);
 #else
+#define xenbus_evtchn ~0
+
 static inline void init_xenbus(void)
 {
 }
@@ -33,8 +37,6 @@ struct xenbus_event {
 };
 typedef struct xenbus_event *xenbus_event_queue;
 
-extern uint32_t xenbus_evtchn;
-
 char *xenbus_watch_path_token(xenbus_transaction_t xbt, const char *path, const char *token, xenbus_event_queue *events);
 char *xenbus_unwatch_path_token(xenbus_transaction_t xbt, const char *path, const char *token);
 extern struct wait_queue_head xenbus_watch_queue;
Signature · 1 line
2.6.6
Signature · 10 lines
Samuel
(03:13:14) <j> bon
(03:13:19) <j> il est tard :p
(03:13:25) <g> c'est l'heure de manger
(03:13:38) <j> hm j'ai mangé à 1h moi, j'ai des horaires raisonnables

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Reviewed-by on v1 2/3
#4 lore raw

Re: [PATCH 2/3] mini-os: add testbuild target to Makefile

In reply to Juergen Gross
Quoted 6 lines · Juergen Gross, on Fri 02 Sep 2016 10:56:46 +0200, wrote:

Add a "testbuild" target to the Makefile to test building a set of pre-defined configurations.

Configurations tested are stored under arch/<arch>/testbuild in form of configuration files. All configurations found there are built in a local directory.

Please also document just above the CONFIG_* lines in Config.mk that new CONFIG options should be set in all-* testbuilds.

Quoted 1 line

Samuel

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

Reviewed-by on v1 3/3
#7 lore raw

Re: [PATCH 3/3] mini-os: update README to reflect recent changes

In reply to Juergen Gross
Quoted 4 lines · Juergen Gross, on Fri 02 Sep 2016 10:56:47 +0200, wrote:

Add some notes to README regarding configuration of Mini-OS via config files.

README This includes: · line 51

Quoted 3 lines
README +3 -0
+  Please update the current configuration files when adding a new CONFIG_
+  item and maybe even add a new configuration file if the new item interacts
+  with other CONFIG_ items.

This is useful for documentation here, but a reminder in Config.mk is probably a very welcome thing :)

Samuel

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#5 lore raw

Re: [PATCH 2/3] mini-os: add testbuild target to Makefile

In reply to Samuel Thibault
Quoted 10 lines · Samuel Thibault
Quoted 6 lines · Juergen Gross, on Fri 02 Sep 2016 10:56:46 +0200, wrote:

Add a "testbuild" target to the Makefile to test building a set of pre-defined configurations.

Configurations tested are stored under arch/<arch>/testbuild in form of configuration files. All configurations found there are built in a local directory.

Please also document just above the CONFIG_* lines in Config.mk that new CONFIG options should be set in all-* testbuilds.

Okay, will do.

Quoted 4 lines
Quoted 2 lines

Thanks,

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#8 lore raw
In reply to Juergen Gross
Quoted 9 lines · Juergen Gross

Add a "testbuild" target to Makefile which builds various configurations. Repair some minor issues uncovered by those test builds. Document the config framework.

Juergen Gross (3):
mini-os: fix builds with uncommon config settings
mini-os: add testbuild target to Makefile
mini-os: update README to reflect recent changes

Series pushed. Thank you both.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel