Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 platform updayes from Ingo Molnar:
"Most of the commits add ACRN hypervisor guest support, plus two
cleanups"

* 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/jailhouse: Mark jailhouse_x2apic_available() as __init
x86/platform/geode: Drop <linux/gpio.h> includes
x86/acrn: Use HYPERVISOR_CALLBACK_VECTOR for ACRN guest upcall vector
x86: Add support for Linux guests on an ACRN hypervisor
x86/Kconfig: Add new X86_HV_CALLBACK_VECTOR config symbol

+110 -6
+14
arch/x86/Kconfig
··· 785 785 786 786 If you are unsure how to answer this question, answer Y. 787 787 788 + config X86_HV_CALLBACK_VECTOR 789 + def_bool n 790 + 788 791 source "arch/x86/xen/Kconfig" 789 792 790 793 config KVM_GUEST ··· 838 835 This option allows to run Linux as guest in a Jailhouse non-root 839 836 cell. You can leave this option disabled if you only want to start 840 837 Jailhouse and run Linux afterwards in the root cell. 838 + 839 + config ACRN_GUEST 840 + bool "ACRN Guest support" 841 + depends on X86_64 842 + select X86_HV_CALLBACK_VECTOR 843 + help 844 + This option allows to run Linux as guest in the ACRN hypervisor. ACRN is 845 + a flexible, lightweight reference open-source hypervisor, built with 846 + real-time and safety-criticality in mind. It is built for embedded 847 + IOT with small footprint and real-time features. More details can be 848 + found in https://projectacrn.org/. 841 849 842 850 endif #HYPERVISOR_GUEST 843 851
+5
arch/x86/entry/entry_64.S
··· 1164 1164 hv_stimer0_callback_vector hv_stimer0_vector_handler 1165 1165 #endif /* CONFIG_HYPERV */ 1166 1166 1167 + #if IS_ENABLED(CONFIG_ACRN_GUEST) 1168 + apicinterrupt3 HYPERVISOR_CALLBACK_VECTOR \ 1169 + acrn_hv_callback_vector acrn_hv_vector_handler 1170 + #endif 1171 + 1167 1172 idtentry debug do_debug has_error_code=0 paranoid=1 shift_ist=IST_INDEX_DB ist_offset=DB_STACK_OFFSET 1168 1173 idtentry int3 do_int3 has_error_code=0 create_gap=1 1169 1174 idtentry stack_segment do_stack_segment has_error_code=1
+11
arch/x86/include/asm/acrn.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + #ifndef _ASM_X86_ACRN_H 3 + #define _ASM_X86_ACRN_H 4 + 5 + extern void acrn_hv_callback_vector(void); 6 + #ifdef CONFIG_TRACING 7 + #define trace_acrn_hv_callback_vector acrn_hv_callback_vector 8 + #endif 9 + 10 + extern void acrn_hv_vector_handler(struct pt_regs *regs); 11 + #endif /* _ASM_X86_ACRN_H */
+1 -1
arch/x86/include/asm/hardirq.h
··· 37 37 #ifdef CONFIG_X86_MCE_AMD 38 38 unsigned int irq_deferred_error_count; 39 39 #endif 40 - #if IS_ENABLED(CONFIG_HYPERV) || defined(CONFIG_XEN) 40 + #ifdef CONFIG_X86_HV_CALLBACK_VECTOR 41 41 unsigned int irq_hv_callback_count; 42 42 #endif 43 43 #if IS_ENABLED(CONFIG_HYPERV)
+1
arch/x86/include/asm/hypervisor.h
··· 29 29 X86_HYPER_XEN_HVM, 30 30 X86_HYPER_KVM, 31 31 X86_HYPER_JAILHOUSE, 32 + X86_HYPER_ACRN, 32 33 }; 33 34 34 35 #ifdef CONFIG_HYPERVISOR_GUEST
+1
arch/x86/kernel/cpu/Makefile
··· 49 49 obj-$(CONFIG_X86_LOCAL_APIC) += perfctr-watchdog.o 50 50 51 51 obj-$(CONFIG_HYPERVISOR_GUEST) += vmware.o hypervisor.o mshyperv.o 52 + obj-$(CONFIG_ACRN_GUEST) += acrn.o 52 53 53 54 ifdef CONFIG_X86_FEATURE_NAMES 54 55 quiet_cmd_mkcapflags = MKCAP $@
+69
arch/x86/kernel/cpu/acrn.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * ACRN detection support 4 + * 5 + * Copyright (C) 2019 Intel Corporation. All rights reserved. 6 + * 7 + * Jason Chen CJ <jason.cj.chen@intel.com> 8 + * Zhao Yakui <yakui.zhao@intel.com> 9 + * 10 + */ 11 + 12 + #include <linux/interrupt.h> 13 + #include <asm/acrn.h> 14 + #include <asm/apic.h> 15 + #include <asm/desc.h> 16 + #include <asm/hypervisor.h> 17 + #include <asm/irq_regs.h> 18 + 19 + static uint32_t __init acrn_detect(void) 20 + { 21 + return hypervisor_cpuid_base("ACRNACRNACRN\0\0", 0); 22 + } 23 + 24 + static void __init acrn_init_platform(void) 25 + { 26 + /* Setup the IDT for ACRN hypervisor callback */ 27 + alloc_intr_gate(HYPERVISOR_CALLBACK_VECTOR, acrn_hv_callback_vector); 28 + } 29 + 30 + static bool acrn_x2apic_available(void) 31 + { 32 + /* 33 + * x2apic is not supported for now. Future enablement will have to check 34 + * X86_FEATURE_X2APIC to determine whether x2apic is supported in the 35 + * guest. 36 + */ 37 + return false; 38 + } 39 + 40 + static void (*acrn_intr_handler)(void); 41 + 42 + __visible void __irq_entry acrn_hv_vector_handler(struct pt_regs *regs) 43 + { 44 + struct pt_regs *old_regs = set_irq_regs(regs); 45 + 46 + /* 47 + * The hypervisor requires that the APIC EOI should be acked. 48 + * If the APIC EOI is not acked, the APIC ISR bit for the 49 + * HYPERVISOR_CALLBACK_VECTOR will not be cleared and then it 50 + * will block the interrupt whose vector is lower than 51 + * HYPERVISOR_CALLBACK_VECTOR. 52 + */ 53 + entering_ack_irq(); 54 + inc_irq_stat(irq_hv_callback_count); 55 + 56 + if (acrn_intr_handler) 57 + acrn_intr_handler(); 58 + 59 + exiting_irq(); 60 + set_irq_regs(old_regs); 61 + } 62 + 63 + const __initconst struct hypervisor_x86 x86_hyper_acrn = { 64 + .name = "ACRN", 65 + .detect = acrn_detect, 66 + .type = X86_HYPER_ACRN, 67 + .init.init_platform = acrn_init_platform, 68 + .init.x2apic_available = acrn_x2apic_available, 69 + };
+4
arch/x86/kernel/cpu/hypervisor.c
··· 32 32 extern const struct hypervisor_x86 x86_hyper_xen_hvm; 33 33 extern const struct hypervisor_x86 x86_hyper_kvm; 34 34 extern const struct hypervisor_x86 x86_hyper_jailhouse; 35 + extern const struct hypervisor_x86 x86_hyper_acrn; 35 36 36 37 static const __initconst struct hypervisor_x86 * const hypervisors[] = 37 38 { ··· 49 48 #endif 50 49 #ifdef CONFIG_JAILHOUSE_GUEST 51 50 &x86_hyper_jailhouse, 51 + #endif 52 + #ifdef CONFIG_ACRN_GUEST 53 + &x86_hyper_acrn, 52 54 #endif 53 55 }; 54 56
+1 -1
arch/x86/kernel/irq.c
··· 135 135 seq_printf(p, "%10u ", per_cpu(mce_poll_count, j)); 136 136 seq_puts(p, " Machine check polls\n"); 137 137 #endif 138 - #if IS_ENABLED(CONFIG_HYPERV) || defined(CONFIG_XEN) 138 + #ifdef CONFIG_X86_HV_CALLBACK_VECTOR 139 139 if (test_bit(HYPERVISOR_CALLBACK_VECTOR, system_vectors)) { 140 140 seq_printf(p, "%*s: ", prec, "HYP"); 141 141 for_each_online_cpu(j)
+1 -1
arch/x86/kernel/jailhouse.c
··· 203 203 return jailhouse_cpuid_base() != 0; 204 204 } 205 205 206 - static bool jailhouse_x2apic_available(void) 206 + static bool __init jailhouse_x2apic_available(void) 207 207 { 208 208 /* 209 209 * The x2APIC is only available if the root cell enabled it. Jailhouse
-1
arch/x86/platform/geode/alix.c
··· 20 20 #include <linux/moduleparam.h> 21 21 #include <linux/leds.h> 22 22 #include <linux/platform_device.h> 23 - #include <linux/gpio.h> 24 23 #include <linux/input.h> 25 24 #include <linux/gpio_keys.h> 26 25 #include <linux/dmi.h>
-1
arch/x86/platform/geode/geos.c
··· 18 18 #include <linux/string.h> 19 19 #include <linux/leds.h> 20 20 #include <linux/platform_device.h> 21 - #include <linux/gpio.h> 22 21 #include <linux/input.h> 23 22 #include <linux/gpio_keys.h> 24 23 #include <linux/dmi.h>
-1
arch/x86/platform/geode/net5501.c
··· 18 18 #include <linux/string.h> 19 19 #include <linux/leds.h> 20 20 #include <linux/platform_device.h> 21 - #include <linux/gpio.h> 22 21 #include <linux/input.h> 23 22 #include <linux/gpio_keys.h> 24 23
+1
arch/x86/xen/Kconfig
··· 7 7 bool "Xen guest support" 8 8 depends on PARAVIRT 9 9 select PARAVIRT_CLOCK 10 + select X86_HV_CALLBACK_VECTOR 10 11 depends on X86_64 || (X86_32 && X86_PAE) 11 12 depends on X86_LOCAL_APIC && X86_TSC 12 13 help
+1
drivers/hv/Kconfig
··· 6 6 tristate "Microsoft Hyper-V client drivers" 7 7 depends on X86 && ACPI && X86_LOCAL_APIC && HYPERVISOR_GUEST 8 8 select PARAVIRT 9 + select X86_HV_CALLBACK_VECTOR 9 10 help 10 11 Select this option to run Linux as a Hyper-V client operating 11 12 system.