Re: [PATCH v5 08/10] x86: hyperv: Add mshv_handler irq handler and setup function

2025-03-07 Thread Nuno Das Neves
On 3/7/2025 9:44 AM, Michael Kelley wrote: > From: Nuno Das Neves Sent: Wednesday, > February 26, 2025 3:08 PM > >> >> This will handle SYNIC interrupts such as intercepts, doorbells, and >> scheduling messages intended for the mshv driver. > > Could you provide a bit more detailed commit messa

Re: [PATCH v5 09/10] hyperv: Add definitions for root partition driver to hv headers

2025-03-07 Thread Nuno Das Neves
On 3/7/2025 9:26 AM, Michael Kelley wrote: > From: Nuno Das Neves Sent: Wednesday, > February 26, 2025 3:08 PM >> >> A few additional definitions are required for the mshv driver code >> (to follow). Introduce those here and clean up a little bit while >> at it. >> >> Signed-off-by: Nuno Das Neve

RE: [PATCH v5 07/10] Drivers: hv: Introduce per-cpu event ring tail

2025-03-07 Thread Michael Kelley
From: Michael Kelley Sent: Friday, March 7, 2025 3:21 PM > > From: Nuno Das Neves Sent: Friday, March > 7, 2025 > 2:07 PM > > [snip] > > >> @@ -485,6 +504,17 @@ int hv_common_cpu_init(unsigned int cpu) > > >> *outputarg = (char *)mem + HV_HYP_PAGE_SIZE; > > >>

RE: [PATCH v5 09/10] hyperv: Add definitions for root partition driver to hv headers

2025-03-07 Thread Michael Kelley
From: Nuno Das Neves Sent: Wednesday, February 26, 2025 3:08 PM > > A few additional definitions are required for the mshv driver code > (to follow). Introduce those here and clean up a little bit while > at it. > > Signed-off-by: Nuno Das Neves > --- > include/hyperv/hvgdk_mini.h | 64 +

Re: [PATCH net] net: mana: Support holes in device list reply msg

