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 52276C369A1 for ; Tue, 8 Apr 2025 07:12:13 +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-Type:MIME-Version: References:In-Reply-To:Subject:Cc:To:From:Message-ID:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=yfRFNqOy5zReVyMSp+vGtJXugwYCScPnYqt6FgcbDnQ=; b=tfa66nOCNUklKtHnfreY1+2Gi3 EJZVD5lPf4txKT+RAojVd/eqkgZ37u7RWb1kQP9IJ7GAUtFfkdgF+Ypdk1uugp4fzOWYrhGF9uYGQ 9RZGVGyrGwL3Wdzf+NvwCfbCKrRgeVWmhUWzDy5p7kAiQLGC5tr0lTaFqwgxnoNY4jv7xxOxa48ei o3waaTpoAYnYyFHom9PKw25Onko9mYRhNERvTVFsVUuvVPAagBo9tZNxzEiA+GOqkeKeQtw3gvEON S4wA7V16QCpe7eDedJqRQFsDmq6EwawCvetN9BSfrglhxwRVbCnntPqLbRahPeRjeEJJs35RKPFOE G1bMMT4A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.1 #2 (Red Hat Linux)) id 1u237q-0000000315S-1lKr; Tue, 08 Apr 2025 07:12:02 +0000 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.98.1 #2 (Red Hat Linux)) id 1u232l-000000030Ee-1oBU for linux-arm-kernel@lists.infradead.org; Tue, 08 Apr 2025 07:06:48 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 668DB44351; Tue, 8 Apr 2025 07:06:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E4448C4CEE5; Tue, 8 Apr 2025 07:06:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1744096007; bh=b4/HM8+SciHG286LvQnLgT/d3PAh2mnGk8+5TyFZWoU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=tuNiBJYibWOt5+vSOcQ+JRLaGgZWDkwaR5g7lNtcFTYc0eXDRKe6tq4CFJoPxKpIt 5zBNMaoK7dfKeOvGjJHcZC3SgfNhwMciKiHLr3Xj3tBZTIQAQriWeFzCef/7bg1+dE hyqgZvsEdCEEUnc8kb8ixxAmY0ceVaTbQ/FV/etjY5hzXxF4tmwW+1dePcWZiVahGl 0JA6jU7oJiTCnEF5XrUfeiimXLagzfg43mKERJZSQ+zqZhgvK4Qk5R1p1r9X+bNtjt Kk9dCK73/RxRciBC9MdW/1HCWKw9hR/5lrex479hCJcM2sa/cq97vi7qhYhnbL+BmN nEcjjtUmDVjOg== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1u232h-003JRY-F2; Tue, 08 Apr 2025 08:06:43 +0100 Date: Tue, 08 Apr 2025 08:06:42 +0100 Message-ID: <86semjku7x.wl-maz@kernel.org> From: Marc Zyngier To: Roman Kisel Cc: arnd@arndb.de, bhelgaas@google.com, bp@alien8.de, catalin.marinas@arm.com, conor+dt@kernel.org, dan.carpenter@linaro.org, dave.hansen@linux.intel.com, decui@microsoft.com, haiyangz@microsoft.com, hpa@zytor.com, joey.gouly@arm.com, krzk+dt@kernel.org, kw@linux.com, kys@microsoft.com, lenb@kernel.org, lpieralisi@kernel.org, manivannan.sadhasivam@linaro.org, mark.rutland@arm.com, mingo@redhat.com, oliver.upton@linux.dev, rafael@kernel.org, robh@kernel.org, rafael.j.wysocki@intel.com, ssengar@linux.microsoft.com, sudeep.holla@arm.com, suzuki.poulose@arm.com, tglx@linutronix.de, wei.liu@kernel.org, will@kernel.org, yuzenghui@huawei.com, devicetree@vger.kernel.org, kvmarm@lists.linux.dev, 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, apais@microsoft.com, benhill@microsoft.com, bperkins@microsoft.com, sunilmut@microsoft.com Subject: Re: [PATCH hyperv-next v7 01/11] arm64: kvm, smccc: Introduce and use API for getting hypervisor UUID In-Reply-To: <20250407201336.66913-2-romank@linux.microsoft.com> References: <20250407201336.66913-1-romank@linux.microsoft.com> <20250407201336.66913-2-romank@linux.microsoft.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/29.4 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: romank@linux.microsoft.com, arnd@arndb.de, bhelgaas@google.com, bp@alien8.de, catalin.marinas@arm.com, conor+dt@kernel.org, dan.carpenter@linaro.org, dave.hansen@linux.intel.com, decui@microsoft.com, haiyangz@microsoft.com, hpa@zytor.com, joey.gouly@arm.com, krzk+dt@kernel.org, kw@linux.com, kys@microsoft.com, lenb@kernel.org, lpieralisi@kernel.org, manivannan.sadhasivam@linaro.org, mark.rutland@arm.com, mingo@redhat.com, oliver.upton@linux.dev, rafael@kernel.org, robh@kernel.org, rafael.j.wysocki@intel.com, ssengar@linux.microsoft.com, sudeep.holla@arm.com, suzuki.poulose@arm.com, tglx@linutronix.de, wei.liu@kernel.org, will@kernel.org, yuzenghui@huawei.com, devicetree@vger.kernel.org, kvmarm@lists.linux.dev, 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, apais@microsoft.com, benhill@microsoft.com, bperkins@microsoft .com, sunilmut@microsoft.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250408_000647_508145_463BB59C X-CRM114-Status: GOOD ( 20.64 ) 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 Mon, 07 Apr 2025 21:13:26 +0100, Roman Kisel wrote: > > 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 KVM > to employ the new API. The central notion of the SMCCC method is the > UUID of the hypervisor, and the new API follows that. > > No functional changes. Validated with a KVM/arm64 guest. > > Signed-off-by: Roman Kisel > --- > arch/arm64/kvm/hypercalls.c | 10 +++-- > drivers/firmware/smccc/kvm_guest.c | 10 +---- > drivers/firmware/smccc/smccc.c | 17 ++++++++ > include/linux/arm-smccc.h | 64 ++++++++++++++++++++++++++++-- > 4 files changed, 85 insertions(+), 16 deletions(-) > [...] > diff --git a/include/linux/arm-smccc.h b/include/linux/arm-smccc.h > index 67f6fdf2e7cd..4bb38f0e3fe2 100644 > --- a/include/linux/arm-smccc.h > +++ b/include/linux/arm-smccc.h > @@ -7,6 +7,11 @@ > > #include > #include > + > +#ifndef __ASSEMBLER__ > +#include > +#endif That's a pretty unusual guard in arm64 land. Looking at the current state of the kernel: $ git grep -w __ASSEMBLER__ arch/arm64/ | wc -l 2 $ git grep -w __ASSEMBLY__ arch/arm64/ | wc -l 122 I'd suggest the later rather than the former. Thanks, M. -- Without deviation from the norm, progress is not possible.