Re: [PATCH 1/6] arm64/hyperv: Support DeviceTree

2024-05-10 Thread Roman Kisel
On 5/10/2024 10:04 AM, Easwar Hariharan wrote: On 5/10/2024 9:05 AM, rom...@linux.microsoft.com wrote: From: Roman Kisel Update the driver to support DeviceTree boot as well along with ACPI. This enables the Virtual Trust Level platforms boot up on ARM64. Signed-off-by: Roman Kisel

[PATCH v2 0/6] arm64/hyperv: Support Virtual Trust Level Boot

2024-05-14 Thread Roman Kisel
] - Decreased number of #ifdef's - Updated the wording in the commit messages to adhere to the guidlines - Sending to the correct set of maintainers and mail lists Roman Kisel (6): arm64/hyperv: Support DeviceTree drivers/hv: Enable VTL mode for arm64 drivers/hv: arch-neutral implementati

[PATCH v2 2/6] drivers/hv: Enable VTL mode for arm64

2024-05-14 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. Signed-off-by: Roman

[PATCH v2 3/6] drivers/hv: arch-neutral implementation of get_vtl()

2024-05-14 Thread Roman Kisel
: Roman Kisel --- arch/x86/hyperv/hv_init.c | 34 --- arch/x86/include/asm/hyperv-tlfs.h | 7 - drivers/hv/hv_common.c | 43 ++ include/asm-generic/hyperv-tlfs.h | 7 + include/asm-generic/mshyperv.h | 6 + 5 files

[PATCH v2 4/6] arm64/hyperv: Boot in a Virtual Trust Level

2024-05-14 Thread Roman Kisel
(C) 2023, Microsoft, Inc. + * + * Author : Roman Kisel + */ + +#include + +void __init hv_vtl_init_platform(void) +{ + pr_info("Linux runs in Hyper-V Virtual Trust Level %d\n", ms_hyperv.vtl); +} + +int __init hv_vtl_early_init(void) +{ + return 0; +} +early_initcall(hv_vtl_

[PATCH v2 5/6] drivers/hv/vmbus: Get the irq number from DeviceTree

2024-05-14 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 via DeviceTree. Signed-off-by: Roman Kisel --- drivers/hv/vmbus_drv.c

[PATCH v2 1/6] arm64/hyperv: Support DeviceTree

2024-05-14 Thread Roman Kisel
The Virtual Trust Level platforms rely on DeviceTree, and the arm64/hyperv code supports ACPI only. Update the logic to support DeviceTree on boot as well as ACPI. Signed-off-by: Roman Kisel --- arch/arm64/hyperv/mshyperv.c | 34 +- 1 file changed, 29 insertions

[PATCH v2 6/6] drivers/pci/hyperv/arm64: vPCI MSI IRQ domain from DT

2024-05-14 Thread Roman Kisel
The hyperv-pci driver uses ACPI for MSI IRQ domain configuration on arm64 thereby it won't be able to do that in the VTL mode where only DeviceTree can be used. Update the hyperv-pci driver to discover interrupt configuration via DeviceTree. Signed-off-by: Roman Kisel --- driver

Re: [PATCH 1/6] arm64/hyperv: Support DeviceTree

2024-05-14 Thread Roman Kisel
On 5/14/2024 3:46 PM, Easwar Hariharan wrote: On 5/10/2024 10:42 AM, Roman Kisel wrote: On 5/10/2024 10:04 AM, Easwar Hariharan wrote: On 5/10/2024 9:05 AM, rom...@linux.microsoft.com wrote: From: Roman Kisel Update the driver to support DeviceTree boot as well along with ACPI. This

Re: [PATCH v2 5/6] drivers/hv/vmbus: Get the irq number from DeviceTree

2024-05-15 Thread Roman Kisel
On 5/15/2024 2:42 AM, Saurabh Singh Sengar wrote: On Tue, May 14, 2024 at 03:43:52PM -0700, Roman Kisel wrote: The vmbus driver uses ACPI for interrupt assignment on In subject use the prefix "Drivers: hv: vmbus:". It is preferred to us "VMbus/VMBus" instead of "

Re: [PATCH v2 6/6] drivers/pci/hyperv/arm64: vPCI MSI IRQ domain from DT

2024-05-15 Thread Roman Kisel
On 5/15/2024 2:48 AM, Saurabh Singh Sengar wrote: On Tue, May 14, 2024 at 03:43:53PM -0700, Roman Kisel wrote: The hyperv-pci driver uses ACPI for MSI IRQ domain configuration on arm64 thereby it won't be able to do that in the VTL mode where only DeviceTree can be used. Update the h

Re: [PATCH v2 5/6] drivers/hv/vmbus: Get the irq number from DeviceTree

2024-05-15 Thread Roman Kisel
On 5/15/2024 12:47 AM, Krzysztof Kozlowski wrote: On 15/05/2024 00:43, Roman Kisel wrote: 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 configuratio

Re: [PATCH v2 1/6] arm64/hyperv: Support DeviceTree

2024-05-15 Thread Roman Kisel
On 5/15/2024 12:45 AM, Krzysztof Kozlowski wrote: On 15/05/2024 00:43, Roman Kisel wrote: The Virtual Trust Level platforms rely on DeviceTree, and the arm64/hyperv code supports ACPI only. Update the logic to support DeviceTree on boot as well as ACPI. Signed-off-by: Roman Kisel

Re: [PATCH v2 2/6] drivers/hv: Enable VTL mode for arm64

2024-05-15 Thread Roman Kisel
On 5/15/2024 6:37 AM, Michael Kelley wrote: From: Roman Kisel Sent: Tuesday, May 14, 2024 3:44 PM 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

Re: [PATCH v2 3/6] drivers/hv: arch-neutral implementation of get_vtl()

2024-05-15 Thread Roman Kisel
On 5/15/2024 6:38 AM, Michael Kelley wrote: From: Roman Kisel Sent: Tuesday, May 14, 2024 3:44 PM 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

Re: [PATCH v2 4/6] arm64/hyperv: Boot in a Virtual Trust Level

2024-05-15 Thread Roman Kisel
On 5/15/2024 6:39 AM, Michael Kelley wrote: From: Roman Kisel Sent: Tuesday, May 14, 2024 3:44 PM 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 update the variable that stores the value. Update the variable to enable

Re: [PATCH v2 5/6] drivers/hv/vmbus: Get the irq number from DeviceTree

2024-05-15 Thread Roman Kisel
On 5/15/2024 6:44 AM, Michael Kelley wrote: From: Roman Kisel Sent: Tuesday, May 14, 2024 3:44 PM 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 inte

Re: [PATCH v2 6/6] drivers/pci/hyperv/arm64: vPCI MSI IRQ domain from DT

2024-05-15 Thread Roman Kisel
On 5/15/2024 6:47 AM, Michael Kelley wrote: From: Roman Kisel Sent: Tuesday, May 14, 2024 3:44 PM The hyperv-pci driver uses ACPI for MSI IRQ domain configuration on arm64 thereby it won't be able to do that in the VTL mode where only DeviceTree can be used. That sentence seems

Re: [PATCH v2 6/6] drivers/pci/hyperv/arm64: vPCI MSI IRQ domain from DT

2024-05-15 Thread Roman Kisel
On 5/15/2024 11:12 AM, Bjorn Helgaas wrote: On Wed, May 15, 2024 at 09:34:09AM -0700, Roman Kisel wrote: On 5/15/2024 2:48 AM, Saurabh Singh Sengar wrote: On Tue, May 14, 2024 at 03:43:53PM -0700, Roman Kisel wrote: The hyperv-pci driver uses ACPI for MSI IRQ domain configuration on

Re: [PATCH v2 1/6] arm64/hyperv: Support DeviceTree

2024-05-16 Thread Roman Kisel
On 5/15/2024 3:02 PM, Elliot Berman wrote: On Tue, May 14, 2024 at 03:43:48PM -0700, Roman Kisel wrote: The Virtual Trust Level platforms rely on DeviceTree, and the arm64/hyperv code supports ACPI only. Update the logic to support DeviceTree on boot as well as ACPI. Could you use Call UID

Re: [PATCH 2/6] drivers/hv: Enable VTL mode for arm64

2024-05-20 Thread Roman Kisel
On 5/15/2024 12:43 AM, Wei Liu wrote: On Fri, May 10, 2024 at 09:05:01AM -0700, rom...@linux.microsoft.com wrote: From: Roman Kisel This change removes dependency on ACPI when buidling the hv drivers to allow Virtual Trust Level boot with DeviceTree. Signed-off-by: Roman Kisel

Re: [PATCH 1/6] arm64/hyperv: Support DeviceTree

2024-05-20 Thread Roman Kisel
On 5/14/2024 5:00 PM, Easwar Hariharan wrote: On 5/14/2024 4:17 PM, Roman Kisel wrote: On 5/14/2024 3:46 PM, Easwar Hariharan wrote: On 5/10/2024 10:42 AM, Roman Kisel wrote: On 5/10/2024 10:04 AM, Easwar Hariharan wrote: On 5/10/2024 9:05 AM, rom...@linux.microsoft.com wrote: From

Re: [PATCH v2 5/6] drivers/hv/vmbus: Get the irq number from DeviceTree

2024-05-20 Thread Roman Kisel
On 5/17/2024 10:14 AM, Rob Herring wrote: On Tue, May 14, 2024 at 5:45 PM Roman Kisel wrote: 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 configur

Re: [PATCH v2 1/6] arm64/hyperv: Support DeviceTree

