Message ID | 1522873962-18156-2-git-send-email-maran.wilson@oracle.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Hi Maran, Thank you for the patch! Yet something to improve: [auto build test ERROR on linus/master] [also build test ERROR on next-20180404] [cannot apply to tip/x86/core xen-tip/linux-next v4.16] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Maran-Wilson/KVM-x86-Allow-Qemu-KVM-to-use-PVH-entry-point/20180405-165048 config: i386-randconfig-x019-201813 (attached as .config) compiler: gcc-7 (Debian 7.3.0-1) 7.3.0 reproduce: # save the attached .config to linux build tree make ARCH=i386 All errors (new ones prefixed by >>): arch/x86/xen/enlighten_pvh.c: In function 'xen_pvh_init': >> arch/x86/xen/enlighten_pvh.c:23:18: error: implicit declaration of function 'xen_cpuid_base'; did you mean 'get_pid_task'? [-Werror=implicit-function-declaration] msr = cpuid_ebx(xen_cpuid_base() + 2); ^~~~~~~~~~~~~~ get_pid_task cc1: some warnings being treated as errors vim +23 arch/x86/xen/enlighten_pvh.c 15 16 void __init xen_pvh_init(void) 17 { 18 u32 msr; 19 u64 pfn; 20 21 xen_pvh = 1; 22 > 23 msr = cpuid_ebx(xen_cpuid_base() + 2); --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
diff --git a/arch/x86/platform/pvh/enlighten.c b/arch/x86/platform/pvh/enlighten.c index 74ff1c3d2789..edcff7de0529 100644 --- a/arch/x86/platform/pvh/enlighten.c +++ b/arch/x86/platform/pvh/enlighten.c @@ -80,26 +80,38 @@ static void __init init_pvh_bootparams(void) x86_init.acpi.get_root_pointer = pvh_get_root_pointer; } +/* + * If we are trying to boot a Xen PVH guest, it is expected that the kernel + * will have been configured to provide the required override for this routine. + */ +void __init __weak xen_pvh_init(void) +{ + xen_raw_printk("Error: Missing xen PVH initialization\n"); + BUG(); +} + +/* + * When we add support for other hypervisors like Qemu/KVM, this routine can + * selectively invoke the appropriate initialization based on guest type. + */ +static void hypervisor_specific_init(void) +{ + xen_pvh_init(); +} + /* * This routine (and those that it might call) should not use * anything that lives in .bss since that segment will be cleared later. */ void __init xen_prepare_pvh(void) { - u32 msr; - u64 pfn; - if (pvh_start_info.magic != XEN_HVM_START_MAGIC_VALUE) { xen_raw_printk("Error: Unexpected magic value (0x%08x)\n", pvh_start_info.magic); BUG(); } - xen_pvh = 1; - - msr = cpuid_ebx(xen_cpuid_base() + 2); - pfn = __pa(hypercall_page); - wrmsr_safe(msr, (u32)pfn, (u32)(pfn >> 32)); + hypervisor_specific_init(); init_pvh_bootparams(); } diff --git a/arch/x86/xen/enlighten_pvh.c b/arch/x86/xen/enlighten_pvh.c index c5409c1f259f..08fc63d14ae5 100644 --- a/arch/x86/xen/enlighten_pvh.c +++ b/arch/x86/xen/enlighten_pvh.c @@ -1,4 +1,9 @@ -#include <linux/types.h> +#include <linux/acpi.h> + +#include <asm/io_apic.h> + +#include <asm/xen/interface.h> +#include <asm/xen/hypercall.h> /* * PVH variables. @@ -8,3 +13,14 @@ */ bool xen_pvh __attribute__((section(".data"))) = 0; +void __init xen_pvh_init(void) +{ + u32 msr; + u64 pfn; + + xen_pvh = 1; + + msr = cpuid_ebx(xen_cpuid_base() + 2); + pfn = __pa(hypercall_page); + wrmsr_safe(msr, (u32)pfn, (u32)(pfn >> 32)); +}