From nobody Wed Feb 11 00:43:09 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1732663414; cv=none; d=zohomail.com; s=zohoarc; b=mUXLpWSM3t3aKFxLd675eif6b21CW8/7k4FyKYzRp6utUrH70VHfvbUgMIwma8QCARV1GbvqpcSRXsAhEXm6DLoDLzikvJg1BaPUKFJgYXaakS5gVN4PXOX+M/lzYmKZ/t6tlWWAiek00ALmoPhX1X4UhfCjrt9VOOPTbrN90Yc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732663414; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=aMgcmGBZaTOVN2DP0P/ltcALjQaw6D8D5rFK6AiYRUM=; b=bMKl8zGaYcIm2j20rEeRXEfqTACoL45rbVHzGtqv0QNGmcls+JnuYhwceqXMXwkKvrxg3YmltqmaMYkx9I8vxVCe8wI246xZdHKFY3Xsr92BV29HNum+qPPX7G0k6ThCdjkug9VlNwYKfa6Wmi0M1k6xo1X6Bcg4bfB/trEGdHo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 173266341408785.16136444888684; Tue, 26 Nov 2024 15:23:34 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.844058.1259648 (Exim 4.92) (envelope-from ) id 1tG4to-0001ND-Sb; Tue, 26 Nov 2024 23:23:16 +0000 Received: by outflank-mailman (output) from mailman id 844058.1259648; Tue, 26 Nov 2024 23:23:16 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tG4to-0001Jx-FM; Tue, 26 Nov 2024 23:23:16 +0000 Received: by outflank-mailman (input) for mailman id 844058; Tue, 26 Nov 2024 23:22:05 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tG4sf-0000Ao-LX for xen-devel@lists.xenproject.org; Tue, 26 Nov 2024 23:22:05 +0000 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 3d69a0fb-ac4d-11ef-a0cd-8be0dac302b0; Wed, 27 Nov 2024 00:22:02 +0100 (CET) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 09A3E5C5CC2; Tue, 26 Nov 2024 23:21:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id 334C8C4CED3; Tue, 26 Nov 2024 23:21:56 +0000 (UTC) Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2B769D66B8E; Tue, 26 Nov 2024 23:21:56 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 3d69a0fb-ac4d-11ef-a0cd-8be0dac302b0 X-Custom-Connection: eyJyZW1vdGVpcCI6IjEzOS4xNzguODQuMjE3IiwiaGVsbyI6ImRmdy5zb3VyY2Uua2VybmVsLm9yZyJ9 X-Custom-Transaction: eyJpZCI6IjNkNjlhMGZiLWFjNGQtMTFlZi1hMGNkLThiZTBkYWMzMDJiMCIsInRzIjoxNzMyNjYzMzIyLjY3NjYxLCJzZW5kZXIiOiJkZXZudWxsK2RtdWtoaW4uZm9yZC5jb21Aa2VybmVsLm9yZyIsInJlY2lwaWVudCI6Inhlbi1kZXZlbEBsaXN0cy54ZW5wcm9qZWN0Lm9yZyJ9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1732663316; bh=tVwGh2fI891yEmph9JS9g2v7QV1qSjDfL8jnuUT3Tb8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=YyxtdXZwF5HGKtsKRUm1zirJZMLpJ6oxFzpfDPEYVhiGKIP1H7T25EZjFyX3niXwb dczYRBuH00BGZSQb8psXy3zx+EFN0ehYWA1ZO1fl3xcPeZ7Yw2cqNo3ArJw3ntTkrZ shAqcUXhpXBXDXgi08wJabThKsPPMHH4SMtfKjM4NKAgQ16ga8N9KfqK93Fs2onGTQ i2/kiNBE1eLo5OEolMA86YWULbyEsHEaqVhcbsYRhqlw51KlpdRYGmZT8SWeZmmLIU bfQ6KgLknzBvLRBJD/6AVXbZCYVCgNrGafJSs8ek2U+CUvo60QlUEOdw0AApTeIr60 KIGAKZl1h3uxQ== From: Denis Mukhin via B4 Relay Date: Tue, 26 Nov 2024 15:22:03 -0800 Subject: [PATCH 13/36] xen/domain: add get_initial_domain_id() MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241126-vuart-ns8250-v1-v1-13-87b9a8375b7a@ford.com> References: <20241126-vuart-ns8250-v1-v1-0-87b9a8375b7a@ford.com> In-Reply-To: <20241126-vuart-ns8250-v1-v1-0-87b9a8375b7a@ford.com> To: Jan Beulich , Andrew Cooper , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , "Daniel P. Smith" , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , Rahul Singh , Volodymyr Babchuk , Alistair Francis , Bob Eshleman , Connor Davis , Oleksii Kurochko , Shawn Anastasio , Anthony PERARD , Juergen Gross , Christian Lindig , David Scott , =?utf-8?q?Marek_Marczykowski-G=C3=B3recki?= Cc: xen-devel@lists.xenproject.org, Denis Mukhin X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1732663312; l=3214; i=dmukhin@ford.com; s=20241125; h=from:subject:message-id; bh=e/LNB+9Wk5d4Vu+ImwNmQARBXeefJiOOq9L8JfHstNA=; b=p4c6qAznAvJRnp/3HVjjynj1T4WRFFM62MWF06rptmAfMPUraD8W5+8g56LcbD6mMjTtn9dyK 3ID6rRQiP1UCksYsjKunjlrT8zbD94uIl0NQoksdMflBSXs+VQ4OJ2s X-Developer-Key: i=dmukhin@ford.com; a=ed25519; pk=SsDZ9p39s0fqcpUKQuqKqrbn0rq6EtEAClvpOpzx6+U= X-Endpoint-Received: by B4 Relay for dmukhin@ford.com/20241125 with auth_id=287 X-Original-From: Denis Mukhin Reply-To: dmukhin@ford.com X-ZohoMail-DKIM: pass (identity @kernel.org) X-ZM-MESSAGEID: 1732663415032019100 From: Denis Mukhin Move get_initial_domain_id() to a public API and enable for all architectur= es. That is pre-requisite change for console focus switch logic cleanup. Signed-off-by: Denis Mukhin --- xen/arch/x86/include/asm/pv/shim.h | 4 ++-- xen/arch/x86/pv/shim.c | 4 ++-- xen/common/domain.c | 10 ++++++++++ xen/include/xen/domain.h | 2 ++ 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/include/asm/pv/shim.h b/xen/arch/x86/include/asm/= pv/shim.h index 6153e27005986881ad87e9db0b555b30edc59fc0..1515ad1b0680aa11ab91a152a19= 44fc1bb477a79 100644 --- a/xen/arch/x86/include/asm/pv/shim.h +++ b/xen/arch/x86/include/asm/pv/shim.h @@ -31,7 +31,7 @@ long cf_check pv_shim_cpu_up(void *data); long cf_check pv_shim_cpu_down(void *data); void pv_shim_online_memory(unsigned int nr, unsigned int order); void pv_shim_offline_memory(unsigned int nr, unsigned int order); -domid_t get_initial_domain_id(void); +domid_t pv_shim_initial_domain_id(void); uint64_t pv_shim_mem(uint64_t avail); void pv_shim_fixup_e820(void); const struct platform_bad_page *pv_shim_reserved_pages(unsigned int *size); @@ -76,7 +76,7 @@ static inline void pv_shim_offline_memory(unsigned int nr= , unsigned int order) { ASSERT_UNREACHABLE(); } -static inline domid_t get_initial_domain_id(void) +static inline domid_t pv_shim_initial_domain_id(void) { return 0; } diff --git a/xen/arch/x86/pv/shim.c b/xen/arch/x86/pv/shim.c index 81e4a0516d18b359561f471f1d96e38977661ca7..17cb30620290c76cf42251f70cf= a4199c0e165d1 100644 --- a/xen/arch/x86/pv/shim.c +++ b/xen/arch/x86/pv/shim.c @@ -328,7 +328,7 @@ int pv_shim_shutdown(uint8_t reason) } =20 /* Update domain id. */ - d->domain_id =3D get_initial_domain_id(); + d->domain_id =3D pv_shim_initial_domain_id(); =20 /* Clean the iomem range. */ BUG_ON(iomem_deny_access(d, 0, ~0UL)); @@ -1016,7 +1016,7 @@ void pv_shim_offline_memory(unsigned int nr, unsigned= int order) } } =20 -domid_t get_initial_domain_id(void) +domid_t pv_shim_initial_domain_id(void) { uint32_t eax, ebx, ecx, edx; =20 diff --git a/xen/common/domain.c b/xen/common/domain.c index 92263a4fbdc57159b4a32d9d4ee038f9f37804ed..2f67aa06ed50e69c27cedc8d7f6= eb0b469fe81cd 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -45,6 +45,7 @@ =20 #ifdef CONFIG_X86 #include +#include #endif =20 /* Linux config option: propageted to domain0 */ @@ -2229,6 +2230,15 @@ int continue_hypercall_on_cpu( return 0; } =20 +domid_t get_initial_domain_id(void) +{ +#ifdef CONFIG_X86 + return pv_shim_initial_domain_id(); +#else + return 0; +#endif +} + /* * Local variables: * mode: C diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h index 3de56352911347a54cce310f0211bcc213d8a08d..601ef431cf621af44c867400499= b73b845eb137a 100644 --- a/xen/include/xen/domain.h +++ b/xen/include/xen/domain.h @@ -171,4 +171,6 @@ extern bool vmtrace_available; =20 extern bool vpmu_is_available; =20 +domid_t get_initial_domain_id(void); + #endif /* __XEN_DOMAIN_H__ */ --=20 2.34.1