From: Andrew Cooper Date: Mon, 18 Jan 2016 10:48:56 +0000 (+0000) Subject: Implement the hvm32 environment; a 32bit HVM guest without paging X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=f571b0b;p=people%2Froyger%2Fxen-test-framework.git Implement the hvm32 environment; a 32bit HVM guest without paging The test_NULL_unmapped() selftest is not applicable in an unpaged environment, so is made conditional. Signed-off-by: Andrew Cooper --- diff --git a/build/common.mk b/build/common.mk index a0f3c71..cd49582 100644 --- a/build/common.mk +++ b/build/common.mk @@ -2,7 +2,7 @@ ROOT := $(abspath $(CURDIR)/../..) DESTDIR ?= $(ROOT)/dist/ CC = gcc -ALL_ENVIRONMENTS := pv64 pv32pae hvm64 hvm32pae +ALL_ENVIRONMENTS := pv64 pv32pae hvm64 hvm32pae hvm32 PV_ENVIRONMENTS := $(filter pv%,$(ALL_ENVIRONMENTS)) HVM_ENVIRONMENTS := $(filter hvm%,$(ALL_ENVIRONMENTS)) @@ -13,6 +13,7 @@ pv64_arch := x86_64 pv32pae_arch := x86_32 hvm64_arch := x86_64 hvm32pae_arch := x86_32 +hvm32_arch := x86_32 COMMON_FLAGS := -pipe -I$(ROOT)/include -MMD -MP @@ -33,6 +34,7 @@ head-pv64 := $(ROOT)/arch/x86/boot/head_pv64.o head-pv32pae := $(ROOT)/arch/x86/boot/head_pv32pae.o head-hvm64 := $(ROOT)/arch/x86/boot/head_hvm64.o head-hvm32pae := $(ROOT)/arch/x86/boot/head_hvm32pae.o +head-hvm32 := $(ROOT)/arch/x86/boot/head_hvm32.o defcfg-pv := $(ROOT)/config/default-pv.cfg.in defcfg-hvm := $(ROOT)/config/default-hvm.cfg.in @@ -41,6 +43,7 @@ defcfg-pv64 := $(defcfg-pv) defcfg-pv32pae := $(defcfg-pv) defcfg-hvm64 := $(defcfg-hvm) defcfg-hvm32pae := $(defcfg-hvm) +defcfg-hvm32 := $(defcfg-hvm) obj-perarch := obj-perenv := diff --git a/docs/mainpage.dox b/docs/mainpage.dox index c099ae3..de7e211 100644 --- a/docs/mainpage.dox +++ b/docs/mainpage.dox @@ -22,10 +22,11 @@ Environment | Guest | Width | Paging :-----------|:------|:------|:--------- `pv32pae` | PV | 32bit | PAE `pv64` | PV | 64bit | Long mode +`hvm32` | HVM | 32bit | None `hvm32pae` | HVM | 32bit | PAE `hvm64` | HVM | 64bit | Long mode -@todo Possibly implement `hvm32`, `hvm32pg`, `hvm32pse` and `hvm16`. +@todo Possibly implement `hvm32pg`, `hvm32pse` and `hvm16`. @section getting-started Getting Started diff --git a/include/arch/x86/config.h b/include/arch/x86/config.h index 48bdf30..e251944 100644 --- a/include/arch/x86/config.h +++ b/include/arch/x86/config.h @@ -48,6 +48,14 @@ #undef CONFIG_ENV_hvm32pae +#elif defined(CONFIG_ENV_hvm32) + +#define CONFIG_HVM +#define CONFIG_PAGING_LEVELS 0 +#define ENVIRONMENT_DESCRIPTION "HVM 32bit (No paging)" + +#undef CONFIG_ENV_hvm32 + #else # error Bad environment #endif diff --git a/tests/selftest/main.c b/tests/selftest/main.c index fc917a6..0440b79 100644 --- a/tests/selftest/main.c +++ b/tests/selftest/main.c @@ -172,6 +172,7 @@ static void test_exec_user(void) } } +#ifdef CONFIG_PAGING static void test_NULL_unmapped(void) { extern unsigned long label_test_NULL_unmapped[]; @@ -192,6 +193,7 @@ static void test_NULL_unmapped(void) xtf_exlog_stop(); } +#endif static bool local_unhandled_exception_hook(struct cpu_regs *regs) { @@ -228,7 +230,9 @@ void test_main(void) test_extable(); test_exlog(); test_exec_user(); +#ifdef CONFIG_PAGING test_NULL_unmapped(); +#endif test_unhandled_exception_hook(); xtf_success();