Re: [PATCH v2] KVM: Expose the split lock detection feature to guest VM
From: kbuild test robot
Date: Wed Jul 04 2018 - 19:08:57 EST
Hi Jingqi,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on kvm/linux-next]
[also build test ERROR on v4.18-rc3 next-20180704]
[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/Jingqi-Liu/KVM-Expose-the-split-lock-detection-feature-to-guest-VM/20180705-041612
base: https://git.kernel.org/pub/scm/virt/kvm/kvm.git linux-next
config: x86_64-randconfig-s4-07050438 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-16) 7.3.0
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64
All error/warnings (new ones prefixed by >>):
In file included from arch/x86/include/asm/thread_info.h:53:0,
from include/linux/thread_info.h:38,
from arch/x86/include/asm/preempt.h:7,
from include/linux/preempt.h:81,
from include/linux/hardirq.h:5,
from include/linux/kvm_host.h:10,
from arch/x86/kvm/x86.c:22:
arch/x86/kvm/x86.c: In function 'kvm_vm_ioctl_check_extension':
>> arch/x86/kvm/x86.c:2946:20: error: 'X86_FEATURE_AC_SPLIT_LOCK' undeclared (first use in this function); did you mean 'X86_FEATURE_CAT_L2'?
if (boot_cpu_has(X86_FEATURE_AC_SPLIT_LOCK))
^
arch/x86/include/asm/cpufeature.h:111:24: note: in definition of macro 'cpu_has'
(__builtin_constant_p(bit) && REQUIRED_MASK_BIT_SET(bit) ? 1 : \
^~~
>> arch/x86/kvm/x86.c:2946:7: note: in expansion of macro 'boot_cpu_has'
if (boot_cpu_has(X86_FEATURE_AC_SPLIT_LOCK))
^~~~~~~~~~~~
arch/x86/kvm/x86.c:2946:20: note: each undeclared identifier is reported only once for each function it appears in
if (boot_cpu_has(X86_FEATURE_AC_SPLIT_LOCK))
^
arch/x86/include/asm/cpufeature.h:111:24: note: in definition of macro 'cpu_has'
(__builtin_constant_p(bit) && REQUIRED_MASK_BIT_SET(bit) ? 1 : \
^~~
>> arch/x86/kvm/x86.c:2946:7: note: in expansion of macro 'boot_cpu_has'
if (boot_cpu_has(X86_FEATURE_AC_SPLIT_LOCK))
^~~~~~~~~~~~
vim +2946 arch/x86/kvm/x86.c
2842
2843 int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
2844 {
2845 int r = 0;
2846
2847 switch (ext) {
2848 case KVM_CAP_IRQCHIP:
2849 case KVM_CAP_HLT:
2850 case KVM_CAP_MMU_SHADOW_CACHE_CONTROL:
2851 case KVM_CAP_SET_TSS_ADDR:
2852 case KVM_CAP_EXT_CPUID:
2853 case KVM_CAP_EXT_EMUL_CPUID:
2854 case KVM_CAP_CLOCKSOURCE:
2855 case KVM_CAP_PIT:
2856 case KVM_CAP_NOP_IO_DELAY:
2857 case KVM_CAP_MP_STATE:
2858 case KVM_CAP_SYNC_MMU:
2859 case KVM_CAP_USER_NMI:
2860 case KVM_CAP_REINJECT_CONTROL:
2861 case KVM_CAP_IRQ_INJECT_STATUS:
2862 case KVM_CAP_IOEVENTFD:
2863 case KVM_CAP_IOEVENTFD_NO_LENGTH:
2864 case KVM_CAP_PIT2:
2865 case KVM_CAP_PIT_STATE2:
2866 case KVM_CAP_SET_IDENTITY_MAP_ADDR:
2867 case KVM_CAP_XEN_HVM:
2868 case KVM_CAP_VCPU_EVENTS:
2869 case KVM_CAP_HYPERV:
2870 case KVM_CAP_HYPERV_VAPIC:
2871 case KVM_CAP_HYPERV_SPIN:
2872 case KVM_CAP_HYPERV_SYNIC:
2873 case KVM_CAP_HYPERV_SYNIC2:
2874 case KVM_CAP_HYPERV_VP_INDEX:
2875 case KVM_CAP_HYPERV_EVENTFD:
2876 case KVM_CAP_HYPERV_TLBFLUSH:
2877 case KVM_CAP_PCI_SEGMENT:
2878 case KVM_CAP_DEBUGREGS:
2879 case KVM_CAP_X86_ROBUST_SINGLESTEP:
2880 case KVM_CAP_XSAVE:
2881 case KVM_CAP_ASYNC_PF:
2882 case KVM_CAP_GET_TSC_KHZ:
2883 case KVM_CAP_KVMCLOCK_CTRL:
2884 case KVM_CAP_READONLY_MEM:
2885 case KVM_CAP_HYPERV_TIME:
2886 case KVM_CAP_IOAPIC_POLARITY_IGNORED:
2887 case KVM_CAP_TSC_DEADLINE_TIMER:
2888 case KVM_CAP_ENABLE_CAP_VM:
2889 case KVM_CAP_DISABLE_QUIRKS:
2890 case KVM_CAP_SET_BOOT_CPU_ID:
2891 case KVM_CAP_SPLIT_IRQCHIP:
2892 case KVM_CAP_IMMEDIATE_EXIT:
2893 case KVM_CAP_GET_MSR_FEATURES:
2894 r = 1;
2895 break;
2896 case KVM_CAP_SYNC_REGS:
2897 r = KVM_SYNC_X86_VALID_FIELDS;
2898 break;
2899 case KVM_CAP_ADJUST_CLOCK:
2900 r = KVM_CLOCK_TSC_STABLE;
2901 break;
2902 case KVM_CAP_X86_DISABLE_EXITS:
2903 r |= KVM_X86_DISABLE_EXITS_HLT | KVM_X86_DISABLE_EXITS_PAUSE;
2904 if(kvm_can_mwait_in_guest())
2905 r |= KVM_X86_DISABLE_EXITS_MWAIT;
2906 break;
2907 case KVM_CAP_X86_SMM:
2908 /* SMBASE is usually relocated above 1M on modern chipsets,
2909 * and SMM handlers might indeed rely on 4G segment limits,
2910 * so do not report SMM to be available if real mode is
2911 * emulated via vm86 mode. Still, do not go to great lengths
2912 * to avoid userspace's usage of the feature, because it is a
2913 * fringe case that is not enabled except via specific settings
2914 * of the module parameters.
2915 */
2916 r = kvm_x86_ops->has_emulated_msr(MSR_IA32_SMBASE);
2917 break;
2918 case KVM_CAP_VAPIC:
2919 r = !kvm_x86_ops->cpu_has_accelerated_tpr();
2920 break;
2921 case KVM_CAP_NR_VCPUS:
2922 r = KVM_SOFT_MAX_VCPUS;
2923 break;
2924 case KVM_CAP_MAX_VCPUS:
2925 r = KVM_MAX_VCPUS;
2926 break;
2927 case KVM_CAP_NR_MEMSLOTS:
2928 r = KVM_USER_MEM_SLOTS;
2929 break;
2930 case KVM_CAP_PV_MMU: /* obsolete */
2931 r = 0;
2932 break;
2933 case KVM_CAP_MCE:
2934 r = KVM_MAX_MCE_BANKS;
2935 break;
2936 case KVM_CAP_XCRS:
2937 r = boot_cpu_has(X86_FEATURE_XSAVE);
2938 break;
2939 case KVM_CAP_TSC_CONTROL:
2940 r = kvm_has_tsc_control;
2941 break;
2942 case KVM_CAP_X2APIC_API:
2943 r = KVM_X2APIC_API_VALID_FLAGS;
2944 break;
2945 case KVM_CAP_X86_SPLIT_LOCK_AC:
> 2946 if (boot_cpu_has(X86_FEATURE_AC_SPLIT_LOCK))
2947 r = 1;
2948 else
2949 r = 0;
2950 break;
2951 default:
2952 break;
2953 }
2954 return r;
2955
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: application/gzip