[PATCH v2 3/4] Drivers: hv: vmbus: Add hooks for per-CPU IRQ

2018-08-29 Thread mhkelley58
From: Michael Kelley Add hooks to enable/disable a per-CPU IRQ for VMbus. These hooks are in the architecture independent setup and shutdown paths for Hyper-V, and are needed by Linux guests on Hyper-V on ARM64. The x86/x64 implementation is null because VMbus interrupts on x86/x64 don't use an

[PATCH v2 2/4] arm64: hyperv: Add support for Hyper-V as a hypervisor

2018-08-29 Thread mhkelley58
From: Michael Kelley Add ARM64-specific code to enable Hyper-V. This code includes: * Detecting Hyper-V and initializing the guest/Hyper-V interface * Setting up Hyper-V's synthetic clocks * Making hypercalls using the HVC instruction * Setting up VMbus and stimer0 interrupts * Setting up kexec

[PATCH v2 4/4] Drivers: hv: Enable CONFIG_HYPERV on ARM64

2018-08-29 Thread mhkelley58
From: Michael Kelley Update drivers/hv/Kconfig so CONFIG_HYPERV can be selected on ARM64, causing the Hyper-V specific code to be built. Signed-off-by: Michael Kelley Reviewed-by: James Morris --- drivers/hv/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[PATCH v2 1/4] arm64: hyperv: Add core Hyper-V include files

2018-08-29 Thread mhkelley58
From: Michael Kelley hyperv-tlfs.h defines Hyper-V interfaces from the Hyper-V Top Level Functional Spec (TLFS). The TLFS is distinctly oriented to x86/x64, and Hyper-V has not separated out the architecture-dependent parts into x86/x64 vs. ARM64. So hyperv-tlfs.h includes information for ARM64

[PATCH v2 0/4] Enable Linux guests on Hyper-V on ARM64

2018-08-29 Thread mhkelley58
From: Michael Kelley This series enables Linux guests running on Hyper-V on ARM64 hardware. New ARM64-specific code in arch/arm64/hyperv initializes Hyper-V, including its synthetic clocks and hypercall mechanism. Existing architecture independent drivers for Hyper-V's VMbus and synthetic

[PATCH char-misc 1/1] Drivers: hv: vmbus: Fix synic per-cpu context initialization

2018-08-02 Thread mhkelley58
From: Michael Kelley If hv_synic_alloc() errors out, the state of the per-cpu context for some CPUs is unknown since the zero'ing is done as each CPU is iterated over. In such case, hv_synic_cleanup() may try to free memory based on uninitialized values. Fix this by zero'ing the per-cpu

[PATCH char-misc 1/1] Drivers: hv: vmbus: Cleanup synic memory free path

2018-08-01 Thread mhkelley58
From: Michael Kelley clk_evt memory is not being freed when the synic is shutdown or when there is an allocation error. Add the appropriate kfree() call, along with a comment to clarify how the memory gets freed after an allocation error. Make the free path consistent by removing checks for

[PATCH char-misc 1/1] Drivers: hv: vmbus: Make synic_initialized flag per-cpu

2018-07-30 Thread mhkelley58
From: Michael Kelley The synic_initialized flag is part of the global hv_context structure. But the Hyper-V synthetic interrupt controller is fundamentally a per-cpu device, and other synic related fields are in hv_per_cpu_context. In a multi-CPU system, synic_initialized gets set multiple

[PATCH char-misc 1/1] Drivers: hv: vmbus: Remove use of slow_virt_to_phys()

2018-07-30 Thread mhkelley58
From: Michael Kelley slow_virt_to_phys() is only implemented for arch/x86. Remove its use in arch independent Hyper-V drivers, and replace with test for vmalloc() address followed by appropriate v-to-p function. This follows the typical pattern of other drivers and avoids the need to implement

[PATCH char-misc 2/2] Drivers: hv: vmbus: Make TLFS #define names architecture neutral

2018-05-07 Thread mhkelley58
From: Michael Kelley The Hyper-V feature and hint flags in hyperv-tlfs.h are all defined with the string "X64" in the name. Some of these flags are indeed x86/x64 specific, but others are not. For the ones that are used in architecture independent Hyper-V driver code,

[PATCH char-misc 1/2] Drivers: hv: vmbus: Remove x86 MSR refs in arch independent code

2018-05-07 Thread mhkelley58
From: Michael Kelley In architecture independent code for manipulating Hyper-V synthetic timers and synthetic interrupts, pass in an ordinal number identifying the timer or interrupt, rather than an actual MSR register address. Then in x86/x64 specific code, map the

[PATCH char-misc 0/2] Drivers: hv: vmbus: Remove x86-isms in arch independent code

2018-05-07 Thread mhkelley58
From: Michael Kelley More changes to cleanly separate architecture independent code from architecture dependent code. The first patch moves x86-specific code out of the Hyper-V architecture independent drivers and into the arch/x86 directory. The second patch removes

[PATCH v3 char-misc 1/1] x86/hyperv: Add interrupt handler annotations

2018-04-11 Thread mhkelley58
From: Michael Kelley Add standard interrupt handler annotations to hyperv_vector_handler(). This does not fix any observed bug, but avoids potential removal of the code by link time optimization and makes it consistent with hv_stimer0_vector_handler in the same source

[PATCH char-misc 1/1] Drivers: hv: vmbus: Add comments on ring buffer signaling

2018-04-03 Thread mhkelley58
From: Michael Kelley Add comments describing intricacies of Hyper-V ring buffer signaling code. This information is not in Hyper-V public documents, so include here to capture the knowledge for future coders. There are no code changes in this commit. Signed-off-by:

[PATCH v2 char-misc 1/1] x86/hyperv: Add interrupt handler annotations

2018-04-03 Thread mhkelley58
From: Michael Kelley Add standard interrupt handler annotations to hyperv_vector_handler(). Signed-off-by: Michael Kelley --- Changes in v2: * Fixed From: line --- arch/x86/kernel/cpu/mshyperv.c | 2 +- 1 file changed, 1 insertion(+), 1