2025-03-07 Thread Jakub Kicinski
On Wed, 5 Mar 2025 13:46:21 -0800 Haiyang Zhang wrote: > - for (i = 0; i < max_num_devs; i++) { > + for (i = 0; i < GDMA_DEV_LIST_SIZE && > + found_dev < resp.num_of_devs; i++) { unfortunate mis-indent here, it blend with the code. checkpatch is right that it should be aligned

RE: [PATCH v5 07/10] Drivers: hv: Introduce per-cpu event ring tail

2025-03-07 Thread Michael Kelley
From: Nuno Das Neves Sent: Wednesday, February 26, 2025 3:08 PM > > Add a pointer hv_synic_eventring_tail to track the tail pointer for the > SynIC event ring buffer for each SINT. > > This will be used by the mshv driver, but must be tracked independently > since the driver module could be rem

Re: [PATCH v5 01/10] hyperv: Convert Hyper-V status codes to strings

2025-03-07 Thread Nuno Das Neves
On 3/6/2025 10:09 AM, Michael Kelley wrote: > From: Michael Kelley Sent: Thursday, March 6, 2025 > 9:58 AM > >> >> From: Nuno Das Neves Sent: Wednesday, >> February >> 26, 2025 3:08 PM >>> >>> Introduce hv_result_to_string() for this purpose. This allows >>> hypercall failures to be debugged m

Re: [PATCH v5 07/10] Drivers: hv: Introduce per-cpu event ring tail

2025-03-07 Thread Nuno Das Neves
On 3/7/2025 3:21 PM, Michael Kelley wrote: > From: Nuno Das Neves Sent: Friday, March > 7, 2025 2:07 PM >> >> On 3/7/2025 9:02 AM, Michael Kelley wrote: >>> From: Nuno Das Neves Sent: Wednesday, >>> February 26, 2025 3:08 PM Add a pointer hv_synic_eventring_tail to track the tail poin

RE: [PATCH v5 07/10] Drivers: hv: Introduce per-cpu event ring tail

2025-03-07 Thread Michael Kelley
From: Nuno Das Neves Sent: Friday, March 7, 2025 2:07 PM > > On 3/7/2025 9:02 AM, Michael Kelley wrote: > > From: Nuno Das Neves Sent: Wednesday, > > February 26, 2025 3:08 PM > >> > >> Add a pointer hv_synic_eventring_tail to track the tail pointer for the > >> SynIC event ring buffer for eac

RE: [PATCH v5 08/10] x86: hyperv: Add mshv_handler irq handler and setup function

2025-03-07 Thread Michael Kelley
From: Nuno Das Neves Sent: Friday, February 28, 2025 4:38 PM > > On 2/26/2025 3:43 PM, Stanislav Kinsburskii wrote: > > On Wed, Feb 26, 2025 at 03:08:02PM -0800, Nuno Das Neves wrote: > >> This will handle SYNIC interrupts such as intercepts, doorbells, and > >> scheduling messages intended for

Re: [PATCH v5 10/10] Drivers: hv: Introduce mshv_root module to expose /dev/mshv to VMMs

2025-03-07 Thread Roman Kisel
On 3/6/2025 9:32 AM, Wei Liu wrote: On Thu, Feb 27, 2025 at 10:50:30AM -0800, Roman Kisel wrote: [...] 2. Scheduling. Here, there is the mature KVM and Xen code to find inspiration in. Xen being the Type 1 hypervisor should likely be closer to MSHV in my understanding. Yes and no

[PATCH hyperv-next v5 00/11] arm64: hyperv: Support Virtual Trust Level Boot

2025-03-07 Thread Roman Kisel
This patch set allows the Hyper-V code to boot on ARM64 inside a Virtual Trust Level. These levels are a part of the Virtual Secure Mode documented in the Top-Level Functional Specification available at https://learn.microsoft.com/en-us/virtualization/hyper-v-on-windows/tlfs/vsm. The OpenHCL parav

[PATCH hyperv-next v5 01/11] arm64: kvm, smccc: Introduce and use API for detectting hypervisor presence

2025-03-07 Thread Roman Kisel
The KVM/arm64 uses SMCCC to detect hypervisor presence. That code is private, and it follows the SMCCC specification. Other existing and emerging hypervisor guest implementations can and should use that standard approach as well. Factor out a common infrastructure that the guests can use, update K

Re: [PATCH v5 07/10] Drivers: hv: Introduce per-cpu event ring tail

2025-03-07 Thread Nuno Das Neves
On 3/7/2025 9:02 AM, Michael Kelley wrote: > From: Nuno Das Neves Sent: Wednesday, > February 26, 2025 3:08 PM >> >> Add a pointer hv_synic_eventring_tail to track the tail pointer for the >> SynIC event ring buffer for each SINT. >> >> This will be used by the mshv driver, but must be tracked in

[PATCH hyperv-next v5 04/11] Drivers: hv: Provide arch-neutral implementation of get_vtl()

2025-03-07 Thread Roman Kisel
To run in the VTL mode, Hyper-V drivers have to know what VTL the system boots in, and the arm64/hyperv code does not have the means to compute that. Refactor the code to hoist the function that detects VTL, make it arch-neutral to be able to employ it to get the VTL on arm64. Signed-off-by: Roma

[PATCH hyperv-next v5 02/11] arm64: hyperv: Use SMCCC to detect hypervisor presence

2025-03-07 Thread Roman Kisel
The arm64 Hyper-V startup path relies on ACPI to detect running under a Hyper-V compatible hypervisor. That doesn't work on non-ACPI systems. Hoist the ACPI detection logic into a separate function. Then use the vendor-specific hypervisor service call (implemented recently in Hyper-V) via SMCCC in

[PATCH hyperv-next v5 06/11] arm64, x86: hyperv: Report the VTL the system boots in

2025-03-07 Thread Roman Kisel
The hyperv guest code might run in various Virtual Trust Levels. Report the level when the kernel boots in the non-default (0) one. Signed-off-by: Roman Kisel --- arch/arm64/hyperv/mshyperv.c | 2 ++ arch/x86/hyperv/hv_vtl.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --gi

[PATCH hyperv-next v5 03/11] Drivers: hv: Enable VTL mode for arm64

2025-03-07 Thread Roman Kisel
Kconfig dependencies for arm64 guests on Hyper-V require that be ACPI enabled, and limit VTL mode to x86/x64. To enable VTL mode on arm64 as well, update the dependencies. Since VTL mode requires DeviceTree instead of ACPI, don’t require arm64 guests on Hyper-V to have ACPI unconditionally. Signed

[PATCH hyperv-next v5 07/11] dt-bindings: microsoft,vmbus: Add interrupts and DMA coherence

2025-03-07 Thread Roman Kisel
To boot on ARM64, VMBus requires configuring interrupts. Missing DMA coherence property is sub-optimal as the VMBus transations are cache-coherent. Add interrupts to be able to boot on ARM64. Add DMA coherence to avoid doing extra work on maintaining caches on ARM64. Signed-off-by: Roman Kisel -

[PATCH hyperv-next v5 05/11] arm64: hyperv: Initialize the Virtual Trust Level field

2025-03-07 Thread Roman Kisel
Various parts of the hyperv code need to know what VTL the kernel runs at, most notably VMBus needs that to establish communication with the host. Initialize the Virtual Trust Level field to enable booting in the Virtual Trust Level. Signed-off-by: Roman Kisel --- arch/arm64/hyperv/mshyperv.c |

[PATCH hyperv-next v5 09/11] Drivers: hv: vmbus: Introduce hv_get_vmbus_root_device()

2025-03-07 Thread Roman Kisel
The ARM64 PCI code for hyperv needs to know the VMBus root device, and it is private. Provide a function that returns it. Rename it from "hv_dev" as "hv_dev" as a symbol is very overloaded. No functional changes. Signed-off-by: Roman Kisel --- drivers/hv/vmbus_drv.c | 23 +++

[PATCH hyperv-next v5 08/11] Drivers: hv: vmbus: Get the IRQ number from DeviceTree

2025-03-07 Thread Roman Kisel
The VMBus driver uses ACPI for interrupt assignment on arm64 hence it won't function in the VTL mode where only DeviceTree can be used. Update the VMBus driver to discover interrupt configuration from DT. Signed-off-by: Roman Kisel Reviewed-by: Michael Kelley --- drivers/hv/vmbus_drv.c | 36 ++

Re: [PATCH v5 03/10] arm64/hyperv: Add some missing functions to arm64

2025-03-07 Thread Easwar Hariharan
On 3/7/2025 1:36 PM, Nuno Das Neves wrote: > On 3/6/2025 11:05 AM, Michael Kelley wrote: >> From: Nuno Das Neves Sent: Thursday, >> February 27, 2025 4:21 PM >>> >>> On 2/26/2025 9:56 PM, Easwar Hariharan wrote: On 2/26/2025 3:07 PM, Nuno Das Neves wrote: > These non-nested msr and fast

[PATCH hyperv-next v5 10/11] ACPI: irq: Introduce acpi_get_gsi_dispatcher()

2025-03-07 Thread Roman Kisel
Using acpi_irq_create_hierarchy() in the cases where the code also handles OF leads to code duplication as the ACPI subsystem doesn't provide means to compute the IRQ domain parent whereas the OF does. Introduce acpi_get_gsi_dispatcher() so that the drivers relying on both ACPI and OF may use irq_

[PATCH hyperv-next v5 11/11] PCI: hv: Get vPCI MSI IRQ domain from DeviceTree

2025-03-07 Thread Roman Kisel
The hyperv-pci driver uses ACPI for MSI IRQ domain configuration on arm64. It won't be able to do that in the VTL mode where only DeviceTree can be used. Update the hyperv-pci driver to get vPCI MSI IRQ domain in the DeviceTree case, too. Signed-off-by: Roman Kisel --- drivers/pci/controller/pc

Re: [PATCH v5 03/10] arm64/hyperv: Add some missing functions to arm64

2025-03-07 Thread Nuno Das Neves
On 3/6/2025 11:05 AM, Michael Kelley wrote: > From: Nuno Das Neves Sent: Thursday, > February 27, 2025 4:21 PM >> >> On 2/26/2025 9:56 PM, Easwar Hariharan wrote: >>> On 2/26/2025 3:07 PM, Nuno Das Neves wrote: These non-nested msr and fast hypercall functions are present in x86, but th

Re: [PATCH v5 06/10] Drivers/hv: Export some functions for use by root partition module

2025-03-07 Thread Nuno Das Neves
On 3/6/2025 11:23 AM, Michael Kelley wrote: > From: Nuno Das Neves Sent: Wednesday, > February 26, 2025 3:08 PM >> > > Nit: For the patch Subject line, use prefix "Drivers: hv:" instead of with a > slash. > That's what we usually use and what you have used for other patches in this > series. >

RE: [PATCH v5 08/10] x86: hyperv: Add mshv_handler irq handler and setup function

2025-03-07 Thread Michael Kelley
From: Nuno Das Neves Sent: Wednesday, February 26, 2025 3:08 PM > > This will handle SYNIC interrupts such as intercepts, doorbells, and > scheduling messages intended for the mshv driver. Could you provide a bit more detailed commit message? How does the mshv_handler() relate to the vmbus_han

Re: [PATCH v5 01/10] hyperv: Convert Hyper-V status codes to strings

2025-03-07 Thread Nuno Das Neves
On 3/6/2025 9:57 AM, Michael Kelley wrote: > From: Nuno Das Neves Sent: Wednesday, > February 26, 2025 3:08 PM >> >> Introduce hv_result_to_string() for this purpose. This allows >> hypercall failures to be debugged more easily with dmesg. >> >> Signed-off-by: Nuno Das Neves >> --- >> drivers/h

RE: [PATCH v5 08/10] x86: hyperv: Add mshv_handler irq handler and setup function

2025-03-07 Thread Michael Kelley
From: Nuno Das Neves Sent: Friday, March 7, 2025 3:30 PM > > On 3/7/2025 9:44 AM, Michael Kelley wrote: > > From: Nuno Das Neves Sent: Wednesday, > > February 26, 2025 3:08 PM > > > >> > >> This will handle SYNIC interrupts such as intercepts, doorbells, and > >> scheduling messages intended f