From patchwork Tue May 14 22:43:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Kisel X-Patchwork-Id: 796759 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7B93D181D08; Tue, 14 May 2024 22:45:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715726730; cv=none; b=Ico4/m1RTYbgJMjvrlRG7q2Zp8gG+RGFqzoKC+D9GUHKlZnmuY4LRHPBU1pOAVmzHq95Limu26i+cv2Ayi2zvvoX6wub7ZneFP+Vc/tOpDBIEDUBXBkXn9iXgx7ngbhtJKH24+NkblC+IEc/WgPz5FR4CPaBEx/TXIQS3BUpkB0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715726730; c=relaxed/simple; bh=LxzjesEa2yrOp7NiBZaeavpLyG8UmGpbdareqGavSSM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iAHtQP4VRfigbWOysbdqf+CIS3i1J64P7uWuoCzsZ3AbDjJ2aAmBBrdY4R8MQtpm6zGTJRos7XjpFe1StYgorWV0QXxz/IUvhig0ZBFxt44Av5CNISZNbqu+7CAsrtMQZZVL5Ni05bU0SlbY4QKuCcVL3McbKyDbvgaRNDZrCsw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=kkK+sB9O; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="kkK+sB9O" Received: from xps-8930.corp.microsoft.com (unknown [131.107.160.48]) by linux.microsoft.com (Postfix) with ESMTPSA id CEA242095D0B; Tue, 14 May 2024 15:45:20 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com CEA242095D0B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1715726721; bh=gy5I6n1XdVqSkd/zdu3TEf1Kw11JgiudWXaTRTptXPI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kkK+sB9Ob6YQYJHnZe+I7bfizHzznTUhZEzNZYosbYY9NSZiLEGrYc+XgvtsCC65p ZeXmurF1PgbwOg9frqVYVBYJNQXp8OPnu+2+qge5d/vDvBkEW9yj3wY/CduAq4tscq 5f2yr0cYzCE254biGL/prCEZ2KvXAIOrOSNILTf4= From: Roman Kisel To: arnd@arndb.de, bhelgaas@google.com, bp@alien8.de, catalin.marinas@arm.com, dave.hansen@linux.intel.com, decui@microsoft.com, haiyangz@microsoft.com, hpa@zytor.com, kw@linux.com, kys@microsoft.com, lenb@kernel.org, lpieralisi@kernel.org, mingo@redhat.com, mhklinux@outlook.com, rafael@kernel.org, robh@kernel.org, tglx@linutronix.de, wei.liu@kernel.org, will@kernel.org, linux-acpi@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, x86@kernel.org Cc: ssengar@microsoft.com, sunilmut@microsoft.com, vdso@hexbites.dev Subject: [PATCH v2 1/6] arm64/hyperv: Support DeviceTree Date: Tue, 14 May 2024 15:43:48 -0700 Message-ID: <20240514224508.212318-2-romank@linux.microsoft.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240514224508.212318-1-romank@linux.microsoft.com> References: <20240514224508.212318-1-romank@linux.microsoft.com> Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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(+), 5 deletions(-) diff --git a/arch/arm64/hyperv/mshyperv.c b/arch/arm64/hyperv/mshyperv.c index b1a4de4eee29..208a3bcb9686 100644 --- a/arch/arm64/hyperv/mshyperv.c +++ b/arch/arm64/hyperv/mshyperv.c @@ -15,6 +15,9 @@ #include #include #include +#include +#include +#include #include 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 CONFIG_OF + const unsigned long hyp_node = of_get_flat_dt_subnode_by_name( + of_get_flat_dt_root(), "hypervisor"); + + return (hyp_node != -FDT_ERR_NOTFOUND) && + of_flat_dt_is_compatible(hyp_node, "microsoft,hyperv"); +#else + return false; +#endif +} + +static bool hyperv_detect_acpi(void) +{ +#ifdef CONFIG_ACPI + return !acpi_disabled && + !strncmp((char *)&acpi_gbl_FADT.hypervisor_id, "MsHyperV", 8); +#else + return false; +#endif +} + static int __init hyperv_init(void) { struct hv_get_vp_registers_output result; @@ -35,13 +61,11 @@ static int __init hyperv_init(void) /* * Allow for a kernel built with CONFIG_HYPERV to be running in - * a non-Hyper-V environment, including on DT instead of ACPI. + * a non-Hyper-V environment. + * * In such cases, do nothing and return success. */ - if (acpi_disabled) - return 0; - - if (strncmp((char *)&acpi_gbl_FADT.hypervisor_id, "MsHyperV", 8)) + if (!hyperv_detect_fdt() && !hyperv_detect_acpi()) return 0; /* Setup the guest ID */ From patchwork Tue May 14 22:43:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Roman Kisel X-Patchwork-Id: 796761 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7B983181D1B; Tue, 14 May 2024 22:45:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715726728; cv=none; b=K1zCeqN4W+xpk3tjTEFFELyuSnB7fAqvy+1IywGYxSXErgvLXQEKOJuIfI+xgZqHtO1CxGKN4BriyhnzBvJO6Sr8/55ai2yQzMozz49Cyu8P1T24QXjVWswo7w9AOMQ5kCrkWTjT3C1vVDsYt35xi55VNHHAAh34ypN3da9LllY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715726728; c=relaxed/simple; bh=WakItw23tStfr+6wb4ZT4IxnE2d/1msBu5yJn9iUY9E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=iV7QAxZd7nubyFWgX77j59740j0pzRn5Nt9hYGDr3mvkE7w5SM4GkGuxIi1uG9mMvKotK2XRHBVbDeoI3fVHLCyhm4qhdKj/R3G12vxxNTJviEbTO6fVhX+trW3HdDj3JXMhO31MZ+UsyN7a3rZL+0FrGWReavijPdEzESzLwqQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=GhPZZCx2; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="GhPZZCx2" Received: from xps-8930.corp.microsoft.com (unknown [131.107.160.48]) by linux.microsoft.com (Postfix) with ESMTPSA id 242E52095D0C; Tue, 14 May 2024 15:45:21 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 242E52095D0C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1715726721; bh=tNavMrInayINex2Ss/cK7mDsEK6d64ATDiDMkzKu5sg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GhPZZCx25j1r3g9Qxj5sQshhjQP4zOxyEb0DkzPHh2OgJell4GEYhEhrxd5lQ07VS ZpjZGEU64DQy5pvIJsG9vN0gbPuZ4ol7NCDvJ82AzDG0bpfRcaZFe36AtMWmTQVyUe TYhGMjRt6PKFrKID6RyoMRIpSPezk3XrzaufVW58= From: Roman Kisel To: arnd@arndb.de, bhelgaas@google.com, bp@alien8.de, catalin.marinas@arm.com, dave.hansen@linux.intel.com, decui@microsoft.com, haiyangz@microsoft.com, hpa@zytor.com, kw@linux.com, kys@microsoft.com, lenb@kernel.org, lpieralisi@kernel.org, mingo@redhat.com, mhklinux@outlook.com, rafael@kernel.org, robh@kernel.org, tglx@linutronix.de, wei.liu@kernel.org, will@kernel.org, linux-acpi@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, x86@kernel.org Cc: ssengar@microsoft.com, sunilmut@microsoft.com, vdso@hexbites.dev Subject: [PATCH v2 2/6] drivers/hv: Enable VTL mode for arm64 Date: Tue, 14 May 2024 15:43:49 -0700 Message-ID: <20240514224508.212318-3-romank@linux.microsoft.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240514224508.212318-1-romank@linux.microsoft.com> References: <20240514224508.212318-1-romank@linux.microsoft.com> Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 Kisel --- drivers/hv/Kconfig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/hv/Kconfig b/drivers/hv/Kconfig index 862c47b191af..a5cd1365e248 100644 --- a/drivers/hv/Kconfig +++ b/drivers/hv/Kconfig @@ -5,7 +5,7 @@ menu "Microsoft Hyper-V guest support" config HYPERV tristate "Microsoft Hyper-V client drivers" depends on (X86 && X86_LOCAL_APIC && HYPERVISOR_GUEST) \ - || (ACPI && ARM64 && !CPU_BIG_ENDIAN) + || (ARM64 && !CPU_BIG_ENDIAN) select PARAVIRT select X86_HV_CALLBACK_VECTOR if X86 select OF_EARLY_FLATTREE if OF @@ -15,7 +15,7 @@ config HYPERV config HYPERV_VTL_MODE bool "Enable Linux to boot in VTL context" - depends on X86_64 && HYPERV + depends on HYPERV depends on SMP default n help @@ -31,7 +31,7 @@ config HYPERV_VTL_MODE Select this option to build a Linux kernel to run at a VTL other than the normal VTL0, which currently is only VTL2. This option - initializes the x86 platform for VTL2, and adds the ability to boot + initializes the kernel to run in VTL2, and adds the ability to boot secondary CPUs directly into 64-bit context as required for VTLs other than 0. A kernel built with this option must run at VTL2, and will not run as a normal guest. From patchwork Tue May 14 22:43:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Kisel X-Patchwork-Id: 797015 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7B8F017F378; Tue, 14 May 2024 22:45:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715726729; cv=none; b=Un5E/8VwI0lPymcpeyYHjDC1vJumC5kG7U//bBm0lqf8IdPgOYdeNyO926NmEaefG+uGQ7xG1vX29qQJJnNN6oc8spKUFQkDWsActU7no4K8UF5E3buJGsNz80aQ8RQpw11gH1w5ubIROt5gX/ZKr10al5tQ6Y+X3J9h73LHhnw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715726729; c=relaxed/simple; bh=aty2NkLBEGJ2qYaz1Gbe0SvAWHyFBA49AT6NoIrguDQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=db+bYHSXP1KL4ZsrnnAQxA4inTBEP70vU3LwA4iZAAeq0dWTLPoD7ltEO5LGxVMv7q36tURoNsNhX8P37blYb7QoZpxqfB5geCu+ZZNtGzaghQW3EyPUNOII8n+VNWbOylXardf0j8GDg05h2tW3qzkP78qT8Q684MsysLBYUg0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=rIpAff7U; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="rIpAff7U" Received: from xps-8930.corp.microsoft.com (unknown [131.107.160.48]) by linux.microsoft.com (Postfix) with ESMTPSA id 6F5322095D0D; Tue, 14 May 2024 15:45:21 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 6F5322095D0D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1715726721; bh=Y0tR2xyoixzhkEx06dVg/oDnKDEQYYiPMVX6g/T4ShY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rIpAff7UkIDHiq6Mq4q1zztwKhl0claML4lN9OOwLOcvFsTwJrZ+RnSGisArmq2OJ OdKFDT5MnLFdxI5NE6hahsMqvHdDhbyO/dvLiJppDgTlFIEO3HXVsmWhCDKHI3kkyY owo+nab6bj4JhWhVbcD6ktPohOr7G8JOHuYmQ1C8= From: Roman Kisel To: arnd@arndb.de, bhelgaas@google.com, bp@alien8.de, catalin.marinas@arm.com, dave.hansen@linux.intel.com, decui@microsoft.com, haiyangz@microsoft.com, hpa@zytor.com, kw@linux.com, kys@microsoft.com, lenb@kernel.org, lpieralisi@kernel.org, mingo@redhat.com, mhklinux@outlook.com, rafael@kernel.org, robh@kernel.org, tglx@linutronix.de, wei.liu@kernel.org, will@kernel.org, linux-acpi@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, x86@kernel.org Cc: ssengar@microsoft.com, sunilmut@microsoft.com, vdso@hexbites.dev Subject: [PATCH v2 3/6] drivers/hv: arch-neutral implementation of get_vtl() Date: Tue, 14 May 2024 15:43:50 -0700 Message-ID: <20240514224508.212318-4-romank@linux.microsoft.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240514224508.212318-1-romank@linux.microsoft.com> References: <20240514224508.212318-1-romank@linux.microsoft.com> Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: 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 changed, 56 insertions(+), 41 deletions(-) diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c index 17a71e92a343..c350fa05ee59 100644 --- a/arch/x86/hyperv/hv_init.c +++ b/arch/x86/hyperv/hv_init.c @@ -413,40 +413,6 @@ static void __init hv_get_partition_id(void) local_irq_restore(flags); } -#if IS_ENABLED(CONFIG_HYPERV_VTL_MODE) -static u8 __init get_vtl(void) -{ - u64 control = HV_HYPERCALL_REP_COMP_1 | HVCALL_GET_VP_REGISTERS; - struct hv_get_vp_registers_input *input; - struct hv_get_vp_registers_output *output; - unsigned long flags; - u64 ret; - - local_irq_save(flags); - input = *this_cpu_ptr(hyperv_pcpu_input_arg); - output = (struct hv_get_vp_registers_output *)input; - - memset(input, 0, struct_size(input, element, 1)); - input->header.partitionid = HV_PARTITION_ID_SELF; - input->header.vpindex = HV_VP_INDEX_SELF; - input->header.inputvtl = 0; - input->element[0].name0 = HV_X64_REGISTER_VSM_VP_STATUS; - - ret = hv_do_hypercall(control, input, output); - if (hv_result_success(ret)) { - ret = output->as64.low & HV_X64_VTL_MASK; - } else { - pr_err("Failed to get VTL(error: %lld) exiting...\n", ret); - BUG(); - } - - local_irq_restore(flags); - return ret; -} -#else -static inline u8 get_vtl(void) { return 0; } -#endif - /* * This function is to be invoked early in the boot sequence after the * hypervisor has been detected. diff --git a/arch/x86/include/asm/hyperv-tlfs.h b/arch/x86/include/asm/hyperv-tlfs.h index 3787d26810c1..9ee68eb8e6ff 100644 --- a/arch/x86/include/asm/hyperv-tlfs.h +++ b/arch/x86/include/asm/hyperv-tlfs.h @@ -309,13 +309,6 @@ enum hv_isolation_type { #define HV_MSR_STIMER0_CONFIG (HV_X64_MSR_STIMER0_CONFIG) #define HV_MSR_STIMER0_COUNT (HV_X64_MSR_STIMER0_COUNT) -/* - * Registers are only accessible via HVCALL_GET_VP_REGISTERS hvcall and - * there is not associated MSR address. - */ -#define HV_X64_REGISTER_VSM_VP_STATUS 0x000D0003 -#define HV_X64_VTL_MASK GENMASK(3, 0) - /* Hyper-V memory host visibility */ enum hv_mem_host_visibility { VMBUS_PAGE_NOT_VISIBLE = 0, diff --git a/drivers/hv/hv_common.c b/drivers/hv/hv_common.c index dde3f9b6871a..d4cf477a4d0c 100644 --- a/drivers/hv/hv_common.c +++ b/drivers/hv/hv_common.c @@ -660,3 +660,46 @@ u64 __weak hv_tdx_hypercall(u64 control, u64 param1, u64 param2) return HV_STATUS_INVALID_PARAMETER; } EXPORT_SYMBOL_GPL(hv_tdx_hypercall); + +#if IS_ENABLED(CONFIG_HYPERV_VTL_MODE) +u8 __init get_vtl(void) +{ + u64 control = HV_HYPERCALL_REP_COMP_1 | HVCALL_GET_VP_REGISTERS; + struct hv_get_vp_registers_input *input; + struct hv_get_vp_registers_output *output; + unsigned long flags; + u64 ret; + + local_irq_save(flags); + input = *this_cpu_ptr(hyperv_pcpu_input_arg); + output = (struct hv_get_vp_registers_output *)input; + + memset(input, 0, struct_size(input, element, 1)); + input->header.partitionid = HV_PARTITION_ID_SELF; + input->header.vpindex = HV_VP_INDEX_SELF; + input->header.inputvtl = 0; + input->element[0].name0 = HV_REGISTER_VSM_VP_STATUS; + + ret = hv_do_hypercall(control, input, output); + if (hv_result_success(ret)) { + ret = output->as64.low & HV_VTL_MASK; + } else { + pr_err("Failed to get VTL(error: %lld) exiting...\n", ret); + + /* + * This is a dead end, something fundamental is broken. + * + * There is no sensible way of continuing as the Hyper-V drivers + * transitively depend via the vmbus driver on knowing which VTL + * they run in to establish communication with the host. The kernel + * is going to be worse off if continued booting than a panicked one, + * just hung and stuck, producing second-order failures, with neither + * a way to recover nor to provide expected services. + */ + BUG(); + } + + local_irq_restore(flags); + return ret; +} +#endif diff --git a/include/asm-generic/hyperv-tlfs.h b/include/asm-generic/hyperv-tlfs.h index 87e3d49a4e29..682bcda3124f 100644 --- a/include/asm-generic/hyperv-tlfs.h +++ b/include/asm-generic/hyperv-tlfs.h @@ -75,6 +75,13 @@ /* AccessTscInvariantControls privilege */ #define HV_ACCESS_TSC_INVARIANT BIT(15) +/* + * This synthetic register is only accessible via the HVCALL_GET_VP_REGISTERS + * hvcall, and there is no an associated MSR on x86. + */ +#define HV_REGISTER_VSM_VP_STATUS 0x000D0003 +#define HV_VTL_MASK GENMASK(3, 0) + /* * Group B features. */ diff --git a/include/asm-generic/mshyperv.h b/include/asm-generic/mshyperv.h index 99935779682d..ea434186d765 100644 --- a/include/asm-generic/mshyperv.h +++ b/include/asm-generic/mshyperv.h @@ -301,4 +301,10 @@ static inline enum hv_isolation_type hv_get_isolation_type(void) } #endif /* CONFIG_HYPERV */ +#if IS_ENABLED(CONFIG_HYPERV_VTL_MODE) +u8 __init get_vtl(void); +#else +static inline u8 get_vtl(void) { return 0; } +#endif + #endif From patchwork Tue May 14 22:43:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Kisel X-Patchwork-Id: 796760 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5D181182C84; Tue, 14 May 2024 22:45:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715726729; cv=none; b=LaDQzMHw712vGXMPv3GkleZMeyXjyE4SH/w1kC2JWz4sQwwxuHPsdsXOUu9iDRBikZV+pHsAKCYhE9c/zsg0KJrOYrAKKimxEewkC01twQ4faxiABiFLDfZkNYYWQNCXPpY5cKefz1PHwIm6CDGXatkmXXktRWnOwuiGrbSMdSw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715726729; c=relaxed/simple; bh=m1EKDirdZpUbxvw3NHD2qWkIJ2cXErTIJKMOLmmOMzA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ptBPHM5fcJbpYYYdLTvLNrMFG7qK8CnkP22OvpiTYD9sPYyu8kq+RrClA4uMK6TpJ/a1TJCtYbOxR8CTg/BQA1l3V+UtiHK1ah7ci1Ix1LYPEqJ9gzCEWXM3Gg50ey557w99Xsvjj2oaxM1DKZvdV2raeT7EFFLrxlomRBxgwYw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=SwOwHpg8; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="SwOwHpg8" Received: from xps-8930.corp.microsoft.com (unknown [131.107.160.48]) by linux.microsoft.com (Postfix) with ESMTPSA id BA19E2095D0E; Tue, 14 May 2024 15:45:21 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com BA19E2095D0E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1715726721; bh=d0mCVW38qQkjcmLn2COs13T+MEUBOqchbANwckpZQ8g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SwOwHpg8b4yjKsK8r6039KVFLe3cfIcdai0uztt+5O2dRSN62hNU0D8MgYgRr8eqY 0ukf2TL8bjBWnJlPjwUXhIEWIA0SrXN02lWSUWkIEWkqTrKpQv1X+aHjTbxtXtLSe7 91OvV72T6CiRm9XOOTWXMe6ChBi+2Cv61MUXpT6c= From: Roman Kisel To: arnd@arndb.de, bhelgaas@google.com, bp@alien8.de, catalin.marinas@arm.com, dave.hansen@linux.intel.com, decui@microsoft.com, haiyangz@microsoft.com, hpa@zytor.com, kw@linux.com, kys@microsoft.com, lenb@kernel.org, lpieralisi@kernel.org, mingo@redhat.com, mhklinux@outlook.com, rafael@kernel.org, robh@kernel.org, tglx@linutronix.de, wei.liu@kernel.org, will@kernel.org, linux-acpi@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, x86@kernel.org Cc: ssengar@microsoft.com, sunilmut@microsoft.com, vdso@hexbites.dev Subject: [PATCH v2 4/6] arm64/hyperv: Boot in a Virtual Trust Level Date: Tue, 14 May 2024 15:43:51 -0700 Message-ID: <20240514224508.212318-5-romank@linux.microsoft.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240514224508.212318-1-romank@linux.microsoft.com> References: <20240514224508.212318-1-romank@linux.microsoft.com> Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 Hyper-V drivers to boot in the VTL mode and print the VTL the code runs in. Signed-off-by: Roman Kisel --- arch/arm64/hyperv/Makefile | 1 + arch/arm64/hyperv/hv_vtl.c | 19 +++++++++++++++++++ arch/arm64/hyperv/mshyperv.c | 6 ++++++ arch/arm64/include/asm/mshyperv.h | 8 ++++++++ arch/x86/hyperv/hv_vtl.c | 2 +- 5 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 arch/arm64/hyperv/hv_vtl.c diff --git a/arch/arm64/hyperv/Makefile b/arch/arm64/hyperv/Makefile index 87c31c001da9..9701a837a6e1 100644 --- a/arch/arm64/hyperv/Makefile +++ b/arch/arm64/hyperv/Makefile @@ -1,2 +1,3 @@ # SPDX-License-Identifier: GPL-2.0 obj-y := hv_core.o mshyperv.o +obj-$(CONFIG_HYPERV_VTL_MODE) += hv_vtl.o diff --git a/arch/arm64/hyperv/hv_vtl.c b/arch/arm64/hyperv/hv_vtl.c new file mode 100644 index 000000000000..9b44cc49594c --- /dev/null +++ b/arch/arm64/hyperv/hv_vtl.c @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (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_early_init); diff --git a/arch/arm64/hyperv/mshyperv.c b/arch/arm64/hyperv/mshyperv.c index 208a3bcb9686..cbde483b167a 100644 --- a/arch/arm64/hyperv/mshyperv.c +++ b/arch/arm64/hyperv/mshyperv.c @@ -96,6 +96,12 @@ static int __init hyperv_init(void) return ret; } + /* Find the VTL */ + ms_hyperv.vtl = get_vtl(); + if (ms_hyperv.vtl > 0) /* non default VTL */ + hv_vtl_early_init(); + + hv_vtl_init_platform(); ms_hyperv_late_init(); hyperv_initialized = true; diff --git a/arch/arm64/include/asm/mshyperv.h b/arch/arm64/include/asm/mshyperv.h index a975e1a689dd..4a8ff6be389c 100644 --- a/arch/arm64/include/asm/mshyperv.h +++ b/arch/arm64/include/asm/mshyperv.h @@ -49,6 +49,14 @@ static inline u64 hv_get_msr(unsigned int reg) ARM_SMCCC_OWNER_VENDOR_HYP, \ HV_SMCCC_FUNC_NUMBER) +#ifdef CONFIG_HYPERV_VTL_MODE +void __init hv_vtl_init_platform(void); +int __init hv_vtl_early_init(void); +#else +static inline void __init hv_vtl_init_platform(void) {} +static inline int __init hv_vtl_early_init(void) { return 0; } +#endif + #include #endif diff --git a/arch/x86/hyperv/hv_vtl.c b/arch/x86/hyperv/hv_vtl.c index 92bd5a55f093..ae3105375a12 100644 --- a/arch/x86/hyperv/hv_vtl.c +++ b/arch/x86/hyperv/hv_vtl.c @@ -19,7 +19,7 @@ static struct real_mode_header hv_vtl_real_mode_header; void __init hv_vtl_init_platform(void) { - pr_info("Linux runs in Hyper-V Virtual Trust Level\n"); + pr_info("Linux runs in Hyper-V Virtual Trust Level %d\n", ms_hyperv.vtl); x86_platform.realmode_reserve = x86_init_noop; x86_platform.realmode_init = x86_init_noop; From patchwork Tue May 14 22:43:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Kisel X-Patchwork-Id: 797014 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6F421182C8F; Tue, 14 May 2024 22:45:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715726729; cv=none; b=pW3lhX5bJdFZm67wRtG/Wc6NdLzRoWtu1xNxxq700LzGLkpfEFoqwhpzZnHz8VaYDXiLTkp0mCpmsV23TOpOpuvktMTfKJVqwiRQAaCL5Y7zvaopVrXrwlVGdWDTWa9VPKq593x2aOzF3ozzxvAEwZcAsV75zQk3Rpwftr/XHZQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715726729; c=relaxed/simple; bh=tvR97zZr6ZpbcFlWZfk14uab1KuXwUvFLoCdkyuH8rA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EktDpIJKc/rZWajZPbNFxt3L3kHVzmzoo0OG37uWFLUv9rBNTQBf4ln/XnxGm3JNwdkXikz+zfhSKen98e9bBdpkWAHToNhX4ttTcnf7hBD2+6wBBjk0UAKEa4ev0ZPiaUcYRDfeQXuDwFvclSFC2ZHYJJdrLD8O545xycErveY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=rHUMfKWH; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="rHUMfKWH" Received: from xps-8930.corp.microsoft.com (unknown [131.107.160.48]) by linux.microsoft.com (Postfix) with ESMTPSA id 0F1B92095D0F; Tue, 14 May 2024 15:45:22 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 0F1B92095D0F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1715726722; bh=WAvNrAUPvRAs95ycwbUis/ZRyivQ+QBcctDpVBVOD60=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rHUMfKWHs+d7tiJ3YyQ5OkPlGTa5/+H9H1p/7QEryXhFD85oSOk2uETsgSV9nmzhw ftp8xQhziw6Ba9H8GNpI2OBe6IsCv6LZkmNxQHu3Zi/ANeiyY5CChzUetgkL8LKDhB 9qFCek/0QptJF7l+FYMiMSDHstH0isF+hOWUtb/0= From: Roman Kisel To: arnd@arndb.de, bhelgaas@google.com, bp@alien8.de, catalin.marinas@arm.com, dave.hansen@linux.intel.com, decui@microsoft.com, haiyangz@microsoft.com, hpa@zytor.com, kw@linux.com, kys@microsoft.com, lenb@kernel.org, lpieralisi@kernel.org, mingo@redhat.com, mhklinux@outlook.com, rafael@kernel.org, robh@kernel.org, tglx@linutronix.de, wei.liu@kernel.org, will@kernel.org, linux-acpi@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, x86@kernel.org Cc: ssengar@microsoft.com, sunilmut@microsoft.com, vdso@hexbites.dev Subject: [PATCH v2 5/6] drivers/hv/vmbus: Get the irq number from DeviceTree Date: Tue, 14 May 2024 15:43:52 -0700 Message-ID: <20240514224508.212318-6-romank@linux.microsoft.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240514224508.212318-1-romank@linux.microsoft.com> References: <20240514224508.212318-1-romank@linux.microsoft.com> Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index e25223cee3ab..52f01bd1c947 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include "hyperv_vmbus.h" @@ -2316,6 +2317,34 @@ static int vmbus_acpi_add(struct platform_device *pdev) } #endif +static int __maybe_unused vmbus_of_set_irq(struct device_node *np) +{ + struct irq_desc *desc; + int irq; + + irq = of_irq_get(np, 0); + if (irq == 0) { + pr_err("VMBus interrupt mapping failure\n"); + return -EINVAL; + } + if (irq < 0) { + pr_err("VMBus interrupt data can't be read from DeviceTree, error %d\n", irq); + return irq; + } + + desc = irq_to_desc(irq); + if (!desc) { + pr_err("VMBus interrupt description can't be found for virq %d\n", irq); + return -ENODEV; + } + + vmbus_irq = irq; + vmbus_interrupt = desc->irq_data.hwirq; + pr_debug("VMBus virq %d, hwirq %d\n", vmbus_irq, vmbus_interrupt); + + return 0; +} + static int vmbus_device_add(struct platform_device *pdev) { struct resource **cur_res = &hyperv_mmio; @@ -2324,12 +2353,20 @@ static int vmbus_device_add(struct platform_device *pdev) struct device_node *np = pdev->dev.of_node; int ret; + pr_debug("VMBus is present in DeviceTree\n"); + hv_dev = &pdev->dev; ret = of_range_parser_init(&parser, np); if (ret) return ret; +#ifndef HYPERVISOR_CALLBACK_VECTOR + ret = vmbus_of_set_irq(np); + if (ret) + return ret; +#endif + for_each_of_range(&parser, &range) { struct resource *res; From patchwork Tue May 14 22:43:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Kisel X-Patchwork-Id: 797013 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6DB61182C8C; Tue, 14 May 2024 22:45:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715726730; cv=none; b=B8M8INrcazBfZFFmt3DwYcmOVX53TnEOLiccvR+5FuNQuF6MlruB0vlUQ1SJPeyfEBELMtddR1XlqZU5A5imzW4YWok3gLYqGSNbWi33pHCFTx8bVetbeFnUMgijnikq4LLjWs8QsZrE9CsPYMcy5CY1q5qG/fPY/Gr8MV8WuuM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715726730; c=relaxed/simple; bh=Zv26x/T8ogrdxgGzOuPHS9PDINbVhcAXhtoB3XLW4Qk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QfOn84RrnywBp2UtsxOwS9gGMWQrqrO8nljpXVtW6+JnZIBcAwghhOV4j2xH8WZkkkjwIBOtW5odcoTr6CR+zIDLRomBeQl7/R47hPldG7OWZgTwqxQJCfZYCxuW/QxHyV8W0u3yo6+N23TJPt6JoSA6S9VLyrzL1xqPMOJAu7o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=XaX/+GHn; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="XaX/+GHn" Received: from xps-8930.corp.microsoft.com (unknown [131.107.160.48]) by linux.microsoft.com (Postfix) with ESMTPSA id 594892095D11; Tue, 14 May 2024 15:45:22 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 594892095D11 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1715726722; bh=nn4KQV68n4WSbSFFxJJQzluv/kgRud1rPVzivgVs9S0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XaX/+GHnNrg4XA0FawTJAnlgsIOEcHB9P133ahRuzmaWgZZ6922vOaNOwsOEObWM7 AKTg8l8OU+3i7fIREg8gSUe0LulylVa3E4yiL/5WxMUHcppdm87ciWmuuZ4a9P2COu hpuzTKW1wNC60oQ1+gokVeFkzm41EemxwR99IiVY= From: Roman Kisel To: arnd@arndb.de, bhelgaas@google.com, bp@alien8.de, catalin.marinas@arm.com, dave.hansen@linux.intel.com, decui@microsoft.com, haiyangz@microsoft.com, hpa@zytor.com, kw@linux.com, kys@microsoft.com, lenb@kernel.org, lpieralisi@kernel.org, mingo@redhat.com, mhklinux@outlook.com, rafael@kernel.org, robh@kernel.org, tglx@linutronix.de, wei.liu@kernel.org, will@kernel.org, linux-acpi@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, x86@kernel.org Cc: ssengar@microsoft.com, sunilmut@microsoft.com, vdso@hexbites.dev Subject: [PATCH v2 6/6] drivers/pci/hyperv/arm64: vPCI MSI IRQ domain from DT Date: Tue, 14 May 2024 15:43:53 -0700 Message-ID: <20240514224508.212318-7-romank@linux.microsoft.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240514224508.212318-1-romank@linux.microsoft.com> References: <20240514224508.212318-1-romank@linux.microsoft.com> Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 --- drivers/pci/controller/pci-hyperv.c | 13 ++++++++++--- include/linux/acpi.h | 9 +++++++++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c index 1eaffff40b8d..ccc2b54206f4 100644 --- a/drivers/pci/controller/pci-hyperv.c +++ b/drivers/pci/controller/pci-hyperv.c @@ -906,9 +906,16 @@ static int hv_pci_irqchip_init(void) * way to ensure that all the corresponding devices are also gone and * no interrupts will be generated. */ - hv_msi_gic_irq_domain = acpi_irq_create_hierarchy(0, HV_PCI_MSI_SPI_NR, - fn, &hv_pci_domain_ops, - chip_data); + if (acpi_disabled) + hv_msi_gic_irq_domain = irq_domain_create_hierarchy( + irq_find_matching_fwnode(fn, DOMAIN_BUS_ANY), + 0, HV_PCI_MSI_SPI_NR, + fn, &hv_pci_domain_ops, + chip_data); + else + hv_msi_gic_irq_domain = acpi_irq_create_hierarchy(0, HV_PCI_MSI_SPI_NR, + fn, &hv_pci_domain_ops, + chip_data); if (!hv_msi_gic_irq_domain) { pr_err("Failed to create Hyper-V arm64 vPCI MSI IRQ domain\n"); diff --git a/include/linux/acpi.h b/include/linux/acpi.h index b7165e52b3c6..498cbb2c40a1 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -1077,6 +1077,15 @@ static inline bool acpi_sleep_state_supported(u8 sleep_state) return false; } +static inline struct irq_domain *acpi_irq_create_hierarchy(unsigned int flags, + unsigned int size, + struct fwnode_handle *fwnode, + const struct irq_domain_ops *ops, + void *host_data) +{ + return NULL; +} + #endif /* !CONFIG_ACPI */ extern void arch_post_acpi_subsys_init(void);