2024-05-20 Thread Roman Kisel
On 5/19/2024 11:45 PM, Krzysztof Kozlowski wrote: On 15/05/2024 19:33, Roman Kisel wrote: static bool hyperv_initialized; @@ -27,6 +30,29 @@ int hv_get_hypervisor_version(union hv_hypervisor_version_info *info) return 0; } +static bool hyperv_detect_fdt(void) +{ +#ifdef

Re: [PATCH v2 6/6] drivers/pci/hyperv/arm64: vPCI MSI IRQ domain from DT

2024-06-11 Thread Roman Kisel
On 6/7/2024 12:55 PM, Bjorn Helgaas wrote: On Wed, May 15, 2024 at 01:12:38PM -0500, Bjorn Helgaas wrote: On Wed, May 15, 2024 at 09:34:09AM -0700, Roman Kisel wrote: On 5/15/2024 2:48 AM, Saurabh Singh Sengar wrote: On Tue, May 14, 2024 at 03:43:53PM -0700, Roman Kisel wrote: The

Re: [PATCH 1/1] x86/hyperv: Set X86_FEATURE_TSC_KNOWN_FREQ when Hyper-V provides frequency

2024-06-11 Thread Roman Kisel
t_tsc_khz; x86_platform.calibrate_cpu = hv_get_tsc_khz; + setup_force_cpu_cap(X86_FEATURE_TSC_KNOWN_FREQ); } if (ms_hyperv.priv_high & HV_ISOLATION) { LGTM Reviewed-by: Roman Kisel -- Thank you, Roman

Re: [PATCH v2 1/6] arm64/hyperv: Support DeviceTree

2024-06-11 Thread Roman Kisel
On 5/16/2024 8:27 AM, Roman Kisel wrote: On 5/15/2024 3:02 PM, Elliot Berman wrote: On Tue, May 14, 2024 at 03:43:48PM -0700, Roman Kisel wrote: The Virtual Trust Level platforms rely on DeviceTree, and the arm64/hyperv code supports ACPI only. Update the logic to support DeviceTree on

Re: [PATCH] clocksource: hyper-v: Use lapic timer in a TDX VM without paravisor

2024-06-20 Thread Roman Kisel
ng = 1000; + ce->set_state_shutdown = hv_ce_shutdown; ce->set_state_oneshot = hv_ce_set_oneshot; ce->set_next_event = hv_ce_set_next_event; LGTM. Reviewed-by: Roman Kisel -- Thank you, Roman

[PATCH v3 0/7] arm64: hyperv: Support Virtual Trust Level Boot

2024-07-26 Thread Roman Kisel
For validation, I built kernels for the arch'es in question with the small initrd embedded into the kernel and booted the Hyper-V VMs off of that. Roman Kisel (7): arm64: hyperv: Use SMC to detect hypervisor presence Drivers: hv: Enable VTL mode for arm64 Drivers: hv: Provide arch-neutra

[PATCH v3 1/7] arm64: hyperv: Use SMC to detect hypervisor presence

2024-07-26 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, use the new SMC added recently to Hyper-V to use in the non-ACPI case. Signed-off-by: Roman

[PATCH v3 2/7] Drivers: hv: Enable VTL mode for arm64

2024-07-26 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. Signed-off-by: Roman

[PATCH v3 4/7] arm64: hyperv: Boot in a Virtual Trust Level

2024-07-26 Thread Roman Kisel
a/arch/arm64/hyperv/hv_vtl.c b/arch/arm64/hyperv/hv_vtl.c new file mode 100644 index ..38642b7b6be0 --- /dev/null +++ b/arch/arm64/hyperv/hv_vtl.c @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2024, Microsoft, Inc. + * + * Author : Roman Kisel

[PATCH v3 3/7] Drivers: hv: Provide arch-neutral implementation of get_vtl()

2024-07-26 Thread Roman Kisel
output address in `get_vtl(void)` not to overlap with the hypercall input area to adhere to the Hyper-V TLFS. Signed-off-by: Roman Kisel --- arch/x86/hyperv/hv_init.c | 34 - arch/x86/include/asm/hyperv-tlfs.h | 7 - drivers/hv/hv_common.c | 47

[PATCH v3 5/7] dt-bindings: bus: Add Hyper-V VMBus cache coherency and IRQs

2024-07-26 Thread Roman Kisel
Add dt-bindings for the Hyper-V VMBus DMA cache coherency and interrupt specification. Signed-off-by: Roman Kisel --- .../devicetree/bindings/bus/microsoft,vmbus.yaml | 11 +++ 1 file changed, 11 insertions(+) diff --git a/Documentation/devicetree/bindings/bus/microsoft,vmbus.yaml

[PATCH v3 6/7] Drivers: hv: vmbus: Get the IRQ number from DT

2024-07-26 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 via DeviceTree and indicate DMA cache coherency. Signed-off-by: Roman Kisel --- drive

[PATCH v3 7/7] PCI: hv: Get vPCI MSI IRQ domain from DT

2024-07-26 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/hv/vmbus_

Re: [PATCH v3 5/7] dt-bindings: bus: Add Hyper-V VMBus cache coherency and IRQs

2024-07-29 Thread Roman Kisel
On 7/27/2024 1:53 AM, Krzysztof Kozlowski wrote: On 27/07/2024 00:59, Roman Kisel wrote: Add dt-bindings for the Hyper-V VMBus DMA cache coherency and interrupt specification. You did not add any bindings. I don't understand this description. My bad, extended the example fo

Re: [PATCH v3 6/7] Drivers: hv: vmbus: Get the IRQ number from DT

2024-07-29 Thread Roman Kisel
On 7/27/2024 1:56 AM, Krzysztof Kozlowski wrote: On 27/07/2024 00:59, Roman Kisel wrote: @@ -2338,6 +2372,21 @@ static int vmbus_device_add(struct platform_device *pdev) cur_res = &res->sibling; } + /* +* Hyper-V always assumes DMA cache coherency,

Re: [PATCH v3 6/7] Drivers: hv: vmbus: Get the IRQ number from DT

2024-07-29 Thread Roman Kisel
On 7/27/2024 2:17 AM, Arnd Bergmann wrote: On Sat, Jul 27, 2024, at 10:56, Krzysztof Kozlowski wrote: On 27/07/2024 00:59, Roman Kisel wrote: @@ -2338,6 +2372,21 @@ static int vmbus_device_add(struct platform_device *pdev) cur_res = &res->

[PATCH] Drivers: hv: vmbus: Fix the misplaced function description

2024-08-01 Thread Roman Kisel
When hv_synic_disable_regs was introduced, it received the description of hv_synic_cleanup. Fix that. Fixes: dba61cda3046 ("Drivers: hv: vmbus: Break out synic enable and disable operations") Signed-off-by: Roman Kisel --- drivers/hv/hv.c | 6 +++--- 1 file changed, 3 insert

Re: [PATCH v3 7/7] PCI: hv: Get vPCI MSI IRQ domain from DT

2024-08-05 Thread Roman Kisel
On 8/2/2024 6:20 PM, Wei Liu wrote: On Fri, Jul 26, 2024 at 03:59:10PM -0700, Roman Kisel wrote: 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

Re: [PATCH v3 1/7] arm64: hyperv: Use SMC to detect hypervisor presence

2024-08-05 Thread Roman Kisel
On 8/2/2024 6:21 PM, Wei Liu wrote: On Fri, Jul 26, 2024 at 03:59:04PM -0700, Roman Kisel wrote: 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 sep

Re: [PATCH v3 4/7] arm64: hyperv: Boot in a Virtual Trust Level

2024-08-05 Thread Roman Kisel
On 8/2/2024 6:22 PM, Wei Liu wrote: On Fri, Jul 26, 2024 at 03:59:07PM -0700, Roman Kisel wrote: 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 update the variable that stores the value. Update the variable to enable the

Re: [PATCH v3 1/7] arm64: hyperv: Use SMC to detect hypervisor presence

2024-08-05 Thread Roman Kisel
On 8/4/2024 8:53 PM, Saurabh Singh Sengar wrote: On Fri, Jul 26, 2024 at 03:59:04PM -0700, Roman Kisel wrote: 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 i

Re: [PATCH v3 2/7] Drivers: hv: Enable VTL mode for arm64

2024-08-05 Thread Roman Kisel
On 8/4/2024 9:05 PM, Saurabh Singh Sengar wrote: On Mon, Aug 05, 2024 at 03:01:58AM +, Michael Kelley wrote: From: Roman Kisel Sent: Friday, July 26, 2024 3:59 PM Kconfig dependencies for arm64 guests on Hyper-V require that be ACPI enabled, and limit VTL mode to x86/x64. To enable

Re: [PATCH v3 4/7] arm64: hyperv: Boot in a Virtual Trust Level

2024-08-05 Thread Roman Kisel
On 8/4/2024 11:28 PM, Saurabh Singh Sengar wrote: On Fri, Jul 26, 2024 at 03:59:07PM -0700, Roman Kisel wrote: 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 update the variable that stores the value. Update the variable

Re: [PATCH v3 6/7] Drivers: hv: vmbus: Get the IRQ number from DT

2024-08-05 Thread Roman Kisel
On 8/5/2024 7:12 AM, Michael Kelley wrote: From: Saurabh Singh Sengar Sent: Monday, August 5, 2024 1:30 AM On Fri, Jul 26, 2024 at 03:59:09PM -0700, Roman Kisel wrote: The VMBus driver uses ACPI for interrupt assignment on arm64 hence it won't function in the VTL mode where

Re: [PATCH v3 1/7] arm64: hyperv: Use SMC to detect hypervisor presence

2024-08-05 Thread Roman Kisel
On 8/5/2024 8:46 AM, Saurabh Singh Sengar wrote: On Mon, Aug 05, 2024 at 08:17:05AM -0700, Roman Kisel wrote: On 8/4/2024 8:53 PM, Saurabh Singh Sengar wrote: On Fri, Jul 26, 2024 at 03:59:04PM -0700, Roman Kisel wrote: The arm64 Hyper-V startup path relies on ACPI to detect running

Re: [PATCH v3 7/7] PCI: hv: Get vPCI MSI IRQ domain from DT

2024-08-05 Thread Roman Kisel
On 8/5/2024 7:51 AM, Roman Kisel wrote: On 8/2/2024 6:20 PM, Wei Liu wrote: On Fri, Jul 26, 2024 at 03:59:10PM -0700, Roman Kisel wrote: 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

Re: [PATCH v3 3/7] Drivers: hv: Provide arch-neutral implementation of get_vtl()

2024-08-05 Thread Roman Kisel
On 8/4/2024 8:02 PM, Michael Kelley wrote: From: Roman Kisel Sent: Friday, July 26, 2024 3:59 PM 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

Re: [PATCH v3 4/7] arm64: hyperv: Boot in a Virtual Trust Level

2024-08-05 Thread Roman Kisel
On 8/4/2024 8:02 PM, Michael Kelley wrote: From: Roman Kisel Sent: Friday, July 26, 2024 3:59 PM 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 update the variable that stores the value. Update the variable to enable

Re: [PATCH v3 6/7] Drivers: hv: vmbus: Get the IRQ number from DT

2024-08-05 Thread Roman Kisel
On 8/4/2024 8:03 PM, Michael Kelley wrote: From: Roman Kisel Sent: Monday, July 29, 2024 9:51 AM On 7/27/2024 2:17 AM, Arnd Bergmann wrote: On Sat, Jul 27, 2024, at 10:56, Krzysztof Kozlowski wrote: On 27/07/2024 00:59, Roman Kisel wrote: @@ -2338,6 +2372,21 @@ static int

Re: [PATCH v3 7/7] PCI: hv: Get vPCI MSI IRQ domain from DT

2024-08-05 Thread Roman Kisel
On 8/4/2024 8:03 PM, Michael Kelley wrote: From: Roman Kisel Sent: Friday, July 26, 2024 3:59 PM 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 t

Re: [PATCH v3 1/7] arm64: hyperv: Use SMC to detect hypervisor presence

2024-08-05 Thread Roman Kisel
On 8/4/2024 8:01 PM, Michael Kelley wrote: From: Roman Kisel Sent: Friday, July 26, 2024 3:59 PM 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 sep

Re: [PATCH v3 1/7] arm64: hyperv: Use SMC to detect hypervisor presence

2024-08-05 Thread Roman Kisel
On 8/5/2024 1:30 PM, Michael Kelley wrote: From: Roman Kisel Sent: Monday, August 5, 2024 9:51 AM [snip] diff --git a/arch/arm64/include/asm/mshyperv.h b/arch/arm64/include/asm/mshyperv.h index a975e1a689dd..a7a3586f7cb1 100644 --- a/arch/arm64/include/asm/mshyperv.h +++ b/arch/arm64

Re: [PATCH v3 3/7] Drivers: hv: Provide arch-neutral implementation of get_vtl()

2024-08-05 Thread Roman Kisel
On 8/5/2024 1:13 PM, Michael Kelley wrote: From: Roman Kisel Sent: Monday, August 5, 2024 9:20 AM On 8/4/2024 8:02 PM, Michael Kelley wrote: From: Roman Kisel Sent: Friday, July 26, 2024 3:59 PM To run in the VTL mode, Hyper-V drivers have to know what VTL the system boots in, and

RE: [PATCH v3 2/7] Drivers: hv: Enable VTL mode for arm64

2024-08-05 Thread Roman Kisel
> > > > On 8/4/2024 9:05 PM, Saurabh Singh Sengar wrote: > > > On Mon, Aug 05, 2024 at 03:01:58AM +, Michael Kelley wrote: > > >> From: Roman Kisel Sent: Friday, July 26, > > >> 2024 3:59 > > PM > > >>> > > &

Re: [PATCH v5 3/5] hyperv: Enable the hypercall output page for the VTL mode

2025-01-06 Thread Roman Kisel
On 1/6/2025 11:32 AM, Stanislav Kinsburskii wrote: On Mon, Jan 06, 2025 at 10:11:16AM -0800, Roman Kisel wrote: [...]s From my POV a decision between a unified approach and interim solutions in upstream should usually be resolved in favor of the former. Given there are different stake

Re: [PATCH v5 1/5] hyperv: Define struct hv_output_get_vp_registers

2025-01-06 Thread Roman Kisel
On 1/6/2025 9:37 AM, Michael Kelley wrote: From: Roman Kisel Sent: Monday, December 30, 2024 10:10 AM [...] These bit field definitions don't look right. We want to "fill up" the field size, so that we're explicit about each bit, and not leave it to the compiler t

Re: [PATCH v5 3/5] hyperv: Enable the hypercall output page for the VTL mode

2025-01-06 Thread Roman Kisel
On 1/6/2025 9:11 AM, Stanislav Kinsburskii wrote: On Fri, Jan 03, 2025 at 01:39:29PM -0800, Roman Kisel wrote: [...] The issue is that when you boot the same kernel in both VTL0 and VTL1+, the pages will be allocated in any case (root or guest, VTL0 or VTL1+). I think we share we

Re: [PATCH v5 3/5] hyperv: Enable the hypercall output page for the VTL mode

2025-01-03 Thread Roman Kisel
On 1/3/2025 11:20 AM, Stanislav Kinsburskii wrote: On Mon, Dec 30, 2024 at 10:09:39AM -0800, Roman Kisel wrote: Due to the hypercall page not being allocated in the VTL mode, the code resorts to using a part of the input page. Allocate the hypercall output page in the VTL mode thus enabling

Re: [PATCH v5 3/5] hyperv: Enable the hypercall output page for the VTL mode

2025-01-07 Thread Roman Kisel
On 1/7/2025 11:18 AM, Stanislav Kinsburskii wrote: On Mon, Jan 06, 2025 at 01:07:25PM -0800, Roman Kisel wrote: [...] My point is that the proposed fix looks more like an Underhill-tailored bandage and doesn't take the needs of other stake holders into consideration. The patch tak

Re: [PATCH v4 1/5] hyperv: Define struct hv_output_get_vp_registers

2024-12-30 Thread Roman Kisel
On 12/29/2024 9:46 AM, Michael Kelley wrote: From: Roman Kisel Sent: Friday, December 27, 2024 10:32 AM [...] From a thread [1] with Nuno, my understanding is that the include/hyperv/* files should *not* use #ifdef unless strictly necessary because a structure or symbol is used in

[PATCH v5 0/5] hyperv: Fixes for get_vtl(), hv_vtl_apicid_to_vp_id()

2024-12-30 Thread Roman Kisel
e to improve code readability, - Split out the patch with that definition. [v1]: https://lore.kernel.org/lkml/20241218205421.319969-1-rom...@linux.microsoft.com/ Roman Kisel (5): hyperv: Define struct hv_output_get_vp_registers hyperv: Fix pointer type in get_vtl(void) hyperv: Enable the

[PATCH v5 2/5] hyperv: Fix pointer type in get_vtl(void)

2024-12-30 Thread Roman Kisel
pe for the output of the GetVpRegisters hypercall. Signed-off-by: Roman Kisel --- arch/x86/hyperv/hv_init.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c index 9e5e8328df6b..f82d1aefaa8a 100644 --- a/arch/x86/hyperv

[PATCH v5 5/5] hyperv: Do not overlap the hvcall IO areas in hv_vtl_apicid_to_vp_id()

2024-12-30 Thread Roman Kisel
/virtualization/hyper-v-on-windows/tlfs/hypercall-interface [2] https://github.com/MicrosoftDocs/Virtualization-Documentation/tree/main/tlfs Reported-by: Michael Kelley Closes: https://lore.kernel.org/lkml/sn6pr02mb4157b98cd34781cc87a9d921d4...@sn6pr02mb4157.namprd02.prod.outlook.com/ Signed-off-by: Roman

[PATCH v5 4/5] hyperv: Do not overlap the hvcall IO areas in get_vtl()

2024-12-30 Thread Roman Kisel
/hyper-v-on-windows/tlfs/hypercall-interface [2] https://github.com/MicrosoftDocs/Virtualization-Documentation/tree/main/tlfs Fixes: 8387ce06d70b ("x86/hyperv: Set Virtual Trust Level in VMBus init message") Signed-off-by: Roman Kisel --- arch/x86/hyperv/hv_init.c | 2 +- 1 file

[PATCH v5 1/5] hyperv: Define struct hv_output_get_vp_registers

2024-12-30 Thread Roman Kisel
enable using the GetVpRegisters hypercall. Make provisions for all supported architectures. No functional changes. Signed-off-by: Roman Kisel --- include/hyperv/hvgdk_mini.h | 49 + 1 file changed, 49 insertions(+) diff --git a/include/hyperv/hvgdk_mini.h b

[PATCH v5 3/5] hyperv: Enable the hypercall output page for the VTL mode

2024-12-30 Thread Roman Kisel
Due to the hypercall page not being allocated in the VTL mode, the code resorts to using a part of the input page. Allocate the hypercall output page in the VTL mode thus enabling it to use it for output and share code with dom0. Signed-off-by: Roman Kisel --- drivers/hv/hv_common.c | 6

[PATCH v4 0/5] hyperv: Fixes for get_vtl(), hv_vtl_apicid_to_vp_id()

2024-12-27 Thread Roman Kisel
https://lore.kernel.org/lkml/20241226203050.800524-1-rom...@linux.microsoft.com/ - Used the suggestions to define an additional structure to improve code readability, - Split out the patch with that definition. [v1]: https://lore.kernel.org/lkml/20241218205421.319969-1-rom...@linux.microsoft.com/ Roman Kise

[PATCH v4 3/5] hyperv: Enable the hypercall output page for the VTL mode

2024-12-27 Thread Roman Kisel
Due to the hypercall page not being allocated in the VTL mode, the code resorts to using a part of the input page. Allocate the hypercall output page in the VTL mode thus enabling it to use it for output and share code with dom0. Signed-off-by: Roman Kisel --- drivers/hv/hv_common.c | 6

[PATCH v4 2/5] hyperv: Fix pointer type in get_vtl(void)

2024-12-27 Thread Roman Kisel
pe for the output of the GetVpRegisters hypercall. Signed-off-by: Roman Kisel --- arch/x86/hyperv/hv_init.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c index 9e5e8328df6b..f82d1aefaa8a 100644 --- a/arch/x86/hyperv

[PATCH v4 5/5] hyperv: Do not overlap the hvcall IO areas in hv_vtl_apicid_to_vp_id()

2024-12-27 Thread Roman Kisel
/virtualization/hyper-v-on-windows/tlfs/hypercall-interface [2] https://github.com/MicrosoftDocs/Virtualization-Documentation/tree/main/tlfs Reported-by: Michael Kelley Closes: https://lore.kernel.org/lkml/sn6pr02mb4157b98cd34781cc87a9d921d4...@sn6pr02mb4157.namprd02.prod.outlook.com/ Signed-off-by: Roman

[PATCH v4 1/5] hyperv: Define struct hv_output_get_vp_registers

2024-12-27 Thread Roman Kisel
enable using the GetVpRegisters hypercall. Make provisions for all supported architectures. No functional changes. Signed-off-by: Roman Kisel --- include/hyperv/hvgdk_mini.h | 65 +++-- 1 file changed, 63 insertions(+), 2 deletions(-) diff --git a/include/hyperv

[PATCH v4 4/5] hyperv: Do not overlap the hvcall IO areas in get_vtl()

2024-12-27 Thread Roman Kisel
/hyper-v-on-windows/tlfs/hypercall-interface [2] https://github.com/MicrosoftDocs/Virtualization-Documentation/tree/main/tlfs Fixes: 8387ce06d70b ("x86/hyperv: Set Virtual Trust Level in VMBus init message") Signed-off-by: Roman Kisel --- arch/x86/hyperv/hv_init.c | 2 +- 1 file

[PATCH v2 1/3] hyperv: Define struct hv_output_get_vp_registers

2024-12-26 Thread Roman Kisel
enable using the GetVpRegisters hypercall. Make provisions for all supported architectures. No functional changes. Signed-off-by: Roman Kisel --- include/hyperv/hvgdk_mini.h | 58 +++-- 1 file changed, 56 insertions(+), 2 deletions(-) diff --git a/include/hyperv

[PATCH v2 3/3] hyperv: Do not overlap the input and output hypercall areas in get_vtl(void)

2024-12-26 Thread Roman Kisel
ssage") Signed-off-by: Roman Kisel --- arch/x86/hyperv/hv_init.c | 2 +- drivers/hv/hv_common.c| 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c index ba469d6b8250..cf3f7d30fcdd 100644 --- a/arch/x86/hyperv

[PATCH v2 0/3] hyperv: Fixes for get_vtl(void)

2024-12-26 Thread Roman Kisel
9-1-rom...@linux.microsoft.com/ Roman Kisel (3): hyperv: Define struct hv_output_get_vp_registers hyperv: Fix pointer type for the output of the hypercall in get_vtl(void) hyperv: Do not overlap the input and output hypercall areas in get_vtl(void) arch/x86/hyperv/hv_init.c |

[PATCH v2 2/3] hyperv: Fix pointer type for the output of the hypercall in get_vtl(void)

2024-12-26 Thread Roman Kisel
pe for the output of the GetVpRegisters hypercall. Signed-off-by: Roman Kisel --- arch/x86/hyperv/hv_init.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c index 3cf2a227d666..ba469d6b8250 100644 --- a/arch/x86/hyperv

Re: [PATCH 2/2] hyperv: Do not overlap the input and output hypercall areas in get_vtl(void)

2024-12-26 Thread Roman Kisel
On 12/26/2024 12:04 PM, Michael Kelley wrote: [...] As I was looking at how hypercall input and output arguments are managed in upstream code and in the OHCL-Linux-Kernel repo, I noticed two things: 1) There's a bug in mshv_vtl_hvcall_call() in the OHCL-Linux-Kernel repo, for which I filed

Re: [PATCH v3 5/5] hyperv: Do not overlap the hvcall IO areas in hv_vtl_apicid_to_vp_id()

2024-12-27 Thread Roman Kisel
On 12/26/2024 2:01 PM, Easwar Hariharan wrote: On 12/26/2024 1:31 PM, Roman Kisel wrote: The Top-Level Functional Specification for Hyper-V, Section 3.6 [1, 2], disallows overlapping of the input and output hypercall areas, and hv_vtl_apicid_to_vp_id() overlaps them. Use the output

Re: [PATCH v3 1/5] hyperv: Define struct hv_output_get_vp_registers

2024-12-27 Thread Roman Kisel
On 12/26/2024 2:11 PM, Easwar Hariharan wrote: On 12/26/2024 1:31 PM, Roman Kisel wrote: [...] +#else + #error "This architecture is not supported" +#endif +}; I don't love the #error for unsupported architectures when Kconfig takes care of that for us, but I s

Re: [PATCH v4 0/5] hyperv: Fixes for get_vtl(), hv_vtl_apicid_to_vp_id()

2024-12-27 Thread Roman Kisel
On 12/27/2024 10:42 AM, Easwar Hariharan wrote: On 12/27/2024 10:31 AM, Roman Kisel wrote: [...] Thank you for the persistence! I feel most fortunate learning from you, Michael, and Nuno :) Thank you! For the series, Reviewed-by: Easwar Hariharan -- Thank you, Roman

Re: [PATCH 2/2] hyperv: Do not overlap the input and output hypercall areas in get_vtl(void)

2024-12-26 Thread Roman Kisel
On 12/24/2024 8:45 AM, Michael Kelley wrote: [...] OK, my understanding is that your concern about spec conformance is just that Linux should be able to allocate enough input and output space for the maximum case, which is 4KiB of input *plus* 4KiB of output. If the total amount of input pl

[PATCH v3 1/5] hyperv: Define struct hv_output_get_vp_registers

2024-12-26 Thread Roman Kisel
enable using the GetVpRegisters hypercall. Make provisions for all supported architectures. No functional changes. Signed-off-by: Roman Kisel --- include/hyperv/hvgdk_mini.h | 58 +++-- 1 file changed, 56 insertions(+), 2 deletions(-) diff --git a/include/hyperv

[PATCH v3 2/5] hyperv: Fix pointer type for the output of the hypercall in get_vtl(void)

2024-12-26 Thread Roman Kisel
pe for the output of the GetVpRegisters hypercall. Signed-off-by: Roman Kisel --- arch/x86/hyperv/hv_init.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c index 3cf2a227d666..ba469d6b8250 100644 --- a/arch/x86/hyperv

[PATCH v3 3/5] hyperv: Enable the hypercall output page for the VTL mode

2024-12-26 Thread Roman Kisel
Due to the hypercall page not being allocated in the VTL mode, the code resorts to using a part of the input page. Allocate the hypercall output page in the VTL mode thus enabling it to use it for output and share code with dom0. Signed-off-by: Roman Kisel --- drivers/hv/hv_common.c | 6

[PATCH v3 4/5] hyperv: Do not overlap the hvcall IO areas in get_vtl()

2024-12-26 Thread Roman Kisel
/hyper-v-on-windows/tlfs/hypercall-interface [2] https://github.com/MicrosoftDocs/Virtualization-Documentation/tree/main/tlfs Fixes: 8387ce06d70b ("x86/hyperv: Set Virtual Trust Level in VMBus init message") Signed-off-by: Roman Kisel --- arch/x86/hyperv/hv_init.c | 2 +- 1 file

[PATCH v3 0/5] hyperv: Fixes for get_vtl(), hv_vtl_apicid_to_vp_id()

2024-12-26 Thread Roman Kisel
https://lore.kernel.org/lkml/20241226203050.800524-1-rom...@linux.microsoft.com/ - Used the suggestions to define an additional structure to improve code readability, - Split out the patch with that definition. [v1]: https://lore.kernel.org/lkml/20241218205421.319969-1-rom...@linux.microsoft.com/ Rom

[PATCH v3 5/5] hyperv: Do not overlap the hvcall IO areas in hv_vtl_apicid_to_vp_id()

2024-12-26 Thread Roman Kisel
/virtualization/hyper-v-on-windows/tlfs/hypercall-interface [2] https://github.com/MicrosoftDocs/Virtualization-Documentation/tree/main/tlfs Signed-off-by: Roman Kisel --- arch/x86/hyperv/hv_vtl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/hyperv/hv_vtl.c b/arch/x86/hyperv

[PATCH 0/2] hyperv: Fixes for get_vtl(void)

2024-12-18 Thread Roman Kisel
using OpenVMM and OpenHCL[3, 4]. [1] https://learn.microsoft.com/en-us/virtualization/hyper-v-on-windows/tlfs/hypercall-interface [2] https://github.com/MicrosoftDocs/Virtualization-Documentation/tree/main/tlfs [3] https://openvmm.dev/guide/user_guide/openhcl.html [4] https://github.com/microsoft/OpenVMM Ro

[PATCH 2/2] hyperv: Do not overlap the input and output hypercall areas in get_vtl(void)

2024-12-18 Thread Roman Kisel
ssage") Signed-off-by: Roman Kisel --- arch/x86/hyperv/hv_init.c | 2 +- drivers/hv/hv_common.c| 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c index c7185c6a290b..90c9ea00273e 100644 --- a/arch/x86/hyperv

[PATCH 1/2] hyperv: Fix pointer type for the output of the hypercall in get_vtl(void)

2024-12-18 Thread Roman Kisel
pe for the output of the GetVpRegisters hypercall. Fixes: bc905fa8b633 ("hyperv: Switch from hyperv-tlfs.h to hyperv/hvhdk.h") Signed-off-by: Roman Kisel --- arch/x86/hyperv/hv_init.c | 6 +++--- include/hyperv/hvgdk_mini.h | 3 --- 2 files changed, 3 insertions(+), 6 deletions(-) d

Re: [PATCH] tools: hv: Fix cross-compilation

2024-12-13 Thread Roman Kisel
Thanks, LGTM! Reviewed-by: Roman Kisel On 12/12/2024 12:28 AM, Saurabh Sengar wrote: Use the native ARCH only incase it is not set, this will allow the cross complilation where ARCH is explicitly set. Add few info prints as well to know what arch and toolchain is getting used to build it

Re: [PATCH 1/2] hyperv: Fix pointer type for the output of the hypercall in get_vtl(void)

2024-12-19 Thread Roman Kisel
On 12/18/2024 6:45 PM, Wei Liu wrote: On Wed, Dec 18, 2024 at 12:54:20PM -0800, Roman Kisel wrote: Commit bc905fa8b633 ("hyperv: Switch from hyperv-tlfs.h to hyperv/hvhdk.h") changed the type of the output pointer to `struct hv_register_assoc` from `struct hv_get_vp_registers_out

Re: [PATCH 1/2] hyperv: Fix pointer type for the output of the hypercall in get_vtl(void)

2024-12-19 Thread Roman Kisel
On 12/19/2024 12:04 PM, Easwar Hariharan wrote: [snip] This could be accompanied with migration of hv_get_vpreg128 in arm64/ and removal of struct hv_get_registers_output, or that could be deferred to a later patch. [snip] To clarify, I didn't mean to include implementing extended fa

Re: [PATCH 2/2] hyperv: Do not overlap the input and output hypercall areas in get_vtl(void)

2024-12-19 Thread Roman Kisel
On 12/18/2024 6:42 PM, Wei Liu wrote: On Wed, Dec 18, 2024 at 12:54:21PM -0800, Roman Kisel wrote: The Top-Level Functional Specification for Hyper-V, Section 3.6 [1, 2], disallows overlapping of the input and output hypercall areas, and get_vtl(void) does overlap them. To fix this, enable

Re: [PATCH 1/2] hyperv: Fix pointer type for the output of the hypercall in get_vtl(void)

2024-12-19 Thread Roman Kisel
On 12/19/2024 10:40 AM, Nuno Das Neves wrote: On 12/18/2024 12:54 PM, Roman Kisel wrote: Commit bc905fa8b633 ("hyperv: Switch from hyperv-tlfs.h to hyperv/hvhdk.h") changed the type of the output pointer to `struct hv_register_assoc` from `struct hv_get_vp_registers_output`. That l

Re: [PATCH 1/2] hyperv: Fix pointer type for the output of the hypercall in get_vtl(void)

2024-12-19 Thread Roman Kisel
On 12/19/2024 11:32 AM, Easwar Hariharan wrote: On 12/19/2024 11:23 AM, Nuno Das Neves wrote: On 12/19/2024 11:13 AM, Easwar Hariharan wrote: On 12/19/2024 10:40 AM, Nuno Das Neves wrote: On 12/18/2024 12:54 PM, Roman Kisel wrote: Commit bc905fa8b633 ("hyperv: Switch from hyperv-tlfs

Re: [PATCH 1/2] hyperv: Fix pointer type for the output of the hypercall in get_vtl(void)

2024-12-19 Thread Roman Kisel
On 12/19/2024 11:13 AM, Easwar Hariharan wrote: On 12/19/2024 10:40 AM, Nuno Das Neves wrote: On 12/18/2024 12:54 PM, Roman Kisel wrote: Commit bc905fa8b633 ("hyperv: Switch from hyperv-tlfs.h to hyperv/hvhdk.h") changed the type of the output pointer to `struct hv_register_a

  1   2   >