{
asm volatile("rep; outsb"
: "+S" (buf), "+c" (len)
- : "d" (0x12));
-}
-
-static void xen_console_write(const char *buf, size_t len)
-{
- hypercall_console_write(buf, len);
+ : "d" (0xe9));
}
void arch_setup(void)
if ( IS_DEFINED(CONFIG_HVM) && !pvh_start_info )
register_console_callback(qemu_console_write);
- register_console_callback(xen_console_write);
-
collect_cpuid(IS_DEFINED(CONFIG_PV) ? pv_cpuid_count : cpuid_count);
sort_extable();
arch_init_traps();
+ return;
+
init_hypercalls();
if ( !is_initdomain() )
build: info.json
info.json: $(ROOT)/build/mkinfo.py Makefile
- $(PYTHON) $< $@ "$(NAME)" "$(CATEGORY)" "$(TEST-ENVS)" "$(VARY-CFG)"
+ @$(PYTHON) $< $@.tmp "$(NAME)" "$(CATEGORY)" "$(filter-out pv%,$(TEST-ENVS))" ""
.PHONY: install install-each-env
install: install-each-env info.json
# hvm64 needs linking normally, then converting to elf32-x86-64 or elf32-i386
test-$(1)-$(NAME): $$(DEPS-$(1)) $$(link-$(1))
$(LD) $$(LDFLAGS_$(1)) $$(DEPS-$(1)) -o $$@.tmp
- $(OBJCOPY) $$@.tmp -O $(hvm64-format) $$@
+ $(OBJCOPY) $$@.tmp -O elf32-i386 $$@
rm -f $$@.tmp
endif
* hypervisor's x86 emulator.
*/
#ifdef __ASSEMBLY__
-#define _ASM_XEN_FEP ud2a; .ascii "xen";
+#define _ASM_XEN_FEP ud2a; .ascii "kvm";
#else
-#define _ASM_XEN_FEP "ud2a; .ascii \"xen\";"
-#define _BIN_XEN_FEP "\x0f\x0bxen"
+#define _ASM_XEN_FEP "ud2a; .ascii \"kvm\";"
+#define _BIN_XEN_FEP "\x0f\x0bkvm"
#endif
#endif /* XEN_PUBLIC_ARCH_X86_XEN_H */
""" Return the VM name as `xl` expects it. """
return repr(self)
+ def vm_path(self):
+ return path.join("tests", self.name, repr(self))
+
def cfg_path(self):
""" Return the path to the `xl` config file for this test. """
- return path.join("tests", self.name, repr(self) + ".cfg")
+ return self.vm_path() + ".cfg"
def __repr__(self):
if not self.variation:
def run_test_console(opts, test):
""" Run a specific, obtaining results via xenconsole """
- cmd = ['xl', 'create', '-p', test.cfg_path()]
- if not opts.quiet:
- print("Executing '{0}'".format(" ".join(cmd)))
+ cmd = ["qemu-system-x86_64",
+ "-nodefaults", "-nographic", "-cpu", "host", "-machine", "accel=kvm",
+ "-debugcon", "stdio",
+ "-device", "isa-debug-exit,iobase=0xf4,iosize=0x4",
+ "-kernel", test.vm_path()]
- create = Popen(cmd, stdout = PIPE, stderr = PIPE)
- _, stderr = create.communicate()
-
- if create.returncode:
- if opts.quiet:
- print("Executing '{0}'".format(" ".join(cmd)))
- print(stderr)
- raise RunnerError("Failed to create VM")
-
- cmd = ['xl', 'console', test.vm_name()]
if not opts.quiet:
print("Executing '{0}'".format(" ".join(cmd)))
- console = Popen(cmd, stdout = PIPE)
-
- cmd = ['xl', 'unpause', test.vm_name()]
- if not opts.quiet:
- print("Executing '{0}'".format(" ".join(cmd)))
-
- rc = subproc_call(cmd)
- if rc:
- if opts.quiet:
- print("Executing '{0}'".format(" ".join(cmd)))
- raise RunnerError("Failed to unpause VM")
-
+ console = Popen(cmd, stdout = PIPE, stderr = PIPE)
stdout, _ = console.communicate()
-
- if console.returncode:
- raise RunnerError("Failed to obtain VM console")
-
lines = stdout.splitlines()
if lines: