|
19 | 19 | #include <asm/sev.h> |
20 | 20 | #include <asm/ibt.h> |
21 | 21 | #include <asm/hypervisor.h> |
22 | | -#include <asm/hyperv-tlfs.h> |
| 22 | +#include <hyperv/hvhdk.h> |
23 | 23 | #include <asm/mshyperv.h> |
24 | 24 | #include <asm/idtentry.h> |
25 | 25 | #include <asm/set_memory.h> |
26 | 26 | #include <linux/kexec.h> |
27 | 27 | #include <linux/version.h> |
28 | 28 | #include <linux/vmalloc.h> |
29 | 29 | #include <linux/mm.h> |
30 | | -#include <linux/hyperv.h> |
31 | 30 | #include <linux/slab.h> |
32 | 31 | #include <linux/kernel.h> |
33 | 32 | #include <linux/cpuhotplug.h> |
@@ -416,24 +415,24 @@ static void __init hv_get_partition_id(void) |
416 | 415 | static u8 __init get_vtl(void) |
417 | 416 | { |
418 | 417 | u64 control = HV_HYPERCALL_REP_COMP_1 | HVCALL_GET_VP_REGISTERS; |
419 | | - struct hv_get_vp_registers_input *input; |
420 | | - struct hv_get_vp_registers_output *output; |
| 418 | + struct hv_input_get_vp_registers *input; |
| 419 | + struct hv_output_get_vp_registers *output; |
421 | 420 | unsigned long flags; |
422 | 421 | u64 ret; |
423 | 422 |
|
424 | 423 | local_irq_save(flags); |
425 | 424 | input = *this_cpu_ptr(hyperv_pcpu_input_arg); |
426 | | - output = (struct hv_get_vp_registers_output *)input; |
| 425 | + output = *this_cpu_ptr(hyperv_pcpu_output_arg); |
427 | 426 |
|
428 | | - memset(input, 0, struct_size(input, element, 1)); |
429 | | - input->header.partitionid = HV_PARTITION_ID_SELF; |
430 | | - input->header.vpindex = HV_VP_INDEX_SELF; |
431 | | - input->header.inputvtl = 0; |
432 | | - input->element[0].name0 = HV_X64_REGISTER_VSM_VP_STATUS; |
| 427 | + memset(input, 0, struct_size(input, names, 1)); |
| 428 | + input->partition_id = HV_PARTITION_ID_SELF; |
| 429 | + input->vp_index = HV_VP_INDEX_SELF; |
| 430 | + input->input_vtl.as_uint8 = 0; |
| 431 | + input->names[0] = HV_REGISTER_VSM_VP_STATUS; |
433 | 432 |
|
434 | 433 | ret = hv_do_hypercall(control, input, output); |
435 | 434 | if (hv_result_success(ret)) { |
436 | | - ret = output->as64.low & HV_X64_VTL_MASK; |
| 435 | + ret = output->values[0].reg8 & HV_X64_VTL_MASK; |
437 | 436 | } else { |
438 | 437 | pr_err("Failed to get VTL(error: %lld) exiting...\n", ret); |
439 | 438 | BUG(); |
@@ -473,7 +472,7 @@ void __init hyperv_init(void) |
473 | 472 | if (hv_isolation_type_tdx()) |
474 | 473 | hv_vp_assist_page = NULL; |
475 | 474 | else |
476 | | - hv_vp_assist_page = kcalloc(num_possible_cpus(), |
| 475 | + hv_vp_assist_page = kcalloc(nr_cpu_ids, |
477 | 476 | sizeof(*hv_vp_assist_page), |
478 | 477 | GFP_KERNEL); |
479 | 478 | if (!hv_vp_assist_page) { |
|
0 commit comments