Re: [PATCH 5/5] hyperv: Use hvhdk.h instead of hyperv-tlfs.h in Hyper-V code

kernel test robot
2024-10-05T01:54:56Z

Hi Nuno,

kernel test robot noticed the following build errors:

[auto build test ERROR on tip/x86/core]
[also build test ERROR on arm64/for-next/core kvm/queue linus/master v6.12-rc1 next-20241004]
[cannot apply to kvm/linux-next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Nuno-Das-Neves/hyperv-Move-hv_connection_id-to-hyperv-tlfs-h/20241004-035418
base: tip/x86/core
patch link: https://lore.kernel.org/r/1727985064-18362-6-git-send-email-nunodasneves%40linux.microsoft.com
patch subject: [PATCH 5/5] hyperv: Use hvhdk.h instead of hyperv-tlfs.h in Hyper-V code
config: arm64-allmodconfig (https://download.01.org/0day-ci/archive/20241005/202410050921.0o9FH5Ai-lkp@intel.com/config)
compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project fef3566a25ff0e34fb87339ba5e13eca17cec00f)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241005/202410050921.0o9FH5Ai-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202410050921.0o9FH5Ai-lkp@intel.com/

All errors (new ones prefixed by >>):

In file included from arch/arm64/hyperv/mshyperv.c:13:
In file included from include/linux/acpi.h:39:
In file included from include/acpi/acpi_io.h:7:
In file included from arch/arm64/include/asm/acpi.h:14:
In file included from include/linux/memblock.h:12:
In file included from include/linux/mm.h:2228:
include/linux/vmstat.h:500:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
500 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
501 | item];
| ~~~~
include/linux/vmstat.h:507:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
507 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
508 | NR_VM_NUMA_EVENT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~~
include/linux/vmstat.h:514:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
514 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
| ~~~~~~~~~~~ ^ ~~~
include/linux/vmstat.h:519:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
519 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
520 | NR_VM_NUMA_EVENT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~~
include/linux/vmstat.h:528:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
528 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
529 | NR_VM_NUMA_EVENT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~~
>> arch/arm64/hyperv/mshyperv.c:53:19: error: use of undeclared identifier 'HV_REGISTER_FEATURES'; did you mean 'HV_REGISTER_FEATURES_INFO'?
53 | hv_get_vpreg_128(HV_REGISTER_FEATURES, &result);
| ^~~~~~~~~~~~~~~~~~~~
| HV_REGISTER_FEATURES_INFO
include/hyperv/hvgdk_mini.h:807:2: note: 'HV_REGISTER_FEATURES_INFO' declared here
807 | HV_REGISTER_FEATURES_INFO = 0x00000201,
| ^
>> arch/arm64/hyperv/mshyperv.c:58:19: error: use of undeclared identifier 'HV_REGISTER_ENLIGHTENMENTS'
58 | hv_get_vpreg_128(HV_REGISTER_ENLIGHTENMENTS, &result);
| ^
5 warnings and 2 errors generated.

vim +53 arch/arm64/hyperv/mshyperv.c

410779d8d81fcf Nuno Das Neves 2024-03-07 30
9bbb888824e38c Michael Kelley 2021-08-04 31 static int __init hyperv_init(void)
9bbb888824e38c Michael Kelley 2021-08-04 32 {
9bbb888824e38c Michael Kelley 2021-08-04 33 struct hv_get_vp_registers_output result;
9bbb888824e38c Michael Kelley 2021-08-04 34 u64 guest_id;
9bbb888824e38c Michael Kelley 2021-08-04 35 int ret;
9bbb888824e38c Michael Kelley 2021-08-04 36
9bbb888824e38c Michael Kelley 2021-08-04 37 /*
9bbb888824e38c Michael Kelley 2021-08-04 38 * Allow for a kernel built with CONFIG_HYPERV to be running in
9bbb888824e38c Michael Kelley 2021-08-04 39 * a non-Hyper-V environment, including on DT instead of ACPI.
9bbb888824e38c Michael Kelley 2021-08-04 40 * In such cases, do nothing and return success.
9bbb888824e38c Michael Kelley 2021-08-04 41 */
9bbb888824e38c Michael Kelley 2021-08-04 42 if (acpi_disabled)
9bbb888824e38c Michael Kelley 2021-08-04 43 return 0;
9bbb888824e38c Michael Kelley 2021-08-04 44
9bbb888824e38c Michael Kelley 2021-08-04 45 if (strncmp((char *)&acpi_gbl_FADT.hypervisor_id, "MsHyperV", 8))
9bbb888824e38c Michael Kelley 2021-08-04 46 return 0;
9bbb888824e38c Michael Kelley 2021-08-04 47
9bbb888824e38c Michael Kelley 2021-08-04 48 /* Setup the guest ID */
d5ebde1e2b4615 Li kunyu 2022-09-28 49 guest_id = hv_generate_guest_id(LINUX_VERSION_CODE);
b967df6293510b Nuno Das Neves 2024-03-12 50 hv_set_vpreg(HV_REGISTER_GUEST_OS_ID, guest_id);
9bbb888824e38c Michael Kelley 2021-08-04 51
9bbb888824e38c Michael Kelley 2021-08-04 52 /* Get the features and hints from Hyper-V */
9bbb888824e38c Michael Kelley 2021-08-04 @53 hv_get_vpreg_128(HV_REGISTER_FEATURES, &result);
9bbb888824e38c Michael Kelley 2021-08-04 54 ms_hyperv.features = result.as32.a;
9bbb888824e38c Michael Kelley 2021-08-04 55 ms_hyperv.priv_high = result.as32.b;
9bbb888824e38c Michael Kelley 2021-08-04 56 ms_hyperv.misc_features = result.as32.c;
9bbb888824e38c Michael Kelley 2021-08-04 57
9bbb888824e38c Michael Kelley 2021-08-04 @58 hv_get_vpreg_128(HV_REGISTER_ENLIGHTENMENTS, &result);
9bbb888824e38c Michael Kelley 2021-08-04 59 ms_hyperv.hints = result.as32.a;
9bbb888824e38c Michael Kelley 2021-08-04 60
9bbb888824e38c Michael Kelley 2021-08-04 61 pr_info("Hyper-V: privilege flags low 0x%x, high 0x%x, hints 0x%x, misc 0x%x\n",
9bbb888824e38c Michael Kelley 2021-08-04 62 ms_hyperv.features, ms_hyperv.priv_high, ms_hyperv.hints,
9bbb888824e38c Michael Kelley 2021-08-04 63 ms_hyperv.misc_features);
9bbb888824e38c Michael Kelley 2021-08-04 64
9bbb888824e38c Michael Kelley 2021-08-04 65 ret = hv_common_init();
9bbb888824e38c Michael Kelley 2021-08-04 66 if (ret)
9bbb888824e38c Michael Kelley 2021-08-04 67 return ret;
9bbb888824e38c Michael Kelley 2021-08-04 68
52ae076c3a9b36 Michael Kelley 2023-05-23 69 ret = cpuhp_setup_state(CPUHP_AP_HYPERV_ONLINE, "arm64/hyperv_init:online",
9bbb888824e38c Michael Kelley 2021-08-04 70 hv_common_cpu_init, hv_common_cpu_die);
9bbb888824e38c Michael Kelley 2021-08-04 71 if (ret < 0) {
9bbb888824e38c Michael Kelley 2021-08-04 72 hv_common_free();
9bbb888824e38c Michael Kelley 2021-08-04 73 return ret;
9bbb888824e38c Michael Kelley 2021-08-04 74 }
9bbb888824e38c Michael Kelley 2021-08-04 75
f2580a907e5c0e Michael Kelley 2024-03-18 76 ms_hyperv_late_init();
f2580a907e5c0e Michael Kelley 2024-03-18 77
9bbb888824e38c Michael Kelley 2021-08-04 78 hyperv_initialized = true;
9bbb888824e38c Michael Kelley 2021-08-04 79 return 0;
9bbb888824e38c Michael Kelley 2021-08-04 80 }
9bbb888824e38c Michael Kelley 2021-08-04 81

--
0-DAY CI Kernel Test Service