Lines Matching +full:output +full:- +full:specific

1 // SPDX-License-Identifier: GPL-2.0
5 * Hyper-V. This file is specifically for code that must be
6 * built-in to the kernel image when CONFIG_HYPERV is set
8 * specific code under arch/.
29 #include <linux/dma-map-ops.h>
42 * Hyper-V specific globals so they are shared across all architectures and are
72 * Per-cpu array holding the tail pointer for the SynIC event ring buffer
82 * Hyper-V specific initialization and shutdown code that is
84 * specific initialization functions.
111 * Boolean to control whether to report panic messages over Hyper-V.
119 * reported to Hyper-V on panic.
159 /* Don't notify Hyper-V unless we have a die oops event or panic. */ in hv_die_panic_notify_crash()
168 regs = ((struct die_args *)args)->regs; in hv_die_panic_notify_crash()
172 * Hyper-V should be notified only once about a panic/die. If we will in hv_die_panic_notify_crash()
184 * buffer and call into Hyper-V to transfer the data.
193 if (detail->reason != KMSG_DUMP_PANIC || !sysctl_record_panic_msg) in hv_kmsg_dump()
198 * be single-threaded. in hv_kmsg_dump()
208 * registers are no-op when the NOTIFY_MSG flag is set. in hv_kmsg_dump()
217 * Let Hyper-V know there is crash data available along with in hv_kmsg_dump()
246 pr_err("Hyper-V: panic message page memory allocation failed\n"); in hv_kmsg_dump_register()
252 pr_err("Hyper-V: kmsg dump register error 0x%x\n", ret); in hv_kmsg_dump_register()
265 struct hv_output_get_partition_id *output; in hv_get_partition_id() local
270 output = *this_cpu_ptr(hyperv_pcpu_input_arg); in hv_get_partition_id()
271 status = hv_do_hypercall(HVCALL_GET_PARTITION_ID, NULL, output); in hv_get_partition_id()
272 pt_id = output->partition_id; in hv_get_partition_id()
278 pr_err("Hyper-V: failed to get partition ID: %#x\n", in hv_get_partition_id()
286 struct hv_output_get_vp_registers *output; in get_vtl() local
292 output = *this_cpu_ptr(hyperv_pcpu_output_arg); in get_vtl()
295 input->partition_id = HV_PARTITION_ID_SELF; in get_vtl()
296 input->vp_index = HV_VP_INDEX_SELF; in get_vtl()
297 input->input_vtl.as_uint8 = 0; in get_vtl()
298 input->names[0] = HV_REGISTER_VSM_VP_STATUS; in get_vtl()
300 ret = hv_do_hypercall(control, input, output); in get_vtl()
302 ret = output->values[0].reg8 & HV_VTL_MASK; in get_vtl()
318 /* Get information about the Hyper-V host version */ in hv_common_init()
320 pr_info("Hyper-V: Host Build %d.%d.%d.%d-%d-%d\n", in hv_common_init()
329 * Hyper-V expects to get crash register data or kmsg when in hv_common_init()
339 pr_info("Hyper-V: enabling crash_kexec_post_notifiers\n"); in hv_common_init()
343 * is enabled by default in non-isolated guests and in hv_common_init()
350 pr_err("Hyper-V: sysctl table register error"); in hv_common_init()
366 * Allocate the per-CPU state for the hypercall input arg. in hv_common_init()
368 * (per-CPU) hypercall input page and thus this failure is in hv_common_init()
369 * fatal on Hyper-V. in hv_common_init()
374 /* Allocate the per-CPU state for output arg for root */ in hv_common_init()
389 return -ENOMEM; in hv_common_init()
407 * the Hyper-V host in ACPI table OEM0. in ms_hyperv_late_init()
417 * Since the "OEM0" table name is for OEM specific usage, verify in ms_hyperv_late_init()
420 if (strncmp(header->oem_table_id, "MICROSFT", 8)) in ms_hyperv_late_init()
426 * against a malformed table. Hyper-V currently provides 64 bytes, in ms_hyperv_late_init()
429 if (header->length < sizeof(*header) + 8 || in ms_hyperv_late_init()
430 header->length > sizeof(*header) + SZ_4K) in ms_hyperv_late_init()
433 length = header->length - sizeof(*header); in ms_hyperv_late_init()
436 pr_debug("Hyper-V: Seeding rng with %d random bytes from ACPI table OEM0\n", in ms_hyperv_late_init()
450 header->checksum += randomdata[i]; in ms_hyperv_late_init()
454 for (i = 0; i < sizeof(header->length); i++) in ms_hyperv_late_init()
455 header->checksum += ((u8 *)&header->length)[i]; in ms_hyperv_late_init()
456 header->length = sizeof(*header); in ms_hyperv_late_init()
457 for (i = 0; i < sizeof(header->length); i++) in ms_hyperv_late_init()
458 header->checksum -= ((u8 *)&header->length)[i]; in ms_hyperv_late_init()
465 * Hyper-V specific initialization and die code for
486 * The per-cpu memory is already allocated if this CPU was previously in hv_common_cpu_init()
492 return -ENOMEM; in hv_common_cpu_init()
512 * hyperv_pcpu_input_arg is not NULL, set_memory_decrypted() -> in hv_common_cpu_init()
513 * ... -> cpa_flush()-> ... -> __send_ipi_mask_ex() tries to in hv_common_cpu_init()
540 ret = -ENOMEM; in hv_common_cpu_init()
552 * may be used by the Hyper-V vPCI driver in reassigning interrupts in hv_common_cpu_die()
575 * output parameter to the hypercall below and so it should be in hv_query_ext_cap()
580 * Hypercall input/output addresses should also be 8-byte aligned. in hv_query_ext_cap()
607 pr_err("Hyper-V: Extended query capabilities hypercall failed 0x%llx\n", in hv_query_ext_cap()
629 * Default function to read the Hyper-V reference counter, independent
630 * of whether Hyper-V enlightened clocks/timers are being used. But on
631 * architectures where it is used, Hyper-V enlightenment code in
642 /* These __weak functions provide default "no-op" behavior and
643 * may be overridden by architecture specific versions. Architectures
644 * for which the default "no-op" behavior is sufficient can leave
646 * functions in arch-specific code.
707 u64 __weak hv_ghcb_hypercall(u64 control, void *input, void *output, u32 input_size) in hv_ghcb_hypercall() argument
726 * Hyper-V should never specify running as root and as a Confidential in hv_identify_partition_type()
727 * VM. But to protect against a compromised/malicious Hyper-V trying in hv_identify_partition_type()
735 pr_crit("Hyper-V: CONFIG_MSHV_ROOT not enabled!\n"); in hv_identify_partition_type()
737 pr_info("Hyper-V: running as root partition\n"); in hv_identify_partition_type()
740 pr_info("Hyper-V: running as L1VH partition\n"); in hv_identify_partition_type()
757 * Provide a few mappings that could be useful, and revert to -EIO
763 _STATUS_INFO(HV_STATUS_INVALID_HYPERCALL_CODE, -EINVAL),
764 _STATUS_INFO(HV_STATUS_INVALID_HYPERCALL_INPUT, -EINVAL),
765 _STATUS_INFO(HV_STATUS_INVALID_ALIGNMENT, -EIO),
766 _STATUS_INFO(HV_STATUS_INVALID_PARAMETER, -EINVAL),
767 _STATUS_INFO(HV_STATUS_ACCESS_DENIED, -EIO),
768 _STATUS_INFO(HV_STATUS_INVALID_PARTITION_STATE, -EIO),
769 _STATUS_INFO(HV_STATUS_OPERATION_DENIED, -EIO),
770 _STATUS_INFO(HV_STATUS_UNKNOWN_PROPERTY, -EIO),
771 _STATUS_INFO(HV_STATUS_PROPERTY_VALUE_OUT_OF_RANGE, -EIO),
772 _STATUS_INFO(HV_STATUS_INSUFFICIENT_MEMORY, -ENOMEM),
773 _STATUS_INFO(HV_STATUS_INVALID_PARTITION_ID, -EINVAL),
774 _STATUS_INFO(HV_STATUS_INVALID_VP_INDEX, -EINVAL),
775 _STATUS_INFO(HV_STATUS_NOT_FOUND, -EIO),
776 _STATUS_INFO(HV_STATUS_INVALID_PORT_ID, -EINVAL),
777 _STATUS_INFO(HV_STATUS_INVALID_CONNECTION_ID, -EINVAL),
778 _STATUS_INFO(HV_STATUS_INSUFFICIENT_BUFFERS, -EIO),
779 _STATUS_INFO(HV_STATUS_NOT_ACKNOWLEDGED, -EIO),
780 _STATUS_INFO(HV_STATUS_INVALID_VP_STATE, -EIO),
781 _STATUS_INFO(HV_STATUS_NO_RESOURCES, -EIO),
782 _STATUS_INFO(HV_STATUS_PROCESSOR_FEATURE_NOT_SUPPORTED, -EIO),
783 _STATUS_INFO(HV_STATUS_INVALID_LP_INDEX, -EINVAL),
784 _STATUS_INFO(HV_STATUS_INVALID_REGISTER_VALUE, -EINVAL),
785 _STATUS_INFO(HV_STATUS_INVALID_LP_INDEX, -EIO),
786 _STATUS_INFO(HV_STATUS_INVALID_REGISTER_VALUE, -EIO),
787 _STATUS_INFO(HV_STATUS_OPERATION_FAILED, -EIO),
788 _STATUS_INFO(HV_STATUS_TIME_OUT, -EIO),
789 _STATUS_INFO(HV_STATUS_CALL_PENDING, -EIO),
790 _STATUS_INFO(HV_STATUS_VTL_ALREADY_ENABLED, -EIO),
802 if (info->code == code) in find_hv_status_info()
809 /* Convert a hypercall result into a linux-friendly error code. */
816 return -EOPNOTSUPP; in hv_result_to_errno()
820 return info->errno; in hv_result_to_errno()
822 return -EIO; in hv_result_to_errno()
835 return info->string; in hv_result_to_string()