From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5C73EC3DA7F for ; Mon, 5 Aug 2024 16:21:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=x7RmYwcl8Np2r9CgaT28u+v74Tee49QBXTpKkw+aDMA=; b=WmfR75tp2fExMBpns+OHEhjCrZ hv0IJlx6/2BnP9ZGNR3Vk47/FmnaXIdS/+PQyfhgJuHb8FyzwRDrZg6uo1bF6uCeTTMMrjPB/Bzbs glkgpK8DysZzauqzUgJe3kVoc7+Bo3yQmH7WExUrYphhHi2kBer6akvLYo7j/SOp+/wghvT9kZSs8 lvUC8tAGLU+nymUxoWnVexqB8YftqU6XC6ovXfqQ56v+Q8ebC/vVn5S+C7Alj0lrjuQDaJjLBV3X4 /zg6NLyib7uKbSyVRX8T32eWyZc91SNmBi1CORmXEvvBbollHfEYZft2hyzduHcwdhwDfeN+Egvq7 syOI8Ysg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sb0Sj-0000000GUC7-2wb3; Mon, 05 Aug 2024 16:21:33 +0000 Received: from linux.microsoft.com ([13.77.154.182]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sb0Rz-0000000GTyk-0Is3 for linux-arm-kernel@lists.infradead.org; Mon, 05 Aug 2024 16:20:48 +0000 Received: from [10.137.186.190] (unknown [131.107.159.62]) by linux.microsoft.com (Postfix) with ESMTPSA id 4441820B7165; Mon, 5 Aug 2024 09:20:45 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 4441820B7165 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1722874845; bh=x7RmYwcl8Np2r9CgaT28u+v74Tee49QBXTpKkw+aDMA=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=Spc/40kowD2L/9j9rxEhbXM8jNL0yKIWWH3nPryKvtsxxcfqWkcOw1zNQytspaDf9 ka/+E7NGxcSj+aJgyTJGArS23Gp704ZXooexFtXYIgNn4M29vMSEH0AfRwo2jjCzW0 Tc0i9erquhfjLy2nTZu3FyLDYvVHvhwaSygalWN8= Message-ID: <40a0853f-52e1-4f44-a7bd-aa5b732c07a9@linux.microsoft.com> Date: Mon, 5 Aug 2024 09:20:45 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 4/7] arm64: hyperv: Boot in a Virtual Trust Level To: Michael Kelley , "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" , "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: "apais@microsoft.com" , "benhill@microsoft.com" , "ssengar@microsoft.com" , "sunilmut@microsoft.com" , "vdso@hexbites.dev" References: <20240726225910.1912537-1-romank@linux.microsoft.com> <20240726225910.1912537-5-romank@linux.microsoft.com> Content-Language: en-US From: Roman Kisel In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240805_092047_324181_EFE5CBE9 X-CRM114-Status: GOOD ( 19.79 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 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 | 13 +++++++++++++ >> arch/arm64/hyperv/mshyperv.c | 4 ++++ >> arch/arm64/include/asm/mshyperv.h | 7 +++++++ >> 4 files changed, 25 insertions(+) >> 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..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 >> + */ >> + >> +#include >> + >> +void __init hv_vtl_init_platform(void) >> +{ >> + pr_info("Linux runs in Hyper-V Virtual Trust Level\n"); >> +} >> diff --git a/arch/arm64/hyperv/mshyperv.c b/arch/arm64/hyperv/mshyperv.c >> index 341f98312667..8fd04d6e4800 100644 >> --- a/arch/arm64/hyperv/mshyperv.c >> +++ b/arch/arm64/hyperv/mshyperv.c >> @@ -98,6 +98,10 @@ static int __init hyperv_init(void) >> return ret; >> } >> >> + /* Find the VTL */ >> + ms_hyperv.vtl = get_vtl(); >> + 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 a7a3586f7cb1..63d6bb6998fc 100644 >> --- a/arch/arm64/include/asm/mshyperv.h >> +++ b/arch/arm64/include/asm/mshyperv.h >> @@ -49,6 +49,13 @@ 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); > > This declaration is spurious since you removed the function. > Will clean this up, thanks! > Michael > >> +#else >> +static inline void __init hv_vtl_init_platform(void) {} >> +#endif >> + >> #include >> >> #define ARM_SMCCC_VENDOR_HYP_UID_HYPERV_REG_0 0x7948734d >> -- >> 2.34.1 >> -- Thank you, Roman