From nobody Mon May 13 19:34:01 2024 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=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1701463720; cv=none; d=zohomail.com; s=zohoarc; b=IYYJq90PpZkwJOAuip3MKMDc4+es0KI1e9d/qxm17BlflB24k9mQoFpD13cjf7EaQzT/BzQrxI7ADWiTTy2UGGdM384PpwMa1rpLpvHPycwhLqOrL+GMx6U9PjTy+m8u/fvetLapwG1iHob6moUs0/cal0mA8r33ezsrLQNBvio= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1701463720; 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=kntzdviDOrMkN3wCkTohVu+TWP0dwfqrKsJ3rPfsygc=; b=XRRn9hBGjdF6k22oeh8sVzZ1cTlkwM5Ux+tBrvjN0DBqF9kLnufIpREeApdBliuVDagepB7MrQElgoHwxJRgCd3OpohYqVwrbXfQEK3XoJC8yRnS6ZAC5Lr9n1UmRWD9Ako2EIqbgFffJ9kK5IgsRWKRvGRLnHSimsqWJH+s6uM= 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 1701463720472623.2551638002366; Fri, 1 Dec 2023 12:48:40 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.645738.1008001 (Exim 4.92) (envelope-from ) id 1r9AQr-0007HO-Tb; Fri, 01 Dec 2023 20:48:17 +0000 Received: by outflank-mailman (output) from mailman id 645738.1008001; Fri, 01 Dec 2023 20:48:17 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r9AQr-0007Gy-Q1; Fri, 01 Dec 2023 20:48:17 +0000 Received: by outflank-mailman (input) for mailman id 645738; Fri, 01 Dec 2023 20:48:16 +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 1r9AQq-0007Cg-Tu for xen-devel@lists.xenproject.org; Fri, 01 Dec 2023 20:48:16 +0000 Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [2a00:1450:4864:20::22f]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id f3ad980a-908a-11ee-98e5-6d05b1d4d9a1; Fri, 01 Dec 2023 21:48:16 +0100 (CET) Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-2c9b88cf626so35147531fa.3 for ; Fri, 01 Dec 2023 12:48:16 -0800 (PST) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id i18-20020a2ea372000000b002c6ed7e546esm511142ljn.124.2023.12.01.12.48.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 12:48:15 -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: f3ad980a-908a-11ee-98e5-6d05b1d4d9a1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701463696; x=1702068496; 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=kntzdviDOrMkN3wCkTohVu+TWP0dwfqrKsJ3rPfsygc=; b=dNAa8xN0gEsAJrzf1rOkYz12bmYnnc3It8BzpMXsjCdaPPuYhyM7jr7anzmIGPUUUq HlJhlo3czhS2aOXn++vGW6VOeDzaAnyliNCQSxB0D/IjdWNs5YSumktuuW7H1lR/Pc9U owtvrXuNXApgiSZeBob9JDW1hLay8xAswZROwhMHszOKvBt7SxDb8D0WKVALG0PFQ2wt m1l6nr51lEwBWhpLFmkVeZ1w+r5iIroo0BbRSLqs9LoFeupw44VCmrrgjCxTBvet/LqF AcRR/HjulUV38teeiBfe/RPCPwFU/9iQoLHA3ORmJcSTVkgafnwFohY5MP5hBlwFzePM qy/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701463696; x=1702068496; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kntzdviDOrMkN3wCkTohVu+TWP0dwfqrKsJ3rPfsygc=; b=iiMAfpMqmnL7yMxMGmxDlsxyZroly4U4PMMGth2ZJwskKXPfCfp70QjYfaJLOogryb quaTR0FXKmVuT3nJQZZ+dm8qzvCTc779beuuw9hr2vczia460Ke4nrpeQFpemi3V+w5/ LUONiwFpMO0V5zX1XAGv4ODVNQoPxIPFCWr/ivaauK6PNHgkahtFARHTe0Z1YMy3o0T6 MB9fJJX9J/oLRX1iJEoHgEzyXmmfov2N2qFivXmnFPqErt2BbI7f7+DF2xmNyvc1Jrmr 1o0KjjrziLNfgxlwQHk9waLUe7NxKgFLYEvjip2BXHC3EiCezDq/tpRnhi8eaRgLMM71 ZSaw== X-Gm-Message-State: AOJu0YzGfbqL9GeXx8+8XKW5HU6vHKaNf+UtD6R0AtNPho3RmJ5/WaUl tpfQQLVYS/QhrJsWySeYT0+T73YdG/ju8Q== X-Google-Smtp-Source: AGHT+IEK4j4Ndtrh17dUAZYcYk2MnIRP2Fl/vPdXGIk3NqXEZwSdCDGHgiIEbScdkHP+dYCnvK4m+g== X-Received: by 2002:a2e:3310:0:b0:2c9:abe5:67df with SMTP id d16-20020a2e3310000000b002c9abe567dfmr1127135ljc.48.1701463695445; Fri, 01 Dec 2023 12:48:15 -0800 (PST) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk , Andrew Cooper , George Dunlap , Jan Beulich , Wei Liu , Shawn Anastasio , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [PATCH v5 1/7] xen/asm-generic: introduce generic div64.h header Date: Fri, 1 Dec 2023 22:48:04 +0200 Message-ID: <32c29653e071f134bc3eb0c707ee6e2f947014ad.1701453087.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1701463720732000001 Content-Type: text/plain; charset="utf-8" All archs have the do_div implementation for BITS_PER_LONG =3D=3D 64 so do_div64.h is moved to asm-generic. x86 and PPC were switched to asm-generic version of div64.h. Arm was switched partly because Arm has different implementation for 32-bits. Signed-off-by: Oleksii Kurochko Acked-by: Jan Beulich Acked-by: Shawn Anastasio --- Changes in V5: - add Acked-by: Shawn Anastasio - Update the commit message - Partly switch Arm's div64.h to asm-generic version. Arm has different implementation for 32-bits so only 64-bit version was switched. --- Changes in V4: - Added Acked-by: Jan Beulich . - include in Arm's div64.h for 64-bit case. --- Changes in V3: - Drop x86 and PPC's div64.h. - Update the commit message. --- Changes in V2: - rename base to divisor - add "#if BITS_PER_LONG =3D=3D 64" - fix code style --- xen/arch/arm/include/asm/div64.h | 8 +------- xen/arch/ppc/include/asm/Makefile | 1 + xen/arch/ppc/include/asm/div64.h | 14 -------------- xen/arch/x86/include/asm/Makefile | 1 + xen/arch/x86/include/asm/div64.h | 14 -------------- xen/include/asm-generic/div64.h | 27 +++++++++++++++++++++++++++ 6 files changed, 30 insertions(+), 35 deletions(-) delete mode 100644 xen/arch/ppc/include/asm/div64.h delete mode 100644 xen/arch/x86/include/asm/div64.h create mode 100644 xen/include/asm-generic/div64.h diff --git a/xen/arch/arm/include/asm/div64.h b/xen/arch/arm/include/asm/di= v64.h index fc667a80f9..0459d5cc01 100644 --- a/xen/arch/arm/include/asm/div64.h +++ b/xen/arch/arm/include/asm/div64.h @@ -24,13 +24,7 @@ =20 #if BITS_PER_LONG =3D=3D 64 =20 -# define do_div(n,base) ({ \ - uint32_t __base =3D (base); \ - uint32_t __rem; \ - __rem =3D ((uint64_t)(n)) % __base; \ - (n) =3D ((uint64_t)(n)) / __base; \ - __rem; \ - }) +#include =20 #elif BITS_PER_LONG =3D=3D 32 =20 diff --git a/xen/arch/ppc/include/asm/Makefile b/xen/arch/ppc/include/asm/M= akefile index 2da995bb2f..a8e848d4d0 100644 --- a/xen/arch/ppc/include/asm/Makefile +++ b/xen/arch/ppc/include/asm/Makefile @@ -1,5 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-only generic-y +=3D altp2m.h +generic-y +=3D div64.h generic-y +=3D hardirq.h generic-y +=3D hypercall.h generic-y +=3D iocap.h diff --git a/xen/arch/ppc/include/asm/div64.h b/xen/arch/ppc/include/asm/di= v64.h deleted file mode 100644 index d213e50585..0000000000 --- a/xen/arch/ppc/include/asm/div64.h +++ /dev/null @@ -1,14 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#ifndef __ASM_PPC_DIV64_H__ -#define __ASM_PPC_DIV64_H__ - -#include - -#define do_div(n, base) ({ \ - uint32_t base_ =3D (base); \ - uint32_t rem_ =3D (uint64_t)(n) % base_; \ - (n) =3D (uint64_t)(n) / base_; \ - rem_; \ -}) - -#endif /* __ASM_PPC_DIV64_H__ */ diff --git a/xen/arch/x86/include/asm/Makefile b/xen/arch/x86/include/asm/M= akefile index 874429ed30..daab34ff0a 100644 --- a/xen/arch/x86/include/asm/Makefile +++ b/xen/arch/x86/include/asm/Makefile @@ -1,2 +1,3 @@ # SPDX-License-Identifier: GPL-2.0-only +generic-y +=3D div64.h generic-y +=3D percpu.h diff --git a/xen/arch/x86/include/asm/div64.h b/xen/arch/x86/include/asm/di= v64.h deleted file mode 100644 index dd49f64a3b..0000000000 --- a/xen/arch/x86/include/asm/div64.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef __X86_DIV64 -#define __X86_DIV64 - -#include - -#define do_div(n,base) ({ \ - uint32_t __base =3D (base); \ - uint32_t __rem; \ - __rem =3D ((uint64_t)(n)) % __base; \ - (n) =3D ((uint64_t)(n)) / __base; \ - __rem; \ -}) - -#endif diff --git a/xen/include/asm-generic/div64.h b/xen/include/asm-generic/div6= 4.h new file mode 100644 index 0000000000..068d8a11ad --- /dev/null +++ b/xen/include/asm-generic/div64.h @@ -0,0 +1,27 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ASM_GENERIC_DIV64 +#define __ASM_GENERIC_DIV64 + +#include + +#if BITS_PER_LONG =3D=3D 64 + +#define do_div(n, divisor) ({ \ + uint32_t divisor_ =3D (divisor); \ + uint32_t rem_ =3D (uint64_t)(n) % divisor_; \ + (n) =3D (uint64_t)(n) / divisor_; \ + rem_; \ +}) + +#endif /* BITS_PER_LONG */ + +#endif + +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ --=20 2.43.0 From nobody Mon May 13 19:34:01 2024 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=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1701463730; cv=none; d=zohomail.com; s=zohoarc; b=eLj7ffsMHkkX+1IyZR7beTkcdeW+ho1wZFU/fVYb/Fra4VHXdPRLk020uh3lpU6Ex+9TuwLigi62fPx6y+nJbiPhYlFoGAd8IEGapyBa/vGSX4Fi2oKxG3fhsVyJshdm0PqrgcZrEyMT3McU6BYKBK/nb8xlV3jqLMuAEVh8ZUE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1701463730; 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=U/Fa3V+suVuY5Wl4cnMTSRfOG8VUNxvSJcflHXogt7E=; b=fUWIhUTpC0WrOLTZxfMEe4EmrtL1npzZpmrsq3/D+pySF9HW24CK2XqLFwmkj+gkUrBSF4jzSEPNl4jsyVlVvArgI6Af+vaRYg37N82MJy9ahOsJD7WuRwx594Ew+jxkLoo6SWblOzShlb0rOmBXGxznKjCGHGHFlQ1cCDQT5M0= 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 1701463730716454.3793685163589; Fri, 1 Dec 2023 12:48:50 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.645739.1008016 (Exim 4.92) (envelope-from ) id 1r9AQv-0007jz-4M; Fri, 01 Dec 2023 20:48:21 +0000 Received: by outflank-mailman (output) from mailman id 645739.1008016; Fri, 01 Dec 2023 20:48:21 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r9AQv-0007jr-1B; Fri, 01 Dec 2023 20:48:21 +0000 Received: by outflank-mailman (input) for mailman id 645739; Fri, 01 Dec 2023 20:48:19 +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 1r9AQt-0007Cg-95 for xen-devel@lists.xenproject.org; Fri, 01 Dec 2023 20:48:19 +0000 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [2a00:1450:4864:20::129]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id f4fa5bb2-908a-11ee-98e5-6d05b1d4d9a1; Fri, 01 Dec 2023 21:48:18 +0100 (CET) Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-50bc811d12fso3606748e87.1 for ; Fri, 01 Dec 2023 12:48:18 -0800 (PST) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id i18-20020a2ea372000000b002c6ed7e546esm511142ljn.124.2023.12.01.12.48.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 12:48:16 -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: f4fa5bb2-908a-11ee-98e5-6d05b1d4d9a1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701463698; x=1702068498; 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=U/Fa3V+suVuY5Wl4cnMTSRfOG8VUNxvSJcflHXogt7E=; b=WPcrJlWDVWLfTosghFwDp3uH2wzUSNYO2ieyUJus8OX8vYMPvJPDOJVoZOfWUk4sMB Ou6Dc7Znj0tdHKIks8J9HdC8sQTrqNOxbF7mE/ZcR9puwqnOY77RkypcoE3RLLSJm+9o XpJpUehMH9rV5pHxC+zyeEcRJWk/PfELOXy2LKMgRYl78FRqf+s6vnYuao5wCMy+Sw/K 7NN6eK5IdEzNslDaJL+nVJbFzMQRtTBTLhuNh+7n2xZ6F4dlFCtmS11oz9nNpv/NQZyW q+RYwfB6KSdibz0qNZKmkNV/J7l2Goty9Fj4v+LEYp5hVQtlLhpKv6B1yn+lqRJPG62m RPZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701463698; x=1702068498; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=U/Fa3V+suVuY5Wl4cnMTSRfOG8VUNxvSJcflHXogt7E=; b=gbwkXHBmBEFeePo98uBr/Dt1EBaZMbVcuts8Bac6wOiCAq2epveCyM/kBl6BjwJsU6 fg0LYMR+GxMrN4Ac01BJs24nx3hNDCguc6fByCLiG8o9bbljNiAEnJxsCvqzMCwmvWIc skXkfrJdzX8Jmrozucg825FDFo0sGBzkYdueaAQ15iHU6Yss7TQ5dwe37ERk1V1yGJRo IAphYxWPuWmyVhPnog3IV9O4sBXelW08dt4/fXs/L+ozkPoyobCHamturHXrLg2z1D43 67TKUDJmhPvWFX2dRxQEOI64K6/4JjWpJdCrrl9OnTJiSDPpcNbVhOsdXZzsQww6e/Dn 9KdA== X-Gm-Message-State: AOJu0Yy+t5g6HEMEDm5KE4fqLNvud13pt4Htg14sRoYvdqakl8/bqU1H FB8hYDR7bwY9V2cKajOMugxCMFfc5keOcw== X-Google-Smtp-Source: AGHT+IFWs2H8CtxOHc9wOx2zpzoQ08DIixhbTwRslXs2DSEgkFsBo4hLz8/rpY8QZwzf66GVzWMLww== X-Received: by 2002:a2e:8017:0:b0:2c9:dae6:43f4 with SMTP id j23-20020a2e8017000000b002c9dae643f4mr633507ljg.118.1701463697700; Fri, 01 Dec 2023 12:48:17 -0800 (PST) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , Tamas K Lengyel , Alexandru Isaila , Petre Pircalabu , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk , Shawn Anastasio , Jan Beulich Subject: [PATCH v5 2/7] xen/asm-generic: introduce stub header monitor.h Date: Fri, 1 Dec 2023 22:48:05 +0200 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1701463732808000002 Content-Type: text/plain; charset="utf-8" The header is shared between several archs so it is moved to asm-generic. Switch partly Arm and PPC to asm-generic/monitor.h and only arch_monitor_get_capabilities() left in arch-specific/monitor.h. Signed-off-by: Oleksii Kurochko Acked-by: Jan Beulich --- Changes in V5: - Switched partly Arm and PPC to asm-generic monitor.h only arch_monitor_get_capabilities() left in arch-specific/monitor.h. - Updated the commit message. --- Changes in V4: - Removed the double blank line. - Added Acked-by: Jan Beulich . - Update the commit message --- Changes in V3: - Use forward-declaration of struct domain instead of " #include ". - Add ' include ' - Drop PPC's monitor.h. --- Changes in V2: - remove inclusion of "+#include " - add "struct xen_domctl_monitor_op;" - remove one of SPDX tags. --- xen/arch/arm/include/asm/monitor.h | 28 +-------------- xen/arch/ppc/include/asm/monitor.h | 28 +-------------- xen/include/asm-generic/monitor.h | 57 ++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 54 deletions(-) create mode 100644 xen/include/asm-generic/monitor.h diff --git a/xen/arch/arm/include/asm/monitor.h b/xen/arch/arm/include/asm/= monitor.h index 7567be66bd..045217c310 100644 --- a/xen/arch/arm/include/asm/monitor.h +++ b/xen/arch/arm/include/asm/monitor.h @@ -25,33 +25,7 @@ #include #include =20 -static inline -void arch_monitor_allow_userspace(struct domain *d, bool allow_userspace) -{ -} - -static inline -int arch_monitor_domctl_op(struct domain *d, struct xen_domctl_monitor_op = *mop) -{ - /* No arch-specific monitor ops on ARM. */ - return -EOPNOTSUPP; -} - -int arch_monitor_domctl_event(struct domain *d, - struct xen_domctl_monitor_op *mop); - -static inline -int arch_monitor_init_domain(struct domain *d) -{ - /* No arch-specific domain initialization on ARM. */ - return 0; -} - -static inline -void arch_monitor_cleanup_domain(struct domain *d) -{ - /* No arch-specific domain cleanup on ARM. */ -} +#include =20 static inline uint32_t arch_monitor_get_capabilities(struct domain *d) { diff --git a/xen/arch/ppc/include/asm/monitor.h b/xen/arch/ppc/include/asm/= monitor.h index e5b0282bf1..89000dacc6 100644 --- a/xen/arch/ppc/include/asm/monitor.h +++ b/xen/arch/ppc/include/asm/monitor.h @@ -6,33 +6,7 @@ #include #include =20 -static inline -void arch_monitor_allow_userspace(struct domain *d, bool allow_userspace) -{ -} - -static inline -int arch_monitor_domctl_op(struct domain *d, struct xen_domctl_monitor_op = *mop) -{ - /* No arch-specific monitor ops on PPC. */ - return -EOPNOTSUPP; -} - -int arch_monitor_domctl_event(struct domain *d, - struct xen_domctl_monitor_op *mop); - -static inline -int arch_monitor_init_domain(struct domain *d) -{ - /* No arch-specific domain initialization on PPC. */ - return 0; -} - -static inline -void arch_monitor_cleanup_domain(struct domain *d) -{ - /* No arch-specific domain cleanup on PPC. */ -} +#include =20 static inline uint32_t arch_monitor_get_capabilities(struct domain *d) { diff --git a/xen/include/asm-generic/monitor.h b/xen/include/asm-generic/mo= nitor.h new file mode 100644 index 0000000000..74e4870cd7 --- /dev/null +++ b/xen/include/asm-generic/monitor.h @@ -0,0 +1,57 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * include/asm-generic/monitor.h + * + * Arch-specific monitor_op domctl handler. + * + * Copyright (c) 2015 Tamas K Lengyel (tamas@tklengyel.com) + * Copyright (c) 2016, Bitdefender S.R.L. + * + */ + +#ifndef __ASM_GENERIC_MONITOR_H__ +#define __ASM_GENERIC_MONITOR_H__ + +#include + +struct domain; +struct xen_domctl_monitor_op; + +static inline +void arch_monitor_allow_userspace(struct domain *d, bool allow_userspace) +{ +} + +static inline +int arch_monitor_domctl_op(struct domain *d, struct xen_domctl_monitor_op = *mop) +{ + /* No arch-specific monitor ops on GENERIC. */ + return -EOPNOTSUPP; +} + +int arch_monitor_domctl_event(struct domain *d, + struct xen_domctl_monitor_op *mop); + +static inline +int arch_monitor_init_domain(struct domain *d) +{ + /* No arch-specific domain initialization on GENERIC. */ + return 0; +} + +static inline +void arch_monitor_cleanup_domain(struct domain *d) +{ + /* No arch-specific domain cleanup on GENERIC. */ +} + +#endif /* __ASM_GENERIC_MONITOR_H__ */ + +/* + * Local variables: + * mode: C + * c-file-style: BSD + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ --=20 2.43.0 From nobody Mon May 13 19:34:01 2024 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=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1701463720; cv=none; d=zohomail.com; s=zohoarc; b=Efoun+tcvAF0VOE29ii+UK8LsKuJp9vBmTQ1wSnZEpuII5nUlmrqFtIA6ujW1Ftaaa4nLdzXpFOD2Hs9gVynHyTURkZnMw0MDV3v1Qr7xkHgKvwhjeKpf+xqJs9g4EVC72A4v1NnWWBPdR6QZx4JV45e8R9NiN2l1RoicCmbOyc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1701463720; 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=/UjRVghE9J4L7xQTZkvPdVbMV4X+mNlL7EmIYrZm+io=; b=JWWH9YSwaZlXg1oIX0E+TI7xBDI44Oq5FV1H8hjb8dRkjBVu6NeqsBaYP+2J54ACP0cEjIVXtxj5QdsacQA5CBGv6oKeImZuU4ljcTbuwoyJzmfkKC9Ah9ZqJio8t+eucRnkLX+FBu6qI6wJRokjEdQUmhJnXVOSepl5n/ndcXc= 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 170146372086559.027989674922765; Fri, 1 Dec 2023 12:48:40 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.645740.1008021 (Exim 4.92) (envelope-from ) id 1r9AQv-0007nW-F4; Fri, 01 Dec 2023 20:48:21 +0000 Received: by outflank-mailman (output) from mailman id 645740.1008021; Fri, 01 Dec 2023 20:48:21 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r9AQv-0007mc-AQ; Fri, 01 Dec 2023 20:48:21 +0000 Received: by outflank-mailman (input) for mailman id 645740; Fri, 01 Dec 2023 20:48:20 +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 1r9AQu-0007Cg-S5 for xen-devel@lists.xenproject.org; Fri, 01 Dec 2023 20:48:20 +0000 Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [2a00:1450:4864:20::232]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id f6032f4d-908a-11ee-98e5-6d05b1d4d9a1; Fri, 01 Dec 2023 21:48:20 +0100 (CET) Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2c9bd3ec4f6so32579011fa.2 for ; Fri, 01 Dec 2023 12:48:20 -0800 (PST) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id i18-20020a2ea372000000b002c6ed7e546esm511142ljn.124.2023.12.01.12.48.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 12:48:18 -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: f6032f4d-908a-11ee-98e5-6d05b1d4d9a1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701463699; x=1702068499; 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=/UjRVghE9J4L7xQTZkvPdVbMV4X+mNlL7EmIYrZm+io=; b=iEWljsrN7irkOrODpaFCArSB04ycQtj694iIdpnOfybDFafP6smzsTairpq8ca5nZr 3PmHV15hiVbh3vdKzBnvL8HOZCjTexszq52cfk2Z4jr7NwLg0W9B8YgNRbVq2MgSm675 5jL+n9EH7BL6qzMYlf4rWIuCti7gF17zZMbye1f/+lP0DoSdDAY4HfdiJ7d+xW9BpMNg DEZ5w0JHQGoraOGz2hd05I0WHNqcs3qUPFWyZG+IuBD24ib/AY+ynPbaqw85LJkocVb2 hc/WSI/f37j4G96zx/qiYnF2+3mba77EVJz6pmUeE0GCMDJOwa6x7B9x3i1z/X9JUsL4 W9tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701463699; x=1702068499; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/UjRVghE9J4L7xQTZkvPdVbMV4X+mNlL7EmIYrZm+io=; b=qQg8oH+H/sw1XkSZEk+sbaj+ELI22rsFtgVDMKDtH9fuuWUJAw8AEsVpIvbZ9KxoX0 kD+vODmNCLK3vAMWU5A6UU4uE0TMTsmQJG8InoJH2hLPwZcb7Ptmd4U+Yjn969EsSP9p 13zAfqXeDEyugDjfhzvh56NKK5mGDQ3Ij7u9Gb63skz/G+zLb2NfbmTgTwdssYqWBoV8 ofAnam5OU9fbng8THzQyMz/p/Zhl9dAHY6xcQVUvf/0CNJwjzd+92YrbiN1gE9CxiaYW TGRAgH4w0kKxhJnrcl5Q7F0nd++sD14CKCTDclQY2HtXO8p81i77X/PxsHhYjvEDz91k DZVg== X-Gm-Message-State: AOJu0YwLkGgr9ARyMV4ObQ6OGovspFhUJnnIv58Kh6z+Fb6TA6bFCy2I F/z9FCHM3YSUThDRzLEM//TiscCUZUj1Tw== X-Google-Smtp-Source: AGHT+IH5vurx8p7bWFO45XGaaJms9rqDfrneohtT4L7xQU+8npR3XxsnunrAzVyVIbOVjPlzKUXlpQ== X-Received: by 2002:a2e:9ec1:0:b0:2c9:c05b:9870 with SMTP id h1-20020a2e9ec1000000b002c9c05b9870mr1096802ljk.23.1701463698941; Fri, 01 Dec 2023 12:48:18 -0800 (PST) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk , Andrew Cooper , George Dunlap , Jan Beulich , Wei Liu , Shawn Anastasio Subject: [PATCH v5 3/7] xen/asm-generic: introduce stub header numa.h Date: Fri, 1 Dec 2023 22:48:06 +0200 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1701463722772000001 Content-Type: text/plain; charset="utf-8" is common through some archs so it is moved to asm-generic. Signed-off-by: Oleksii Kurochko Reviewed-by: Michal Orzel Acked-by: Jan Beulich Acked-by: Shawn Anastasio --- Changes in V5: - Added Acked-by: Jan Beulich - Updated the comment around first_valid_mfn. ( Arm -> GENERIC ) - Added Acked-by: Shawn Anastasio --- Changes in V4: - Updated guards name: *ARCH_GENERIC* -> *ASM_GENERIC*. - Moved inclusion of xen/mm-frame.h under "#ifndef CONFIG_NUMA". - Added Reviewed-by: Michal Orzel . --- Changes in V3: - Remove old header inclusion in asm-generic numa.h and include and - Drop Arm and PPC's numa.h and use asm-generic version instead. --- Changes in V2: - update the commit message. - change u8 to uint8_t. - add ifnded CONFIG_NUMA. --- xen/arch/arm/include/asm/Makefile | 1 + xen/arch/ppc/include/asm/Makefile | 1 + xen/arch/ppc/include/asm/numa.h | 26 ------------------- .../asm =3D> include/asm-generic}/numa.h | 16 +++++++----- 4 files changed, 12 insertions(+), 32 deletions(-) delete mode 100644 xen/arch/ppc/include/asm/numa.h rename xen/{arch/arm/include/asm =3D> include/asm-generic}/numa.h (67%) diff --git a/xen/arch/arm/include/asm/Makefile b/xen/arch/arm/include/asm/M= akefile index 8221429c2c..0c855a798a 100644 --- a/xen/arch/arm/include/asm/Makefile +++ b/xen/arch/arm/include/asm/Makefile @@ -2,6 +2,7 @@ generic-y +=3D altp2m.h generic-y +=3D hardirq.h generic-y +=3D iocap.h +generic-y +=3D numa.h generic-y +=3D paging.h generic-y +=3D percpu.h generic-y +=3D random.h diff --git a/xen/arch/ppc/include/asm/Makefile b/xen/arch/ppc/include/asm/M= akefile index a8e848d4d0..f09c5ea8a1 100644 --- a/xen/arch/ppc/include/asm/Makefile +++ b/xen/arch/ppc/include/asm/Makefile @@ -4,6 +4,7 @@ generic-y +=3D div64.h generic-y +=3D hardirq.h generic-y +=3D hypercall.h generic-y +=3D iocap.h +generic-y +=3D numa.h generic-y +=3D paging.h generic-y +=3D percpu.h generic-y +=3D random.h diff --git a/xen/arch/ppc/include/asm/numa.h b/xen/arch/ppc/include/asm/num= a.h deleted file mode 100644 index 7fdf66c3da..0000000000 --- a/xen/arch/ppc/include/asm/numa.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef __ASM_PPC_NUMA_H__ -#define __ASM_PPC_NUMA_H__ - -#include -#include - -typedef uint8_t nodeid_t; - -/* Fake one node for now. See also node_online_map. */ -#define cpu_to_node(cpu) 0 -#define node_to_cpumask(node) (cpu_online_map) - -/* - * TODO: make first_valid_mfn static when NUMA is supported on PPC, this - * is required because the dummy helpers are using it. - */ -extern mfn_t first_valid_mfn; - -/* XXX: implement NUMA support */ -#define node_spanned_pages(nid) (max_page - mfn_x(first_valid_mfn)) -#define node_start_pfn(nid) (mfn_x(first_valid_mfn)) -#define __node_distance(a, b) (20) - -#define arch_want_default_dmazone() (false) - -#endif /* __ASM_PPC_NUMA_H__ */ diff --git a/xen/arch/arm/include/asm/numa.h b/xen/include/asm-generic/numa= .h similarity index 67% rename from xen/arch/arm/include/asm/numa.h rename to xen/include/asm-generic/numa.h index e2bee2bd82..7f95a77e89 100644 --- a/xen/arch/arm/include/asm/numa.h +++ b/xen/include/asm-generic/numa.h @@ -1,18 +1,21 @@ -#ifndef __ARCH_ARM_NUMA_H -#define __ARCH_ARM_NUMA_H +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ASM_GENERIC_NUMA_H +#define __ASM_GENERIC_NUMA_H =20 -#include +#include =20 -typedef u8 nodeid_t; +typedef uint8_t nodeid_t; =20 #ifndef CONFIG_NUMA =20 +#include + /* Fake one node for now. See also node_online_map. */ #define cpu_to_node(cpu) 0 #define node_to_cpumask(node) (cpu_online_map) =20 /* - * TODO: make first_valid_mfn static when NUMA is supported on Arm, this + * TODO: make first_valid_mfn static when NUMA is supported on GENERIC, th= is * is required because the dummy helpers are using it. */ extern mfn_t first_valid_mfn; @@ -26,7 +29,8 @@ extern mfn_t first_valid_mfn; =20 #define arch_want_default_dmazone() (false) =20 -#endif /* __ARCH_ARM_NUMA_H */ +#endif /* __ASM_GENERIC_NUMA_H */ + /* * Local variables: * mode: C --=20 2.43.0 From nobody Mon May 13 19:34:01 2024 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=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1701463734; cv=none; d=zohomail.com; s=zohoarc; b=D+sf5bvZS8h+WD80dHseDuLB6FOV7glBjg9ptkWsLOvZ3tuWyfYFugy4MCvy+XRRPFJllWFCRmP9eYL/48Ny6gUUB6VaFKuXNU+ODrQEejIj9CKHt5+NvcTELY6FVrj1ylfy6pvCejPbTAuYQ5XNg1uPFnf+Py+VCX4l8opAkpI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1701463734; 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=8K0BYHGWC+ogJ6gBKSwmGTMdkzCbZuHLzNWf4Sj6tTQ=; b=joxlJniS45y4RIG+x6VieosYWD+0UkPO1mdKUJfz2y5V3qZOLgPj12bqwOODT9EHL+jp2QuHRAhnirvbqLiP8OFq7TVHajhrGOJiSG0mmp4Vtx1DVe4t3FZw+OYeOZSeMpITiUV7j9502S0uKdnnA99JYRqfKwG4giz0ec6RuwA= 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 1701463734090835.1216898778835; Fri, 1 Dec 2023 12:48:54 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.645742.1008046 (Exim 4.92) (envelope-from ) id 1r9AR0-00009X-3u; Fri, 01 Dec 2023 20:48:26 +0000 Received: by outflank-mailman (output) from mailman id 645742.1008046; Fri, 01 Dec 2023 20:48:26 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r9AR0-00009K-0G; Fri, 01 Dec 2023 20:48:26 +0000 Received: by outflank-mailman (input) for mailman id 645742; Fri, 01 Dec 2023 20:48:24 +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 1r9AQy-0008SX-MU for xen-devel@lists.xenproject.org; Fri, 01 Dec 2023 20:48:24 +0000 Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [2a00:1450:4864:20::22d]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id f6dc7b51-908a-11ee-9b0f-b553b5be7939; Fri, 01 Dec 2023 21:48:22 +0100 (CET) Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2c9c149848fso33125571fa.2 for ; Fri, 01 Dec 2023 12:48:21 -0800 (PST) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id i18-20020a2ea372000000b002c6ed7e546esm511142ljn.124.2023.12.01.12.48.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 12:48:20 -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: f6dc7b51-908a-11ee-9b0f-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701463700; x=1702068500; 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=8K0BYHGWC+ogJ6gBKSwmGTMdkzCbZuHLzNWf4Sj6tTQ=; b=Fp9CMOCPpf5JGCK4HACnzwkanlzaWMhDJiNi+mGQzTt/UGqRU9Q2VjI+yHfaH5vU6N 39M4W1q63uyZ6qxI8tfV7crhn2Y9Z+Qmea3qFEbKbSn5fX20ZU4iW/l4Lvobz4mkBCcc WxU8J1ZXmn/xBT1i6EDo/o1BebstyICubvql6YU5YSyGmR56q1psmrotfSjgNv7rnVO8 3oMFm0L35leNXilWOeAYHdYkraf8MbdMMZKOT2O5Nf+uvloynU/s59KpPvgEJPoP8DKp zhDZxKUF4hk1wzx3UtcFjfCnjxNO+CyDPdD+mSI5s5Tfd/8iT9TjdeelQxBXi3HP6XCG LN/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701463700; x=1702068500; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8K0BYHGWC+ogJ6gBKSwmGTMdkzCbZuHLzNWf4Sj6tTQ=; b=kLqPu8grBR4BoYpD5KH8qZlxN2VfxwNpxJCUH1MzCN9ZguKFu71l1ok52IlydCEgM3 1xvqlFuquh4YWu2PlTNYAOpNRgmQ8A8PRQocRDTr0UO/5T7ZwELgxSWoZ5gUaJTlT34R WTroNkmht3vH5GXoa4pCTylmotSLDkerLr2JiJ8qheYjLrLA60PCPJNrea924k05bRK1 8sZwbx0Uv1esm2wB7Iw+MGpBWzOAkOTVznebK5fQ8aRPW3nq4xs/9tz1TmgkCDRFuyS9 s67DyjqElqmmH3m6dQJH03/YopuUSJ8D7cuPOeYnS/peuarzwInUQls0CrzUtED48Riq 6NwA== X-Gm-Message-State: AOJu0YxQleqQh+6DXqT/Aqy3D4c/6BrvCbSqF7WuJzM8gkYz0C78+GrW Mue2aSruukIKRPpV9ljq1EF+ojzHGInRoA== X-Google-Smtp-Source: AGHT+IHwoqKK/fylcEtCmUl06UVfE5szR9Dr+PSwdTucXZKF9B4qEHFRgrM3cdOmVKbTGjFnDwKmzg== X-Received: by 2002:a2e:9286:0:b0:2c9:c43e:8ac2 with SMTP id d6-20020a2e9286000000b002c9c43e8ac2mr1054667ljh.12.1701463700396; Fri, 01 Dec 2023 12:48:20 -0800 (PST) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk , Andrew Cooper , George Dunlap , Jan Beulich , Wei Liu , Shawn Anastasio Subject: [PATCH v5 4/7] xen/asm-generic: introduce stub header softirq.h Date: Fri, 1 Dec 2023 22:48:07 +0200 Message-ID: <56ce43435f5f9be025d74503f173ef04176f4882.1701453087.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1701463734749000007 Content-Type: text/plain; charset="utf-8" is common between Arm, PPC and RISC-V so it is moved to asm-generic. Drop Arm and PPC's softirq.h and use asm-generic version instead. Signed-off-by: Oleksii Kurochko Reviewed-by: Michal Orzel Acked-by: Jan Beulich Acked-by: Shawn Anastasio --- Changes in V5: - Strayed "Added" in commit message - Added Acked-by: Shawn Anastasio --- Changes in V4: - Added Reviewed-by: Michal Orzel - Added Acked-by: Jan Beulich --- Changes in V3: - Drop Arm and PPC's softirq.h - Update the commit message. --- Changes in V2: - update the commit message. --- xen/arch/arm/include/asm/Makefile | 1 + xen/arch/ppc/include/asm/Makefile | 1 + xen/arch/ppc/include/asm/softirq.h | 8 -------- .../arm/include/asm =3D> include/asm-generic}/softirq.h | 7 ++++--- 4 files changed, 6 insertions(+), 11 deletions(-) delete mode 100644 xen/arch/ppc/include/asm/softirq.h rename xen/{arch/arm/include/asm =3D> include/asm-generic}/softirq.h (56%) diff --git a/xen/arch/arm/include/asm/Makefile b/xen/arch/arm/include/asm/M= akefile index 0c855a798a..a28cc5d1b1 100644 --- a/xen/arch/arm/include/asm/Makefile +++ b/xen/arch/arm/include/asm/Makefile @@ -6,4 +6,5 @@ generic-y +=3D numa.h generic-y +=3D paging.h generic-y +=3D percpu.h generic-y +=3D random.h +generic-y +=3D softirq.h generic-y +=3D vm_event.h diff --git a/xen/arch/ppc/include/asm/Makefile b/xen/arch/ppc/include/asm/M= akefile index f09c5ea8a1..efd72862c8 100644 --- a/xen/arch/ppc/include/asm/Makefile +++ b/xen/arch/ppc/include/asm/Makefile @@ -8,4 +8,5 @@ generic-y +=3D numa.h generic-y +=3D paging.h generic-y +=3D percpu.h generic-y +=3D random.h +generic-y +=3D softirq.h generic-y +=3D vm_event.h diff --git a/xen/arch/ppc/include/asm/softirq.h b/xen/arch/ppc/include/asm/= softirq.h deleted file mode 100644 index a0b28a5e51..0000000000 --- a/xen/arch/ppc/include/asm/softirq.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef __ASM_PPC_SOFTIRQ_H__ -#define __ASM_PPC_SOFTIRQ_H__ - -#define NR_ARCH_SOFTIRQS 0 - -#define arch_skip_send_event_check(cpu) 0 - -#endif /* __ASM_PPC_SOFTIRQ_H__ */ diff --git a/xen/arch/arm/include/asm/softirq.h b/xen/include/asm-generic/s= oftirq.h similarity index 56% rename from xen/arch/arm/include/asm/softirq.h rename to xen/include/asm-generic/softirq.h index 976e0ebd70..83be855e50 100644 --- a/xen/arch/arm/include/asm/softirq.h +++ b/xen/include/asm-generic/softirq.h @@ -1,11 +1,12 @@ -#ifndef __ASM_SOFTIRQ_H__ -#define __ASM_SOFTIRQ_H__ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ASM_GENERIC_SOFTIRQ_H__ +#define __ASM_GENERIC_SOFTIRQ_H__ =20 #define NR_ARCH_SOFTIRQS 0 =20 #define arch_skip_send_event_check(cpu) 0 =20 -#endif /* __ASM_SOFTIRQ_H__ */ +#endif /* __ASM_GENERIC_SOFTIRQ_H__ */ /* * Local variables: * mode: C --=20 2.43.0 From nobody Mon May 13 19:34:01 2024 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=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1701463732; cv=none; d=zohomail.com; s=zohoarc; b=ciB2MYo0Y6gDXZfpRmeJ6txg2U73Nh61H2PJRa1efrbUhorPFvShJgB58UUVbLEi6ynSsO/TRDuD/hMEGD03GoEhjYZjCZxlmBSDU74+PQmF3BXNGGNH+3g2bUdq/8OEa//FvN1CjNoiS6ZfsublLd6AJqc36A353kSw2whjF5Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1701463732; 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=98dqye18fLwa72WEQaaSfMetNkq8ERwjcy/m8vcBQK8=; b=Tl8LoBEPSBy/aRgDF7t+o+TBZn9jiD+dXgCSa7/VuCzdot0+SMDhy76hA49iddfYA0e3KhfR95rJhIvEGJW9cRzqujvVp+YxWWh3wDi3w5KNNFcD/4yyD5cTZrbeDZ6rc83wyO66wRhP6kDplK/U478ZXBCahvCfs1J+VmGszOw= 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 1701463732472132.1861769975692; Fri, 1 Dec 2023 12:48:52 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.645741.1008036 (Exim 4.92) (envelope-from ) id 1r9AQx-0008Hp-Ri; Fri, 01 Dec 2023 20:48:23 +0000 Received: by outflank-mailman (output) from mailman id 645741.1008036; Fri, 01 Dec 2023 20:48:23 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r9AQx-0008Hg-NH; Fri, 01 Dec 2023 20:48:23 +0000 Received: by outflank-mailman (input) for mailman id 645741; Fri, 01 Dec 2023 20:48:23 +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 1r9AQx-0007Cg-0t for xen-devel@lists.xenproject.org; Fri, 01 Dec 2023 20:48:23 +0000 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [2a00:1450:4864:20::12f]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id f7453d72-908a-11ee-98e5-6d05b1d4d9a1; Fri, 01 Dec 2023 21:48:22 +0100 (CET) Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-50aab20e828so3568801e87.2 for ; Fri, 01 Dec 2023 12:48:22 -0800 (PST) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id i18-20020a2ea372000000b002c6ed7e546esm511142ljn.124.2023.12.01.12.48.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 12:48:21 -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: f7453d72-908a-11ee-98e5-6d05b1d4d9a1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701463702; x=1702068502; 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=98dqye18fLwa72WEQaaSfMetNkq8ERwjcy/m8vcBQK8=; b=DO5OIK27pOj1REHF6laIFaDmM/ujXi67SmLwc5OuV+MTgGR6OHTuiIxSe1I6KQ97v5 YOqOSbZpe/JAwurvB8GGKGeK7SJAn/4sWfLl72GymRh0TTO0XqI1kgol0u+MU2Q3Dy1O aNbOTXfRqo8UwXVwdTFBRe3QyfTUv7aNGVruode9I6dXDua4mmcn1kCrupJXAAFf9Y30 NQ1oBqYICtuSnFgQPi4tvycee3C3jCdSWc6VewMJxwOGsdbk8UEZ82vB2JP/clNxiF0H hzeqSVumVQByDW7XMkdwpwvSM6TrnikuTr41FViObdVXsokR8ksoOqLAEHCTVPc0BlCp 313w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701463702; x=1702068502; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=98dqye18fLwa72WEQaaSfMetNkq8ERwjcy/m8vcBQK8=; b=IyNJs3k6ZR8Cef/kFK8Aq/vkEIMNxD8Q1RInv0GwiTRfW10IUBLM4wg6XfGOJXKRAy KAx/rpbA9xkIUrd2uwYk4QSZXJ+xOQ6w2Ibny1bR717o52EcmLq24zJ1yf3JwlU7psSc f8Nn3bMQ83tEjcsDWPLZLPVq4MiNtTozoxhbyZm5DT5tInDqX1qOneY7FhPR4wA9npSA QziHlkZ54Noh36vRscEdGBxSiOFyerq+4UHnLb4jf63c5D4LwKVTms2aWb8Ps0WC2JO8 c2RCKkjWLal2ygUNYkZxCC/k7Wg4LvQX7wR2/8UxiAoqLmnjsydRFd5eavJy33YXh7As +H6w== X-Gm-Message-State: AOJu0Yxke6RDXBC795/kHiHCQRRYuRmIlAl6/ASSxRw+G2+osTviilNV NKKyP7jodsBO4hr6ma4BbNOkdDV+6hriGQ== X-Google-Smtp-Source: AGHT+IEKoeZjYR6H3G2x7WPpojiIkwmASYCXEv2VAgpB6L1AmXxvi4ZmlpfB0myoSwll+u63sIyAHQ== X-Received: by 2002:a2e:9919:0:b0:2c9:d874:20ce with SMTP id v25-20020a2e9919000000b002c9d87420cemr1409509lji.88.1701463701770; Fri, 01 Dec 2023 12:48:21 -0800 (PST) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk , Andrew Cooper , George Dunlap , Jan Beulich , Wei Liu , Shawn Anastasio Subject: [PATCH v5 5/7] xen: ifdef inclusion of in Date: Fri, 1 Dec 2023 22:48:08 +0200 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1701463732795000001 Content-Type: text/plain; charset="utf-8" Ifdef-ing inclusion of allows to avoid generation of empty for cases when CONFIG_GRANT_TABLE is not enabled. The following changes were done for Arm: should be included directly because it contains gnttab_dom0_frames() macros which is unique for Arm and is used in arch/arm/domain_build.c. is #ifdef-ed with CONFIG_GRANT_TABLE in so in case of !CONFIG_GRANT_TABLE gnttab_dom0_frames won't be available for use in arch/arm/domain_build.c. Suggested-by: Jan Beulich Signed-off-by: Oleksii Kurochko --- Changes in V5: - Added dependencies for "Config GRANT_TABLE" to be sure that randconfig w= ill not turn on the config. --- Changes in V4: - Nothing changed. Only rebase. --- Changes in V3: - Remove unnecessary comment. --- xen/arch/arm/domain_build.c | 1 + xen/arch/ppc/include/asm/grant_table.h | 5 ----- xen/common/Kconfig | 1 + xen/include/xen/grant_table.h | 3 +++ 4 files changed, 5 insertions(+), 5 deletions(-) delete mode 100644 xen/arch/ppc/include/asm/grant_table.h diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index df66fb88d8..28df515a3d 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -36,6 +36,7 @@ =20 #include #include +#include #include =20 #define STATIC_EVTCHN_NODE_SIZE_CELLS 2 diff --git a/xen/arch/ppc/include/asm/grant_table.h b/xen/arch/ppc/include/= asm/grant_table.h deleted file mode 100644 index d0ff58dd3d..0000000000 --- a/xen/arch/ppc/include/asm/grant_table.h +++ /dev/null @@ -1,5 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#ifndef __ASM_PPC_GRANT_TABLE_H__ -#define __ASM_PPC_GRANT_TABLE_H__ - -#endif /* __ASM_PPC_GRANT_TABLE_H__ */ diff --git a/xen/common/Kconfig b/xen/common/Kconfig index 310ad4229c..13e26ca06f 100644 --- a/xen/common/Kconfig +++ b/xen/common/Kconfig @@ -15,6 +15,7 @@ config CORE_PARKING config GRANT_TABLE bool "Grant table support" if EXPERT default y + depends on ARM || X86 ---help--- Grant table provides a generic mechanism to memory sharing between domains. This shared memory interface underpins the diff --git a/xen/include/xen/grant_table.h b/xen/include/xen/grant_table.h index 85fe6b7b5e..50edfecfb6 100644 --- a/xen/include/xen/grant_table.h +++ b/xen/include/xen/grant_table.h @@ -26,7 +26,10 @@ #include #include #include + +#ifdef CONFIG_GRANT_TABLE #include +#endif =20 struct grant_table; =20 --=20 2.43.0 From nobody Mon May 13 19:34:01 2024 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=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1701463739; cv=none; d=zohomail.com; s=zohoarc; b=PXvjnN9D20b8RSsx9hW3Jub/9GFzd+OX48JnWNeH7xS28TWxP/gK7FHbXfSkEYE0ccVi4qKeuj1j6p4PxNsRzcT5e+zo68DZZMk3kcCtHqx+vFlfb2XamHqtg3BAjQGxS9DKmwUXBpXbCj8iMC882zBJbQdg4jn95DsSsp2g/uY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1701463739; 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=gkZXGmuGzsXLXktMQsuaQS4qtKJYPDwgQkxhzE80/l8=; b=JpNvaBdJ/4Nh5Ez/Obn1jMEiYHzMtqwqONZG58x489/ekRNvrbCmOP24/URGJeXUL15SxVyqjV9WQwyTshJpdsOc8SMillIGCWyURox/PZH9OBtvX9MH3wNUYea54IxghEsG+I77GUg7tLqFC7LqmuVfVe+NKUovgmFfayQedVw= 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 1701463739919223.8284406400834; Fri, 1 Dec 2023 12:48:59 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.645743.1008056 (Exim 4.92) (envelope-from ) id 1r9AR1-0000RU-Er; Fri, 01 Dec 2023 20:48:27 +0000 Received: by outflank-mailman (output) from mailman id 645743.1008056; Fri, 01 Dec 2023 20:48:27 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r9AR1-0000Qm-9H; Fri, 01 Dec 2023 20:48:27 +0000 Received: by outflank-mailman (input) for mailman id 645743; Fri, 01 Dec 2023 20:48:25 +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 1r9AQz-0008SX-Dg for xen-devel@lists.xenproject.org; Fri, 01 Dec 2023 20:48:25 +0000 Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [2a00:1450:4864:20::232]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id f82634ef-908a-11ee-9b0f-b553b5be7939; Fri, 01 Dec 2023 21:48:23 +0100 (CET) Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2c9d44b2919so19082571fa.0 for ; Fri, 01 Dec 2023 12:48:23 -0800 (PST) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id i18-20020a2ea372000000b002c6ed7e546esm511142ljn.124.2023.12.01.12.48.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 12:48:22 -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: f82634ef-908a-11ee-9b0f-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701463703; x=1702068503; 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=gkZXGmuGzsXLXktMQsuaQS4qtKJYPDwgQkxhzE80/l8=; b=mKFKbijvXUhyabQyNf+yjy0Wd/Xx8mkUj1vaeJUs52Y75Zn/GzkP6v1tBekGyXyNc3 imxXfFqH9umTySaw1N1n91lNtatUSKEVW/nXTGUJ7QHXK4sJHUxFF9f7CfG7hxZJ0eE+ UyGYLNKzfyVBZL3gw23kmd1gBWrCjcyiVfm2GClMbyITp8nV+k6R2wDy+szkH2RhYsM7 1DVvVQvq1UXgM0AAcIULMgKVUrCLTLU8ayfZxURCUGcEiFEen7r7ctekjmQHoj8hbGzb ReS0aNnFElzrIo+thYlviCKjB6PpsBma4Lf1OnGt7lvBDUgU1NW+bI0ZOiQ/jy/AwR0Z 2Bgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701463703; x=1702068503; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gkZXGmuGzsXLXktMQsuaQS4qtKJYPDwgQkxhzE80/l8=; b=st9+9QmnKVtj54Q6SCTW4asX66wijxsYY2AtOTZoV49b+UvEBkjnA3qcLkN8ecL0ss ZGjAlPoVprzpz+fy6tVODErdnGn6J7+VKzbIi58hOk/HBACswXAoMISHfnjjVsoHw3ky 2W9Ri1zzHKmPZdu1/771MqZL8K36Tq0t47E2CUbxvQ44yvLimhOuplOK6ZHh5UV61jsJ xA8zIswIKZhm9N+yAjLCZ1uj4KrbkXjDevQv5goo/olhz+9C7fsaXGm6gqM3Mmpn9abb rL/nfBbK0d4VsD0RX8qM1GLABEET3Dcu8/waKO6CzNb2lgsY3NPbeha5iYiKdk0FKK1q S8MA== X-Gm-Message-State: AOJu0YwDkBG604tfrK7vKJxcLWRZuWYBmHO0ustQKHfiscuQpmGOVqNf tIIINbPHAOjemtnOMM/QnLgJZWnjrWIAOw== X-Google-Smtp-Source: AGHT+IHSzvXp41ecTtLxNJopxQEGJM7JxaTiAcad3Y/MtaYOacGIrtstdEpEJMEV1PeJi5oVxmEdNg== X-Received: by 2002:a05:651c:2124:b0:2c9:cd5c:16a8 with SMTP id a36-20020a05651c212400b002c9cd5c16a8mr1450876ljq.24.1701463703143; Fri, 01 Dec 2023 12:48:23 -0800 (PST) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk , Andrew Cooper , George Dunlap , Jan Beulich , Wei Liu , Tamas K Lengyel , Alexandru Isaila , Petre Pircalabu , Shawn Anastasio Subject: [PATCH v5 6/7] xen/asm-generic: ifdef inclusion of Date: Fri, 1 Dec 2023 22:48:09 +0200 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1701463740835000001 Content-Type: text/plain; charset="utf-8" ifdefing inclusion of in allows to avoid generation of empty header for the case when !CONFIG_MEM_ACCESS. For Arm it was explicitly added inclusion of for p2m.c and traps.c because they require some functions from whi= ch aren't available in case of !CONFIG_MEM_ACCESS. Suggested-by: Jan Beulich Signed-off-by: Oleksii Kurochko --- Changes in V5: - Added dependencies for "Config MEM_ACCESS" to be sure that randconfig wi= ll not turn on the config. --- Changes in V4: - Nothing changed. Only rebase. --- Changes in V3: - Remove unnecessary comment. --- xen/arch/arm/p2m.c | 1 + xen/arch/arm/traps.c | 1 + xen/arch/ppc/include/asm/mem_access.h | 5 ----- xen/common/Kconfig | 2 +- xen/include/xen/mem_access.h | 2 ++ 5 files changed, 5 insertions(+), 6 deletions(-) delete mode 100644 xen/arch/ppc/include/asm/mem_access.h diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index b991b76ce4..2465c266e9 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include =20 diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c index 3784e8276e..37a457f4b1 100644 --- a/xen/arch/arm/traps.c +++ b/xen/arch/arm/traps.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include diff --git a/xen/arch/ppc/include/asm/mem_access.h b/xen/arch/ppc/include/a= sm/mem_access.h deleted file mode 100644 index e7986dfdbd..0000000000 --- a/xen/arch/ppc/include/asm/mem_access.h +++ /dev/null @@ -1,5 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#ifndef __ASM_PPC_MEM_ACCESS_H__ -#define __ASM_PPC_MEM_ACCESS_H__ - -#endif /* __ASM_PPC_MEM_ACCESS_H__ */ diff --git a/xen/common/Kconfig b/xen/common/Kconfig index 13e26ca06f..d84e395a0b 100644 --- a/xen/common/Kconfig +++ b/xen/common/Kconfig @@ -87,7 +87,7 @@ config MEM_ACCESS_ALWAYS_ON config MEM_ACCESS def_bool MEM_ACCESS_ALWAYS_ON prompt "Memory Access and VM events" if !MEM_ACCESS_ALWAYS_ON - depends on HVM + depends on HVM && (ARM || X86) ---help--- =20 Framework to configure memory access types for guests and receive diff --git a/xen/include/xen/mem_access.h b/xen/include/xen/mem_access.h index 4e4811680d..87d93b31f6 100644 --- a/xen/include/xen/mem_access.h +++ b/xen/include/xen/mem_access.h @@ -33,7 +33,9 @@ */ struct vm_event_st; =20 +#ifdef CONFIG_MEM_ACCESS #include +#endif =20 /* * Additional access types, which are used to further restrict --=20 2.43.0 From nobody Mon May 13 19:34:01 2024 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=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1701463731; cv=none; d=zohomail.com; s=zohoarc; b=BPBt739O9GS2KRWDZC2BGWZvqCpM/eH0q+oq8jSvg+hy+XOJ2dNC5ZWKMzt0cZFDaDtx6BAHcvHr5xGOA4bbjAzsXWQzIpUNAfcHzRBRJGDEp6CWxZclDw2kGsmRu9X6GTOxh7k9nBqP6vVwySmd1rUqiWV7jpPVgVSsKMwzisI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1701463731; 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=zbQv/IdBQa83UkIVCYiNgPLJy5E21/Mcx7SRRKDsQK0=; b=iPUjzr0I4lEAr+7I+nIhJ1nLAo6i9xTysL39ggk7bix6yJxr2LVtcxol73DuRTGpHAEjtMnYxPcLnViE1KCmzF6huUDEqGtBBZPaU92tbeVPy/LLtY13zGIsgF482rQubyWNmXl69pdRx1dsPc2C8QObjq4MrpoDQva+GaVUM+Q= 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 1701463731775821.9587789677536; Fri, 1 Dec 2023 12:48:51 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.645744.1008066 (Exim 4.92) (envelope-from ) id 1r9AR2-0000kY-NV; Fri, 01 Dec 2023 20:48:28 +0000 Received: by outflank-mailman (output) from mailman id 645744.1008066; Fri, 01 Dec 2023 20:48:28 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r9AR2-0000jb-IW; Fri, 01 Dec 2023 20:48:28 +0000 Received: by outflank-mailman (input) for mailman id 645744; Fri, 01 Dec 2023 20:48:26 +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 1r9AR0-0008SX-FI for xen-devel@lists.xenproject.org; Fri, 01 Dec 2023 20:48:26 +0000 Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [2a00:1450:4864:20::236]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id f8a93560-908a-11ee-9b0f-b553b5be7939; Fri, 01 Dec 2023 21:48:24 +0100 (CET) Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2c9b88cf626so35149281fa.3 for ; Fri, 01 Dec 2023 12:48:24 -0800 (PST) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id i18-20020a2ea372000000b002c6ed7e546esm511142ljn.124.2023.12.01.12.48.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 12:48:23 -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: f8a93560-908a-11ee-9b0f-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701463704; x=1702068504; 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=zbQv/IdBQa83UkIVCYiNgPLJy5E21/Mcx7SRRKDsQK0=; b=Rl8sOnnuzxw/XZGHlM9VdIq1+wqooP+LN4gVAmVXxp06+KhkpqG5O0B5hKfNNL0ZsC GHlzplm93VacGhSjeFwmBofMQMdx8It/Ohp9E3okcA5p47mn9ZsBh7ptywnIQY8zgLxi /+hq5X7k/XsbmaAnpD2bcnB6XQRrtXjGjAHNX4wC3pPCYqPa7/7+2+ilJfeU3E8tFqrN Hy7Fxn89CXkaT2PpbWc8A9BdNfbK8UjogmgwFwMPesR+dM48aF57FHumMdBBTYJlEtAf nTduUexPmkS3Ss3icjrEmaJsd7NqybgPbG7rx7bPfghX0D3HmdB0kMr1PwsFr1op4cSp nnXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701463704; x=1702068504; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zbQv/IdBQa83UkIVCYiNgPLJy5E21/Mcx7SRRKDsQK0=; b=Oxv/l5Ypf2OdHhioCHlbf96bJNLptjtij6ANgX0MGCGuwkydqtngQgzQ2Gvpd1AYW1 OmcCJHNF2tAL4wF7cFyDQrQ6x6RHleZguHTjOPS5gDgxI+t5AYViLdpf7MW7QEtrkIfM 9zLd+sFXn8Y0x9KSR+njKNulyuJdRVxkTGYDcTR0E0C9fDwqGnkJRVANN42P/zkk0SN4 SaM0qXcTqcxCcr+Ljnpf2MtZHaFVk/cCWgMFFibBP9/QodsZuTTtNnB6CtGkuLPv7y0N f8yagxtNi10R7nxNCR5KUy837S1pgiGcuyEPs8cB6FCxe/sQq/zywRPB9FCn7Zq2zqwI qEzg== X-Gm-Message-State: AOJu0YxLUUwjvD6xaBwoShESfeihlXdMCldCQVjaPF8kFEMGdKYAk1kN Oqd9IR0R2/P5JGqi3uoByBSUA0XS+kdxBA== X-Google-Smtp-Source: AGHT+IF03NQK4DYzakt4daF2vEkoDuVlRTeGblp5ZgHEAgmG1vtmcna/lUxnf1FeAaW0T00TDHcEaw== X-Received: by 2002:a2e:99d5:0:b0:2c9:e7d6:551c with SMTP id l21-20020a2e99d5000000b002c9e7d6551cmr484001ljj.84.1701463703975; Fri, 01 Dec 2023 12:48:23 -0800 (PST) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk , Andrew Cooper , George Dunlap , Jan Beulich , Wei Liu , Shawn Anastasio Subject: [PATCH v5 7/7] xen/asm-generic: introduce generic device.h Date: Fri, 1 Dec 2023 22:48:10 +0200 Message-ID: <13c839b2ae26ec8a677048c02da9fa1a9ce14d3c.1701453087.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1701463732834000003 Content-Type: text/plain; charset="utf-8" Arm, PPC and RISC-V use the same device.h thereby device.h was moved to asm-generic. Arm's device.h was taken as a base with the following changes: - #ifdef PCI related things. - #ifdef ACPI related things. - Rename #ifdef guards. - Add SPDX tag. - #ifdef CONFIG_HAS_DEVICE_TREE related things. - #ifdef-ing iommu related things with CONFIG_HAS_PASSTHROUGH. Also Arm and PPC are switched to asm-generic version of device.h Signed-off-by: Oleksii Kurochko --- Jan wrote the following: Overall I think there are too many changes done all in one go here. But it's mostly Arm which is affected, so I'll leave judging about t= hat to the Arm maintainers. =20 Arm maintainers will it be fine for you to not split the patch? --- Changes in V5: - Removed generated file: xen/include/headers++.chk.new - Removed pointless #ifdef CONFIG_HAS_DEVICE_TREE ... #endif for PPC as CONFIG_HAS_DEVICE_TREE will be always used for PPC. --- Changes in V4: - Updated the commit message - Switched Arm and PPC to asm-generic version of device.h - Replaced HAS_PCI with CONFIG_HAS_PCI - ifdef-ing iommu filed of dev_archdata struct with CONFIG_HAS_PASSTHROUGH - ifdef-ing iommu_fwspec of device struct with CONFIG_HAS_PASSTHROUGH - ifdef-ing DT related things with CONFIG_HAS_DEVICE_TREE - Updated the commit message ( remove a note with question about if device.h should be in asm-generic or not ) - Replaced DEVICE_IC with DEVICE_INTERRUPT_CONTROLLER - Rationalized usage of CONFIG_HAS_* in device.h - Fixed indents for ACPI_DEVICE_START and ACPI_DEVICE_END --- Changes in V3: - ifdef device tree related things. - update the commit message --- Changes in V2: - take ( as common ) device.h from Arm as PPC and RISC-V use it as a base. - #ifdef PCI related things. - #ifdef ACPI related things. - rename DEVICE_GIC to DEVIC_IC. - rename #ifdef guards. - switch Arm and PPC to generic device.h - add SPDX tag - update the commit message --- xen/arch/arm/device.c | 15 ++- xen/arch/arm/domain_build.c | 2 +- xen/arch/arm/gic-v2.c | 4 +- xen/arch/arm/gic-v3.c | 6 +- xen/arch/arm/gic.c | 4 +- xen/arch/arm/include/asm/Makefile | 1 + xen/arch/ppc/include/asm/Makefile | 1 + xen/arch/ppc/include/asm/device.h | 53 -------- .../asm =3D> include/asm-generic}/device.h | 125 +++++++++++------- 9 files changed, 102 insertions(+), 109 deletions(-) delete mode 100644 xen/arch/ppc/include/asm/device.h rename xen/{arch/arm/include/asm =3D> include/asm-generic}/device.h (79%) diff --git a/xen/arch/arm/device.c b/xen/arch/arm/device.c index 1f631d3274..affbe79f9a 100644 --- a/xen/arch/arm/device.c +++ b/xen/arch/arm/device.c @@ -16,7 +16,10 @@ #include =20 extern const struct device_desc _sdevice[], _edevice[]; + +#ifdef CONFIG_ACPI extern const struct acpi_device_desc _asdevice[], _aedevice[]; +#endif =20 int __init device_init(struct dt_device_node *dev, enum device_class class, const void *data) @@ -45,6 +48,7 @@ int __init device_init(struct dt_device_node *dev, enum d= evice_class class, return -EBADF; } =20 +#ifdef CONFIG_ACPI int __init acpi_device_init(enum device_class class, const void *data, int= class_type) { const struct acpi_device_desc *desc; @@ -61,6 +65,7 @@ int __init acpi_device_init(enum device_class class, cons= t void *data, int class =20 return -EBADF; } +#endif =20 enum device_class device_get_class(const struct dt_device_node *dev) { @@ -329,9 +334,13 @@ int handle_device(struct domain *d, struct dt_device_n= ode *dev, p2m_type_t p2mt, struct map_range_data mr_data =3D { .d =3D d, .p2mt =3D p2mt, - .skip_mapping =3D !own_device || - (is_pci_passthrough_enabled() && - (device_get_class(dev) =3D=3D DEVICE_PCI_HOSTBRIDG= E)), + .skip_mapping =3D + !own_device +#ifdef CONFIG_HAS_PCI + || (is_pci_passthrough_enabled() && + (device_get_class(dev) =3D=3D DEVICE_PCI_HOSTBRIDG= E)) +#endif + , .iomem_ranges =3D iomem_ranges, .irq_ranges =3D irq_ranges }; diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 28df515a3d..a0518993b1 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -1651,7 +1651,7 @@ static int __init handle_node(struct domain *d, struc= t kernel_info *kinfo, * Replace these nodes with our own. Note that the original may be * used_by DOMID_XEN so this check comes first. */ - if ( device_get_class(node) =3D=3D DEVICE_GIC ) + if ( device_get_class(node) =3D=3D DEVICE_INTERRUPT_CONTROLLER ) return make_gic_node(d, kinfo->fdt, node); if ( dt_match_node(timer_matches, node) ) return make_timer_node(kinfo); diff --git a/xen/arch/arm/gic-v2.c b/xen/arch/arm/gic-v2.c index cf392bfd1c..5d6885e389 100644 --- a/xen/arch/arm/gic-v2.c +++ b/xen/arch/arm/gic-v2.c @@ -1366,7 +1366,7 @@ static const struct dt_device_match gicv2_dt_match[] = __initconst =3D { /* sentinel */ }, }; =20 -DT_DEVICE_START(gicv2, "GICv2", DEVICE_GIC) +DT_DEVICE_START(gicv2, "GICv2", DEVICE_INTERRUPT_CONTROLLER) .dt_match =3D gicv2_dt_match, .init =3D gicv2_dt_preinit, DT_DEVICE_END @@ -1381,7 +1381,7 @@ static int __init gicv2_acpi_preinit(const void *data) return 0; } =20 -ACPI_DEVICE_START(agicv2, "GICv2", DEVICE_GIC) +ACPI_DEVICE_START(agicv2, "GICv2", DEVICE_INTERRUPT_CONTROLLER) .class_type =3D ACPI_MADT_GIC_VERSION_V2, .init =3D gicv2_acpi_preinit, ACPI_DEVICE_END diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c index 18289cd645..9e135aeb3d 100644 --- a/xen/arch/arm/gic-v3.c +++ b/xen/arch/arm/gic-v3.c @@ -1879,7 +1879,7 @@ static const struct dt_device_match gicv3_dt_match[] = __initconst =3D { /* sentinel */ }, }; =20 -DT_DEVICE_START(gicv3, "GICv3", DEVICE_GIC) +DT_DEVICE_START(gicv3, "GICv3", DEVICE_INTERRUPT_CONTROLLER) .dt_match =3D gicv3_dt_match, .init =3D gicv3_dt_preinit, DT_DEVICE_END @@ -1894,12 +1894,12 @@ static int __init gicv3_acpi_preinit(const void *da= ta) return 0; } =20 -ACPI_DEVICE_START(agicv3, "GICv3", DEVICE_GIC) +ACPI_DEVICE_START(agicv3, "GICv3", DEVICE_INTERRUPT_CONTROLLER) .class_type =3D ACPI_MADT_GIC_VERSION_V3, .init =3D gicv3_acpi_preinit, ACPI_DEVICE_END =20 -ACPI_DEVICE_START(agicv4, "GICv4", DEVICE_GIC) +ACPI_DEVICE_START(agicv4, "GICv4", DEVICE_INTERRUPT_CONTROLLER) .class_type =3D ACPI_MADT_GIC_VERSION_V4, .init =3D gicv3_acpi_preinit, ACPI_DEVICE_END diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c index d922ea67aa..b5a9c8266c 100644 --- a/xen/arch/arm/gic.c +++ b/xen/arch/arm/gic.c @@ -234,7 +234,7 @@ static void __init gic_dt_preinit(void) if ( !dt_get_parent(node) ) continue; =20 - rc =3D device_init(node, DEVICE_GIC, NULL); + rc =3D device_init(node, DEVICE_INTERRUPT_CONTROLLER, NULL); if ( !rc ) { /* NOTE: Only one GIC is supported */ @@ -262,7 +262,7 @@ static void __init gic_acpi_preinit(void) =20 dist =3D container_of(header, struct acpi_madt_generic_distributor, he= ader); =20 - if ( acpi_device_init(DEVICE_GIC, NULL, dist->version) ) + if ( acpi_device_init(DEVICE_INTERRUPT_CONTROLLER, NULL, dist->version= ) ) panic("Unable to find compatible GIC in the ACPI table\n"); } #else diff --git a/xen/arch/arm/include/asm/Makefile b/xen/arch/arm/include/asm/M= akefile index a28cc5d1b1..c3f4291ee2 100644 --- a/xen/arch/arm/include/asm/Makefile +++ b/xen/arch/arm/include/asm/Makefile @@ -1,5 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-only generic-y +=3D altp2m.h +generic-y +=3D device.h generic-y +=3D hardirq.h generic-y +=3D iocap.h generic-y +=3D numa.h diff --git a/xen/arch/ppc/include/asm/Makefile b/xen/arch/ppc/include/asm/M= akefile index efd72862c8..adb752b804 100644 --- a/xen/arch/ppc/include/asm/Makefile +++ b/xen/arch/ppc/include/asm/Makefile @@ -1,5 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-only generic-y +=3D altp2m.h +generic-y +=3D device.h generic-y +=3D div64.h generic-y +=3D hardirq.h generic-y +=3D hypercall.h diff --git a/xen/arch/ppc/include/asm/device.h b/xen/arch/ppc/include/asm/d= evice.h deleted file mode 100644 index 8253e61d51..0000000000 --- a/xen/arch/ppc/include/asm/device.h +++ /dev/null @@ -1,53 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#ifndef __ASM_PPC_DEVICE_H__ -#define __ASM_PPC_DEVICE_H__ - -enum device_type -{ - DEV_DT, - DEV_PCI, -}; - -struct device { - enum device_type type; -#ifdef CONFIG_HAS_DEVICE_TREE - struct dt_device_node *of_node; /* Used by drivers imported from Linux= */ -#endif -}; - -enum device_class -{ - DEVICE_SERIAL, - DEVICE_IOMMU, - DEVICE_PCI_HOSTBRIDGE, - /* Use for error */ - DEVICE_UNKNOWN, -}; - -struct device_desc { - /* Device name */ - const char *name; - /* Device class */ - enum device_class class; - /* List of devices supported by this driver */ - const struct dt_device_match *dt_match; - /* - * Device initialization. - * - * -EAGAIN is used to indicate that device probing is deferred. - */ - int (*init)(struct dt_device_node *dev, const void *data); -}; - -typedef struct device device_t; - -#define DT_DEVICE_START(name_, namestr_, class_) \ -static const struct device_desc __dev_desc_##name_ __used \ -__section(".dev.info") =3D { \ - .name =3D namestr_, \ - .class =3D class_, \ - -#define DT_DEVICE_END \ -}; - -#endif /* __ASM_PPC_DEVICE_H__ */ diff --git a/xen/arch/arm/include/asm/device.h b/xen/include/asm-generic/de= vice.h similarity index 79% rename from xen/arch/arm/include/asm/device.h rename to xen/include/asm-generic/device.h index b5d451e087..063c448c4e 100644 --- a/xen/arch/arm/include/asm/device.h +++ b/xen/include/asm-generic/device.h @@ -1,14 +1,37 @@ -#ifndef __ASM_ARM_DEVICE_H -#define __ASM_ARM_DEVICE_H +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ASM_GENERIC_DEVICE_H__ +#define __ASM_GENERIC_DEVICE_H__ + +#include =20 enum device_type { +#ifdef CONFIG_HAS_DEVICE_TREE DEV_DT, +#endif + +#ifdef CONFIG_HAS_PCI DEV_PCI, +#endif + DEV_TYPE_MAX, +}; + +enum device_class +{ + DEVICE_SERIAL, + DEVICE_IOMMU, + DEVICE_INTERRUPT_CONTROLLER, +#ifdef CONFIG_HAS_PCI + DEVICE_PCI_HOSTBRIDGE, +#endif + /* Use for error */ + DEVICE_UNKNOWN, }; =20 struct dev_archdata { +#ifdef CONFIG_HAS_PASSTHROUGH void *iommu; /* IOMMU private data */ +#endif }; =20 /* struct device - The basic device structure */ @@ -19,31 +42,65 @@ struct device struct dt_device_node *of_node; /* Used by drivers imported from Linux= */ #endif struct dev_archdata archdata; +#ifdef CONFIG_HAS_PASSTHROUGH struct iommu_fwspec *iommu_fwspec; /* per-device IOMMU instance data */ +#endif }; =20 typedef struct device device_t; =20 +#ifdef CONFIG_HAS_DEVICE_TREE + #include =20 -#define dev_is_pci(dev) ((dev)->type =3D=3D DEV_PCI) #define dev_is_dt(dev) ((dev)->type =3D=3D DEV_DT) =20 -enum device_class -{ - DEVICE_SERIAL, - DEVICE_IOMMU, - DEVICE_GIC, - DEVICE_PCI_HOSTBRIDGE, - /* Use for error */ - DEVICE_UNKNOWN, +/** + * device_init - Initialize a device + * @dev: device to initialize + * @class: class of the device (serial, network...) + * @data: specific data for initializing the device + * + * Return 0 on success. + */ +int device_init(struct dt_device_node *dev, enum device_class class, + const void *data); + +/** + * device_get_type - Get the type of the device + * @dev: device to match + * + * Return the device type on success or DEVICE_ANY on failure + */ +enum device_class device_get_class(const struct dt_device_node *dev); + +#define DT_DEVICE_START(_name, _namestr, _class) \ +static const struct device_desc __dev_desc_##_name __used \ +__section(".dev.info") =3D { \ + .name =3D _namestr, \ + .class =3D _class, \ + +#define DT_DEVICE_END \ }; =20 +#else /* !CONFIG_HAS_DEVICE_TREE */ +#define dev_is_dt(dev) ((void)(dev), false) +#endif /* CONFIG_HAS_DEVICE_TREE */ + +#ifdef CONFIG_HAS_PCI +#define dev_is_pci(dev) ((dev)->type =3D=3D DEV_PCI) +#else +#define dev_is_pci(dev) ((void)(dev), false) +#endif + struct device_desc { /* Device name */ const char *name; /* Device class */ enum device_class class; + +#ifdef CONFIG_HAS_DEVICE_TREE + /* List of devices supported by this driver */ const struct dt_device_match *dt_match; /* @@ -52,8 +109,12 @@ struct device_desc { * -EAGAIN is used to indicate that device probing is deferred. */ int (*init)(struct dt_device_node *dev, const void *data); + +#endif }; =20 +#ifdef CONFIG_ACPI + struct acpi_device_desc { /* Device name */ const char *name; @@ -75,44 +136,18 @@ struct acpi_device_desc { int acpi_device_init(enum device_class class, const void *data, int class_type); =20 -/** - * device_init - Initialize a device - * @dev: device to initialize - * @class: class of the device (serial, network...) - * @data: specific data for initializing the device - * - * Return 0 on success. - */ -int device_init(struct dt_device_node *dev, enum device_class class, - const void *data); - -/** - * device_get_type - Get the type of the device - * @dev: device to match - * - * Return the device type on success or DEVICE_ANY on failure - */ -enum device_class device_get_class(const struct dt_device_node *dev); +#define ACPI_DEVICE_START(_name, _namestr, _class) \ +static const struct acpi_device_desc __dev_desc_##_name __used \ +__section(".adev.info") =3D { \ + .name =3D _namestr, \ + .class =3D _class, \ =20 -#define DT_DEVICE_START(_name, _namestr, _class) \ -static const struct device_desc __dev_desc_##_name __used \ -__section(".dev.info") =3D { \ - .name =3D _namestr, \ - .class =3D _class, \ - -#define DT_DEVICE_END \ +#define ACPI_DEVICE_END \ }; =20 -#define ACPI_DEVICE_START(_name, _namestr, _class) \ -static const struct acpi_device_desc __dev_desc_##_name __used \ -__section(".adev.info") =3D { \ - .name =3D _namestr, \ - .class =3D _class, \ - -#define ACPI_DEVICE_END \ -}; +#endif /* CONFIG_ACPI */ =20 -#endif /* __ASM_ARM_DEVICE_H */ +#endif /* __ASM_GENERIC_DEVICE_H__ */ =20 /* * Local variables: --=20 2.43.0