From nobody Fri Jan 9 09:21:45 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; 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=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1766421654; cv=none; d=zohomail.com; s=zohoarc; b=MWh2xyigOp7un+ekdcMLxzIJX7LLjtAGfwmJ+5bKqx9GWIHquI6EMltgv+B0YyOhtgd2qDgIQQA/zLzTC05TQDlvZ/cpAXgp5I9fq4NNyfyxhy7eFfTczvDwlpHEXH2p6vgm0/eDjgY6uRkS+nK7QpGktiUGle4eSqWOcXDLlm0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1766421654; h=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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=BNwjdy5MtRkLCdiw0Mfj0t/kIGmvAi3hjA2xW/bh4o4=; b=Q/o3rXLNijCC8gh4DIzu87ZrRygAYE2R01Nr25CBPa3qqoepSSuwLG8vrpl8IcFiFlipUT9ZU+DplpP1eydU+4f3Rs3Jqp7hSIXI1nQS1gHkD51Y6QTq+u6kMxX7GF5zGdM793aKpoYDF7E12weEHr1okbRmAccCV9YAc8g3xN8= 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=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1766421654290348.8267812678148; Mon, 22 Dec 2025 08:40:54 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.1192201.1511576 (Exim 4.92) (envelope-from ) id 1vXixV-0005VM-PM; Mon, 22 Dec 2025 16:40:33 +0000 Received: by outflank-mailman (output) from mailman id 1192201.1511576; Mon, 22 Dec 2025 16:40:33 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vXixV-0005Ur-Eq; Mon, 22 Dec 2025 16:40:33 +0000 Received: by outflank-mailman (input) for mailman id 1192201; Mon, 22 Dec 2025 16:40:32 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vXixU-0004kh-3W for xen-devel@lists.xenproject.org; Mon, 22 Dec 2025 16:40:32 +0000 Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [2a00:1450:4864:20::52a]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id ed780244-df54-11f0-9cce-f158ae23cfc8; Mon, 22 Dec 2025 17:40:30 +0100 (CET) Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-64b8e5d1611so4640919a12.3 for ; Mon, 22 Dec 2025 08:40:30 -0800 (PST) Received: from fedora (user-109-243-71-38.play-internet.pl. [109.243.71.38]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8037f3e271sm1137038366b.60.2025.12.22.08.40.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Dec 2025 08:40:29 -0800 (PST) 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: ed780244-df54-11f0-9cce-f158ae23cfc8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1766421630; x=1767026430; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BNwjdy5MtRkLCdiw0Mfj0t/kIGmvAi3hjA2xW/bh4o4=; b=YSs8qS+VncWC9dzXbFkUwGEzjIldo/uflzsOMlavn+ivaPArqKKRwKTXckB/iVOuuC 6ymM79VpIfIW60rqLUjPSnQoylLJpxc9ZTqvfxHoCN7Ng5EsE525nSWmT4IE3q+lyZaT zhFqpJZFoeDIhH4CmDSx8YXz3MbEdFTB5XmNX43M5mgsiTpeI2xXewcAjg3wipNnTGI0 1n1SioIibhoHJP7tX2XP+uJ1eb9uAwTKFF414mh31N1TCpnDpBdH8mMMOtbglAM4CKRR nYynshCubjlHaqvy4DT/SZdKLGHaikeyhgsjpZg8/Sifufn89h+JtiAPkPiQaHxIg7sB S7kQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766421630; x=1767026430; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=BNwjdy5MtRkLCdiw0Mfj0t/kIGmvAi3hjA2xW/bh4o4=; b=WHKvmZ2Fv+vlAprnkq0dcUvPqS9OhtgdNeoZWtcvVcvO43TQY/qOrvD+6u7O432fSL B5fj41pnbbihjTdaHJoUnaxLb3DLVx1qutwD3J2CxRtV653aRSRc0PiEJbK8I50yLPv+ vGUvU8DTKHf1exZpmDhQ2iKUMz4LSNVsg3Uw8x4k/1omOFkUTKOtf8fiNT5jXxfqQgj2 n5RIdr+K3x/wr4RwO3nX0KG0dPE8AwSwUaXbWiQ4W2Ad832f6VWmcaFXMUv4Dh7k/+gp Pp4mSSHVWUl5p3HojDo+h5uAFj9DdnN14B3iYTHsptN19DWTFlIvE20Pu9ILQen6L1Uf I1pA== X-Gm-Message-State: AOJu0YzMXRBSWijgrOUSeJhtpEem1JEc16vlHQZZhtL1DMmh6hZKmFQD OaaH2tmL7a4G/8SkkEv31qrjomTbhMli9qjV2cQTmwCnW/dbNDwE3ACQR3/LWQ== X-Gm-Gg: AY/fxX71McsQKAAYTdTf9pgqxBsFW5EFtz7tS1VGpA3n8QRrtq9PKkcutVKJdZtoJ79 iq6S7BkB9uOOyPgbp/YRnofakJCal2dnKN12dXl0odp3Dc7swHH2m9+MjVfjP6g4AKUHEWqR6Hq HgPk0pP+SOaHufaKoGTpYPgpkqL6i+0JYYISuMy7jHNH81K68yE7te70nuU9sMrn3Fy0QOsy2wp VE9ibFhtRTYuFaId1X2ayT4lmzTO7cJKgP95NQ+iGTZv71Ys9q0VrdvORovgiaLi6P4KsINwJvc NaAsHNpwQPtW9A2hKds6hnswz9QA+seJCUH+4Fds+nBmwUtjdeULgDI7X609KD7xpxzONBdV522 GMBR7N+h/BmbiDjqRuGWNbbV51xTQ1vulG0Ag1hDz69j9v/Gjvv8AxNkvy42SXhH+o2OCE0k0yd fMUqe37ag9Z+cU2YW5KVZoa9/kkp4jOJqVCCNWnFy4xNwING46z9BZgp0= X-Google-Smtp-Source: AGHT+IFHbT58UFSAVUgtzRFhJKpDVbA/0v4hEH5GInvzZ4YJae2oeQe5zduQcBln5eMzXtvd4JIFsA== X-Received: by 2002:a17:907:7fa8:b0:b73:572d:3b07 with SMTP id a640c23a62f3a-b8036fac50amr1281809566b.28.1766421629522; Mon, 22 Dec 2025 08:40:29 -0800 (PST) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , Andrew Cooper , Anthony PERARD , Michal Orzel , Jan Beulich , Julien Grall , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Stefano Stabellini Subject: [PATCH v3 4/4] xen/common: make {alloc,free}_domain_struct() static Date: Mon, 22 Dec 2025 17:40:14 +0100 Message-ID: <07e8305e7d9730f65822f43ecefb7543b08f764b.1766404618.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1766421656115158500 Content-Type: text/plain; charset="utf-8" As {alloc,free}_domain_struct() are used only within domain.c, they can be declared static and their declarations removed from xen/domain.h. Signed-off-by: Oleksii Kurochko Acked-by: Andrew Cooper --- Changes in v3: - Move alloc_domain_struct() and free_domain_struct() to not have forward declaration. - Add Acked-by: Andrew Cooper . --- Changes in v2: - New patch. --- xen/common/domain.c | 42 ++++++++++++++++++++-------------------- xen/include/xen/domain.h | 4 ---- 2 files changed, 21 insertions(+), 25 deletions(-) diff --git a/xen/common/domain.c b/xen/common/domain.c index 568a63b7c6a2..7a3e5ce6593f 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -690,6 +690,27 @@ static int domain_teardown(struct domain *d) return 0; } =20 +static struct domain *alloc_domain_struct(void) +{ +#ifndef arch_domain_struct_memflags +# define arch_domain_struct_memflags() 0 +#endif + + struct domain *d =3D alloc_xenheap_pages(0, arch_domain_struct_memflag= s()); + + BUILD_BUG_ON(sizeof(*d) > PAGE_SIZE); + + if ( d ) + clear_page(d); + + return d; +} + +static void free_domain_struct(struct domain *d) +{ + free_xenheap_page(d); +} + /* * Destroy a domain once all references to it have been dropped. Used eit= her * from the RCU path, or from the domain_create() error path before the do= main @@ -819,27 +840,6 @@ static int sanitise_domain_config(struct xen_domctl_cr= eatedomain *config) return arch_sanitise_domain_config(config); } =20 -struct domain *alloc_domain_struct(void) -{ -#ifndef arch_domain_struct_memflags -# define arch_domain_struct_memflags() 0 -#endif - - struct domain *d =3D alloc_xenheap_pages(0, arch_domain_struct_memflag= s()); - - BUILD_BUG_ON(sizeof(*d) > PAGE_SIZE); - - if ( d ) - clear_page(d); - - return d; -} - -void free_domain_struct(struct domain *d) -{ - free_xenheap_page(d); -} - struct domain *domain_create(domid_t domid, struct xen_domctl_createdomain *config, unsigned int flags) diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h index 644f5ac3f293..273717c31b3f 100644 --- a/xen/include/xen/domain.h +++ b/xen/include/xen/domain.h @@ -66,10 +66,6 @@ void domid_free(domid_t domid); * Arch-specifics. */ =20 -/* Allocate/free a domain structure. */ -struct domain *alloc_domain_struct(void); -void free_domain_struct(struct domain *d); - /* Allocate/free a PIRQ structure. */ #ifndef alloc_pirq_struct struct pirq *alloc_pirq_struct(struct domain *d); --=20 2.52.0