From patchwork Fri Nov 17 12:24:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksii Kurochko X-Patchwork-Id: 13458912 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D454AC5AE4B for ; Fri, 17 Nov 2023 12:25:08 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.635111.990875 (Exim 4.92) (envelope-from ) id 1r3xty-00014h-GH; Fri, 17 Nov 2023 12:24:50 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 635111.990875; Fri, 17 Nov 2023 12:24:50 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r3xty-00014Z-DF; Fri, 17 Nov 2023 12:24:50 +0000 Received: by outflank-mailman (input) for mailman id 635111; Fri, 17 Nov 2023 12:24:49 +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 1r3xtx-0000iK-1d for xen-devel@lists.xenproject.org; Fri, 17 Nov 2023 12:24:49 +0000 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [2a00:1450:4864:20::136]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 4ad88f3f-8544-11ee-9b0e-b553b5be7939; Fri, 17 Nov 2023 13:24:45 +0100 (CET) Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-507975d34e8so2722782e87.1 for ; Fri, 17 Nov 2023 04:24:45 -0800 (PST) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id a18-20020ac25e72000000b005094d95e8bcsm209811lfr.218.2023.11.17.04.24.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 04:24:43 -0800 (PST) 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: 4ad88f3f-8544-11ee-9b0e-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700223884; x=1700828684; 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=LHOrg4p/PNWg+936iRt5+lse+XOyF9c01hq1h4Eo2Gw=; b=b8e1ldL7WVWwZ3RYIvenymdVb7P44vgcYA+fyk7QhD8EOdfffFf2mmK7wD826vmO9B C9SX1rSN3gnyA4Q4jEoHOsxofSjHYb20jfcov0rTU5f68/cc19Xoo6jTRl6hxcxTt5Wd 70xpja6pE5Btv/AMoixt4Z17g8pdvjgicrpLK/fCT/k5cNGZcEUqnyJP4+ASOvYZ63HQ fqTOfG5rnj/nvvF9LnwT6IombleTaKNszEqLAcL8B3/0PYYz9WNQ7U4zi+NvapludCN1 FIIhZfY+AP+kxTThozf36tfxCh5mMuYObpM1kBrScJrbaft0oL0QBBp0RwQTNuJ5VKOw jT+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700223884; x=1700828684; 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=LHOrg4p/PNWg+936iRt5+lse+XOyF9c01hq1h4Eo2Gw=; b=MFp+Tb8rj2QFBGNdZpRtROujcUUTw7487lXt9zGOn7MrEF8gd4y7Akb+zoF0P4WiEh jilOlsb5O0PbSg/0hwwEKpeX66/DtvDxfvR0+FKpzYoCMHrbWDksHUb0XckgSgfAFMRi qSWiNnqpOVbIe7WZe/a2aF+uQqPVKiPIYrGxzMozpIyjR47/30Q9pBehb5EDcO+wmYLV ytJ3ZyuOSavhzyx1XVSzdodH7lHLTlRO9KoMgznAMSGRG74GPFznuIThwXiik0c1LQxi Sh7PZolGi8VJeNXJ0s8Bu4n00A2L+mAwAQsBmPcBAeGicrs7Pu7I0rYJgc/DeHkuETzL H1DA== X-Gm-Message-State: AOJu0Yy8cDMhHyy5w2wI3+xjD/L1/cnsyq08zJpflIlZ8GtkTJIMO6Lc OskJVqN9YbeqF0VSa3o/z81JuUJfk/0= X-Google-Smtp-Source: AGHT+IE7zHSkYQJAgwcPbwF3gopucwtESZyeJ5XW/zsr6SbKhhZ8ZIoLAW6dX67JHlCVNyZy09kfxw== X-Received: by 2002:ac2:5451:0:b0:509:7915:a1d6 with SMTP id d17-20020ac25451000000b005097915a1d6mr12893884lfn.58.1700223884060; Fri, 17 Nov 2023 04:24:44 -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 v3 01/14] xen/asm-generic: introduce stub header paging.h Date: Fri, 17 Nov 2023 14:24:25 +0200 Message-ID: <01807c303ef000d6316f71bc4bad93d1b6c03830.1700221559.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 The patch introduces generic paging.h header for Arm, PPC and RISC-V. All mentioned above architectures use hardware virt extensions and hardware pagetable extensions thereby it makes sense to set paging_mode_translate and paging_mode_external by default. Also in this patch Arm and PPC architectures are switched to generic paging.h header. Signed-off-by: Oleksii Kurochko Reviewed-by: Jan Beulich Acked-by: Julien Grall --- Changes in V3: - Sort xen/arch/{arm,ppc}/include/asm/Makefile alphabetically. - Add Reviewed-by: Jan Beulich --- Changes in V2: - evaluate argument of macros - covert macros to true - use proper tabs - switch Arm & PPC to generic paging.h - update commit message --- xen/arch/arm/include/asm/Makefile | 1 + xen/arch/arm/include/asm/paging.h | 16 ---------------- xen/arch/ppc/include/asm/Makefile | 1 + xen/arch/ppc/include/asm/paging.h | 7 ------- xen/include/asm-generic/paging.h | 19 +++++++++++++++++++ 5 files changed, 21 insertions(+), 23 deletions(-) delete mode 100644 xen/arch/arm/include/asm/paging.h delete mode 100644 xen/arch/ppc/include/asm/paging.h create mode 100644 xen/include/asm-generic/paging.h diff --git a/xen/arch/arm/include/asm/Makefile b/xen/arch/arm/include/asm/Makefile index 821addb0bf..ece7fa66dd 100644 --- a/xen/arch/arm/include/asm/Makefile +++ b/xen/arch/arm/include/asm/Makefile @@ -1,2 +1,3 @@ # SPDX-License-Identifier: GPL-2.0-only +generic-y += paging.h generic-y += vm_event.h diff --git a/xen/arch/arm/include/asm/paging.h b/xen/arch/arm/include/asm/paging.h deleted file mode 100644 index 6d1a000246..0000000000 --- a/xen/arch/arm/include/asm/paging.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef _XEN_PAGING_H -#define _XEN_PAGING_H - -#define paging_mode_translate(d) (1) -#define paging_mode_external(d) (1) - -#endif /* XEN_PAGING_H */ - -/* - * Local variables: - * mode: C - * c-file-style: "BSD" - * c-basic-offset: 4 - * indent-tabs-mode: nil - * End: - */ diff --git a/xen/arch/ppc/include/asm/Makefile b/xen/arch/ppc/include/asm/Makefile index 821addb0bf..ece7fa66dd 100644 --- a/xen/arch/ppc/include/asm/Makefile +++ b/xen/arch/ppc/include/asm/Makefile @@ -1,2 +1,3 @@ # SPDX-License-Identifier: GPL-2.0-only +generic-y += paging.h generic-y += vm_event.h diff --git a/xen/arch/ppc/include/asm/paging.h b/xen/arch/ppc/include/asm/paging.h deleted file mode 100644 index eccacece29..0000000000 --- a/xen/arch/ppc/include/asm/paging.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef __ASM_PPC_PAGING_H__ -#define __ASM_PPC_PAGING_H__ - -#define paging_mode_translate(d) (1) -#define paging_mode_external(d) (1) - -#endif /* __ASM_PPC_PAGING_H__ */ diff --git a/xen/include/asm-generic/paging.h b/xen/include/asm-generic/paging.h new file mode 100644 index 0000000000..8df534cfdc --- /dev/null +++ b/xen/include/asm-generic/paging.h @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ASM_GENERIC_PAGING_H__ +#define __ASM_GENERIC_PAGING_H__ + +#include + +#define paging_mode_translate(d) ((void)(d), true) +#define paging_mode_external(d) ((void)(d), true) + +#endif /* __ASM_GENERIC_PAGING_H__ */ + +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ From patchwork Fri Nov 17 12:24:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksii Kurochko X-Patchwork-Id: 13458909 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B019DC5AD4C for ; Fri, 17 Nov 2023 12:25:03 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.635110.990864 (Exim 4.92) (envelope-from ) id 1r3xtx-0000pC-8h; Fri, 17 Nov 2023 12:24:49 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 635110.990864; Fri, 17 Nov 2023 12:24:49 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r3xtx-0000p4-5a; Fri, 17 Nov 2023 12:24:49 +0000 Received: by outflank-mailman (input) for mailman id 635110; Fri, 17 Nov 2023 12:24:47 +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 1r3xtv-0000ZQ-Po for xen-devel@lists.xenproject.org; Fri, 17 Nov 2023 12:24:47 +0000 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [2a00:1450:4864:20::12d]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 4bcdeb31-8544-11ee-98dc-6d05b1d4d9a1; Fri, 17 Nov 2023 13:24:47 +0100 (CET) Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-507a98517f3so2564999e87.0 for ; Fri, 17 Nov 2023 04:24:47 -0800 (PST) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id a18-20020ac25e72000000b005094d95e8bcsm209811lfr.218.2023.11.17.04.24.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 04:24:45 -0800 (PST) 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: 4bcdeb31-8544-11ee-98dc-6d05b1d4d9a1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700223886; x=1700828686; 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=LN0bvvve1DpmJsPjq9NE3VGNIjDtWaZGExInp1NauPs=; b=OwOSKF5WzR7S7Z9jNItdJBGNhXsKdaXgc2R03lX6LGWY6m5hgwRKVY6WlSUmaGm/tf UKl4JR94+bnf7jDkyJdYks5GAPLN07STUksOArZaosCToH6ztGcvpr7zgWuO2Gn9c4aI +WxNWxAVMNTvOZrC7TD8bPaZQKDT8CELQjQCy7zWXW/n2qtbZYHj+vJ+CDtmCYRE8mps h868O0iKrRWaYODhcKZV0Mj8lGEZR6ZWy58UHKGSSMw4UhoUfZ3/IiBGSib0qBS5zveI k5dEGjKovlDHphToLDVPEvUUaHgvOuJuOB/rGtyIGTwAyQvBBvQOPBo4ukO0ja41Hz7R 5aFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700223886; x=1700828686; 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=LN0bvvve1DpmJsPjq9NE3VGNIjDtWaZGExInp1NauPs=; b=D812Lykr+Kg7lckeoXjX9tZHyAeq7U4HlTd8xdg8bVAck8K8eikDrQG4i9NHtc++n7 Mn7vvgRiJIrXrQiKX53Eknk6iS/VU45AxsQp6zTuS+V3OCA9dwGoWnnf8nBNx1C3wvkw v9aydRRt7w323OFG8mIXjb326WOe/glh7A9e5OAtMVda/h773VnPiNthDT7qrXaM5Ubc 5VlOO9PWBj9CrZIjF8xP6r/2xxJUTX2Nn4WsZUa3DIzQHGtlr9DmT6ZX65rkOecu70fY wB9VsBB0Y0UV0fdkQyPtE0PqdvGzVGIHuC+3nQDbFDVeYaCcEd7+kB7xgT/AMmdU3YL9 AHjg== X-Gm-Message-State: AOJu0YzBpQf7hf5WnC0Vwj1qB7uvlRM/GG030Wg5QM+SKkYBX6S4TMzb jAC42e3l8/nYE4ugpnc753b5XwYpKDM= X-Google-Smtp-Source: AGHT+IF67ZRX0UqMzyh8WW4r/CzmO2Dr45fBHwMVN3SCPNp/QKbIvpatSLW5SPiO9V+dnUXjM/DIoA== X-Received: by 2002:a19:e047:0:b0:50a:5df2:f322 with SMTP id g7-20020a19e047000000b0050a5df2f322mr12757530lfj.13.1700223885914; Fri, 17 Nov 2023 04:24:45 -0800 (PST) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu Subject: [PATCH v3 02/14] xen/asm-generic: introduce generic device.h Date: Fri, 17 Nov 2023 14:24:26 +0200 Message-ID: <65b267137539704df7f22b37e3b0a9b372a82b33.1700221559.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 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. Signed-off-by: Oleksii Kurochko --- It is still open question if device.h should be in asm-generic. Need more opinions. --- 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/include/asm-generic/device.h | 147 +++++++++++++++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100644 xen/include/asm-generic/device.h diff --git a/xen/include/asm-generic/device.h b/xen/include/asm-generic/device.h new file mode 100644 index 0000000000..7ef5aa955a --- /dev/null +++ b/xen/include/asm-generic/device.h @@ -0,0 +1,147 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ASM_GENERIC_DEVICE_H__ +#define __ASM_GENERIC_DEVICE_H__ + +enum device_type +{ +#ifdef CONFIG_HAS_DEVICE_TREE + DEV_DT, +#endif + +#ifdef HAS_PCI + DEV_PCI, +#endif +}; + +struct dev_archdata { + void *iommu; /* IOMMU private data */ +}; + +/* struct device - The basic device structure */ +struct device +{ + enum device_type type; +#ifdef CONFIG_HAS_DEVICE_TREE + struct dt_device_node *of_node; /* Used by drivers imported from Linux */ +#endif + struct dev_archdata archdata; + struct iommu_fwspec *iommu_fwspec; /* per-device IOMMU instance data */ +}; + +typedef struct device device_t; + +#ifdef CONFIG_HAS_DEVICE_TREE +#include +#endif + +#ifdef HAS_PCI +#define dev_is_pci(dev) ((dev)->type == DEV_PCI) +#endif + +#ifdef CONFIG_HAS_DEVICE_TREE +#define dev_is_dt(dev) ((dev)->type == DEV_DT) +#endif + +enum device_class +{ + DEVICE_SERIAL, + DEVICE_IOMMU, + DEVICE_IC, +#ifdef HAS_PCI + DEVICE_PCI_HOSTBRIDGE, +#endif + /* 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); +}; + +#ifdef CONFIG_ACPI + +struct acpi_device_desc { + /* Device name */ + const char *name; + /* Device class */ + enum device_class class; + /* type of device supported by the driver */ + const int class_type; + /* Device initialization */ + int (*init)(const void *data); +}; + +/** + * acpi_device_init - Initialize a device + * @class: class of the device (serial, network...) + * @data: specific data for initializing the device + * + * Return 0 on success. + */ +int acpi_device_init(enum device_class class, + const void *data, int class_type); + +#endif /* CONFIG_ACPI */ + +/** + * 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") = { \ + .name = _namestr, \ + .class = _class, \ + +#define DT_DEVICE_END \ +}; + +#ifdef CONFIG_ACPI + +#define ACPI_DEVICE_START(_name, _namestr, _class) \ +static const struct acpi_device_desc __dev_desc_##_name __used \ +__section(".adev.info") = { \ + .name = _namestr, \ + .class = _class, \ + +#define ACPI_DEVICE_END \ +}; + +#endif /* CONFIG_ACPI */ + +#endif /* __ASM_GENERIC_DEVICE_H__ */ + +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ From patchwork Fri Nov 17 12:24:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksii Kurochko X-Patchwork-Id: 13458907 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 71F3DC072A2 for ; Fri, 17 Nov 2023 12:25:02 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.635112.990885 (Exim 4.92) (envelope-from ) id 1r3xtz-0001KH-QF; Fri, 17 Nov 2023 12:24:51 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 635112.990885; Fri, 17 Nov 2023 12:24:51 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r3xtz-0001KA-M9; Fri, 17 Nov 2023 12:24:51 +0000 Received: by outflank-mailman (input) for mailman id 635112; Fri, 17 Nov 2023 12:24:50 +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 1r3xtx-0000iK-V2 for xen-devel@lists.xenproject.org; Fri, 17 Nov 2023 12:24:49 +0000 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [2a00:1450:4864:20::131]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 4c8a8535-8544-11ee-9b0e-b553b5be7939; Fri, 17 Nov 2023 13:24:48 +0100 (CET) Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-50aa2abfcfcso185150e87.3 for ; Fri, 17 Nov 2023 04:24:48 -0800 (PST) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id a18-20020ac25e72000000b005094d95e8bcsm209811lfr.218.2023.11.17.04.24.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 04:24:46 -0800 (PST) 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: 4c8a8535-8544-11ee-9b0e-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700223887; x=1700828687; 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=Q4Bl151fhJ0xUdwwLt/MNmOxcrc+o6rAwxdJ/C4d3oY=; b=lU0P3zPKzjzYN3PTklf4aqCrinnYngk2gQg86zBfGlluQsW5j4/hx3W0QIOi1Iz3Il 6em5nfFjeL1ZfR3OYBViwxmLZVlwpFyikOtlCb8vcPcZpevyQV/pXeWh9+7z+cq6zbud 2MN4224qCkGfDOd8OC61uUJUvL2dImRo6/mgM05YF/fD7GcCSsjIsvj0DAyCsH4NmDor VsvELFkAQrFmLYabkMdog8uMxFOne3WC6qAwtp6mDiVkv9dL5dhMtCLUl6y+98ccCX0z K0HptO1xvAj0OhWGGsoqiXOkcX6gbO6VWNouBpEuO5zSSfk7L+eoPuMUhuFnH0yMM/X5 u9PA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700223887; x=1700828687; 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=Q4Bl151fhJ0xUdwwLt/MNmOxcrc+o6rAwxdJ/C4d3oY=; b=RQ0ASPgXG4j+dmmbY0LTmFVYvCwnlDPulDwvBAYmJ273mmgdW8utOjWYbKO0ZbNlo1 aTlarCkInJKGF1px3YazQCC2gSg9P8zeUU4oua2qAXGpNak5wW5JVNNrieEt+9vjem8k 2KjWa/xsw71t1R3MLE+5kalpL6e7gUPbsZP47CjWClwaUMFQeBaZagBSln+WJXTCeDG8 cmi1+iQX3LV4ti2+uDcry7T3xu5w6jjwDXqhQUpe10r1RsXqWvvU4GCtbHAUc90f3y9E jfXmt15fMTJ1VhDOz3fVHvoA/d6OM0Jybm4fAxOrr60DeW9vR5O7r38JCW4a2GQVsfbX sHSA== X-Gm-Message-State: AOJu0Yy6eNLA5hgbhsgOhVC4MwdRe3SQ6am8vsXrWHPNYJazy3UYwKLO fwEfwiBy/+KbZnFaTckqWWGC3mqMH2Y= X-Google-Smtp-Source: AGHT+IEQGmAq7M3igpPBDgybVnhLTD9HucQkntc4cm/zOElOFuPdMvw5wfPD0tMgbHWZ7aCU8r1STg== X-Received: by 2002:a05:6512:941:b0:500:a378:db71 with SMTP id u1-20020a056512094100b00500a378db71mr12212137lft.57.1700223887288; Fri, 17 Nov 2023 04:24:47 -0800 (PST) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , Shawn Anastasio , Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu Subject: [PATCH v3 03/14] xen/asm-generic: introduce generic hypercall.h Date: Fri, 17 Nov 2023 14:24:27 +0200 Message-ID: <47f9117b19cbb616a36f4149a7aeaaffdbfa48a9.1700221559.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 Introduce an empty generic hypercall.h for archs which don't implement it. Drop PPC's hypercall.h and switch to generic one instead. Signed-off-by: Oleksii Kurochko Acked-by: Jan Beulich --- Changes in V3: - Drop PPC's hypercall.h and switch to generic one. - Update the commit message - Add Acked-by: Jan Beulich --- Changes in V2: - add check that isn't included directly. --- xen/arch/ppc/include/asm/Makefile | 1 + xen/arch/ppc/include/asm/hypercall.h | 5 ----- xen/include/asm-generic/hypercall.h | 18 ++++++++++++++++++ 3 files changed, 19 insertions(+), 5 deletions(-) delete mode 100644 xen/arch/ppc/include/asm/hypercall.h create mode 100644 xen/include/asm-generic/hypercall.h diff --git a/xen/arch/ppc/include/asm/Makefile b/xen/arch/ppc/include/asm/Makefile index ece7fa66dd..48d587f35d 100644 --- a/xen/arch/ppc/include/asm/Makefile +++ b/xen/arch/ppc/include/asm/Makefile @@ -1,3 +1,4 @@ # SPDX-License-Identifier: GPL-2.0-only +generic-y += hypercall.h generic-y += paging.h generic-y += vm_event.h diff --git a/xen/arch/ppc/include/asm/hypercall.h b/xen/arch/ppc/include/asm/hypercall.h deleted file mode 100644 index 1e8ca0ce9c..0000000000 --- a/xen/arch/ppc/include/asm/hypercall.h +++ /dev/null @@ -1,5 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#ifndef __ASM_PPC_HYPERCALL_H__ -#define __ASM_PPC_HYPERCALL_H__ - -#endif /* __ASM_PPC_HYPERCALL_H__ */ diff --git a/xen/include/asm-generic/hypercall.h b/xen/include/asm-generic/hypercall.h new file mode 100644 index 0000000000..7743b35c0d --- /dev/null +++ b/xen/include/asm-generic/hypercall.h @@ -0,0 +1,18 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __XEN_HYPERCALL_H__ +#error "asm/hypercall.h should not be included directly - include xen/hypercall.h instead" +#endif + +#ifndef __ASM_GENERIC_HYPERCALL_H__ +#define __ASM_GENERIC_HYPERCALL_H__ + +#endif /* __ASM_GENERIC_HYPERCALL_H__ */ + +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ From patchwork Fri Nov 17 12:24:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksii Kurochko X-Patchwork-Id: 13458911 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0CDA9C197A0 for ; Fri, 17 Nov 2023 12:25:08 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.635113.990891 (Exim 4.92) (envelope-from ) id 1r3xu0-0001Nx-4M; Fri, 17 Nov 2023 12:24:52 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 635113.990891; Fri, 17 Nov 2023 12:24:52 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r3xtz-0001Ni-Ut; Fri, 17 Nov 2023 12:24:51 +0000 Received: by outflank-mailman (input) for mailman id 635113; Fri, 17 Nov 2023 12:24:50 +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 1r3xty-0000ZQ-7U for xen-devel@lists.xenproject.org; Fri, 17 Nov 2023 12:24:50 +0000 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [2a00:1450:4864:20::12a]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 4d580a64-8544-11ee-98dc-6d05b1d4d9a1; Fri, 17 Nov 2023 13:24:49 +0100 (CET) Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-507cee17b00so2493206e87.2 for ; Fri, 17 Nov 2023 04:24:49 -0800 (PST) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id a18-20020ac25e72000000b005094d95e8bcsm209811lfr.218.2023.11.17.04.24.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 04:24:47 -0800 (PST) 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: 4d580a64-8544-11ee-98dc-6d05b1d4d9a1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700223888; x=1700828688; 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=6/X1l3KpVhIOhwMjT/JSPLzc+aIMz5zfKRbPaWipyYU=; b=SKVBfb9yRcYoAQ8W7SoziZ2RIvzPHeMhpok2vU/TEhZrfs0IITg7cKrBaFs8pJ6X10 VGDg7GfMsojyjimgcKUXFLV7nrGklDi7xVZt0IKYPSpjrkYe1pG/SHvaAALnlV81gSwc rD3UDRPjv80hHFWmZnQrtYUAl0X9b/w/dCaPAQdZM8QSyinpCwaPlWmv6blShfIBz+dB VkH+zSWQne9xcjq+9h/qDAafY4IiTGoVZykdZpXW7t7Z582s9fOhj74/vfRPJXAoqt+L p9eT+cg9uBlKPd1MDB9SymSZZEdSxkz5Uk2r1vCB2Ox7mAAttb49wcqCrH9cEoycGqLv EOOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700223888; x=1700828688; 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=6/X1l3KpVhIOhwMjT/JSPLzc+aIMz5zfKRbPaWipyYU=; b=n36UYDyBJp5JxnHvopc2byfSBOfu1iInmrDuUujVU+8hxr+1SYjHGJcDzluHAPAywM W/Dr2/ENMcuRkSLW/QVDk3TOmQed2yuOG4QaVsPw06B7g2UsjnJNSKF59fOJuapHm91X bmmqwedOimGVo/eHRmmtXupMaJo6Ejk27+TekE3Apd8U8Z29HsTLVSbxRBDTjPUMVOna 03qH9epuec305a2skb0K/wxJ/RbJOQa9YjceCtlloP3MyPL4tjVKPBkvg91bT6IBhVVH rQhqdR+7kb1v09GTBnq66uLBsw4Bp7Z+TbMtaWGbGqlmjLpvBLggjVcXWTefx942lu5R BXEQ== X-Gm-Message-State: AOJu0YxZsFUl+9apITgm76+47GX6ja4bnGJcPuNBixwJzUeh+KzhyiMr WHsRLopJvPzyoeYRbOOoaw9COeGZtDc= X-Google-Smtp-Source: AGHT+IEvnQCsFxKR1j7FSQT4FtnCuUD4m0o0xNiIC5Z2eweZoQod90dYu/BHi5QZdk43WRXX4IQtoA== X-Received: by 2002:a05:6512:2303:b0:50a:2710:d207 with SMTP id o3-20020a056512230300b0050a2710d207mr17756432lfu.53.1700223888535; Fri, 17 Nov 2023 04:24:48 -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 v3 04/14] xen/asm-generic: introduce generic header iocap.h Date: Fri, 17 Nov 2023 14:24:28 +0200 Message-ID: <3f6a80241a2c98477eaca5fa3bf80ff6c0df3f39.1700221559.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 iocap.h is common for Arm, PPC and RISC-V architectures thereby it was moved to asm-generic. Also Arm and PPC were switched to asm-generic version of iocap.h. Signed-off-by: Oleksii Kurochko Reviewed-by: Jan Beulich Acked-by: Julien Grall --- Changes in V3: - Drop Arm and PPC's iocap.h and switch to asm-generic's version. - 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/iocap.h | 8 -------- xen/{arch/arm/include/asm => include/asm-generic}/iocap.h | 7 ++++--- 4 files changed, 6 insertions(+), 11 deletions(-) delete mode 100644 xen/arch/ppc/include/asm/iocap.h rename xen/{arch/arm/include/asm => include/asm-generic}/iocap.h (60%) diff --git a/xen/arch/arm/include/asm/Makefile b/xen/arch/arm/include/asm/Makefile index ece7fa66dd..96e3aa6b6c 100644 --- a/xen/arch/arm/include/asm/Makefile +++ b/xen/arch/arm/include/asm/Makefile @@ -1,3 +1,4 @@ # SPDX-License-Identifier: GPL-2.0-only +generic-y += iocap.h generic-y += paging.h generic-y += vm_event.h diff --git a/xen/arch/ppc/include/asm/Makefile b/xen/arch/ppc/include/asm/Makefile index 48d587f35d..9f5a0dfb31 100644 --- a/xen/arch/ppc/include/asm/Makefile +++ b/xen/arch/ppc/include/asm/Makefile @@ -1,4 +1,5 @@ # SPDX-License-Identifier: GPL-2.0-only generic-y += hypercall.h +generic-y += iocap.h generic-y += paging.h generic-y += vm_event.h diff --git a/xen/arch/ppc/include/asm/iocap.h b/xen/arch/ppc/include/asm/iocap.h deleted file mode 100644 index 76bf13a70f..0000000000 --- a/xen/arch/ppc/include/asm/iocap.h +++ /dev/null @@ -1,8 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#ifndef __ASM_PPC_IOCAP_H__ -#define __ASM_PPC_IOCAP_H__ - -#define cache_flush_permitted(d) \ - (!rangeset_is_empty((d)->iomem_caps)) - -#endif /* __ASM_PPC_IOCAP_H__ */ diff --git a/xen/arch/arm/include/asm/iocap.h b/xen/include/asm-generic/iocap.h similarity index 60% rename from xen/arch/arm/include/asm/iocap.h rename to xen/include/asm-generic/iocap.h index 276fefbc59..dd7cb45488 100644 --- a/xen/arch/arm/include/asm/iocap.h +++ b/xen/include/asm-generic/iocap.h @@ -1,10 +1,11 @@ -#ifndef __X86_IOCAP_H__ -#define __X86_IOCAP_H__ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ASM_GENERIC_IOCAP_H__ +#define __ASM_GENERIC_IOCAP_H__ #define cache_flush_permitted(d) \ (!rangeset_is_empty((d)->iomem_caps)) -#endif +#endif /* __ASM_GENERIC_IOCAP_H__ */ /* * Local variables: From patchwork Fri Nov 17 12:24:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksii Kurochko X-Patchwork-Id: 13458908 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9EEB4C47071 for ; Fri, 17 Nov 2023 12:25:03 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.635114.990905 (Exim 4.92) (envelope-from ) id 1r3xu1-0001pp-Hw; Fri, 17 Nov 2023 12:24:53 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 635114.990905; Fri, 17 Nov 2023 12:24:53 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r3xu1-0001pa-Dq; Fri, 17 Nov 2023 12:24:53 +0000 Received: by outflank-mailman (input) for mailman id 635114; Fri, 17 Nov 2023 12:24:52 +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 1r3xu0-0000iK-Lu for xen-devel@lists.xenproject.org; Fri, 17 Nov 2023 12:24:52 +0000 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [2a00:1450:4864:20::131]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 4e2627db-8544-11ee-9b0e-b553b5be7939; Fri, 17 Nov 2023 13:24:51 +0100 (CET) Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-5094727fa67so2727460e87.3 for ; Fri, 17 Nov 2023 04:24:51 -0800 (PST) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id a18-20020ac25e72000000b005094d95e8bcsm209811lfr.218.2023.11.17.04.24.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 04:24:49 -0800 (PST) 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: 4e2627db-8544-11ee-9b0e-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700223890; x=1700828690; 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=i1dFNOxKIfpxe4fbqyq4aYiHJEk/IRyQX0YWJ3IS3kY=; b=aN5tHBU8cUyOT74PB0luPsRwb0vJQIbn72IOCyH3W84NmkkmfoWgVsQ1v9DYVz3CeD iraEBOy2GbPG8YD2TZDrLCk5/MZJdCs3Z8VCoN1zS/Il5b2OxTFo4yutSh/mTur+M+XT u1l6kbMwKqhwgjVY81Hs+aSlVMrLddaVZyf4yr1hWxpBDzvlR6aTL1cHuOH4IVTsesOX VW7kmbnoBp0hqSSyTG89ycwjWAgpmRX8ENT9X/ocoyDlgtEjlsy1MlBJatJTAzY6gBWb 5gQMliO+tGazNmWy+VYds9Fq0HjFlOzYh0u05CjBESZgbMLC7RoIWY/akNdre5b8OU14 0sxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700223890; x=1700828690; 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=i1dFNOxKIfpxe4fbqyq4aYiHJEk/IRyQX0YWJ3IS3kY=; b=ZHyUvv2ABvQqk//XtEvuU93YcZtOeao/bsISO/vNhiAG5031JPGlXbqoB1bbw+gdu3 yVAHpVgXiDAEWx+/ZVnUOrUrDnu3IHDg6o+QBDWEKZ0MSkclV0DL6d9SdP9ihzosKE4M fGQ1H9uR7r7Crub7zAdYHHX8/jp4E12UuVW9pcUjyMHtqPuB8T8r8AhOSYlFs2vlsNFu nNYs3vqRkQvROeMeqDm9Iq6HnlCHSL0Xhp7+22BZIINp+lEZefv3QlJiaDjYVufz7brk 9WqxEE7LU9hKZNqbPw+ZeP4P6sEc2iWvHZst0mpUVGSF32iBboPRlEx/Rm95dgI8yrSU G6BQ== X-Gm-Message-State: AOJu0YwiaujMRHHQNr1GqtypWDV166tyKikC4AAPEWVQUgTvNyeXLwXs hyU9ZZZZL4jCj6iQUmfpCvKLnSH1EH8= X-Google-Smtp-Source: AGHT+IH3+reAVmfVJJN0NjtOL7cn6V0nBW6vS3nAoCQBvotNB9uWzEmohcLUH0aW+uHS3u2OPyMS1w== X-Received: by 2002:a05:6512:a96:b0:509:8e7f:b46c with SMTP id m22-20020a0565120a9600b005098e7fb46cmr4729902lfu.56.1700223889890; Fri, 17 Nov 2023 04:24:49 -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 v3 05/14] xen/asm-generic: introduce stub header Date: Fri, 17 Nov 2023 14:24:29 +0200 Message-ID: <9a2b8920df291915ac6be0d14e6e9896e81ea9bd.1700221559.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 is common for Arm, PPC and RISC-V thereby it is moved to asm-generic. Signed-off-by: Oleksii Kurochko Reviewed-by: Jan Beulich Acked-by: Julien Grall --- Changes in V3: - Drop Arm and PPC's random.h and switch to asm-generic verison. --- Changes in V2: - update the commit messages --- xen/arch/arm/include/asm/Makefile | 1 + xen/arch/arm/include/asm/random.h | 9 --------- xen/arch/ppc/include/asm/Makefile | 1 + xen/arch/ppc/include/asm/random.h | 9 --------- xen/include/asm-generic/random.h | 20 ++++++++++++++++++++ 5 files changed, 22 insertions(+), 18 deletions(-) delete mode 100644 xen/arch/arm/include/asm/random.h delete mode 100644 xen/arch/ppc/include/asm/random.h create mode 100644 xen/include/asm-generic/random.h diff --git a/xen/arch/arm/include/asm/Makefile b/xen/arch/arm/include/asm/Makefile index 96e3aa6b6c..cac6d5e3df 100644 --- a/xen/arch/arm/include/asm/Makefile +++ b/xen/arch/arm/include/asm/Makefile @@ -1,4 +1,5 @@ # SPDX-License-Identifier: GPL-2.0-only generic-y += iocap.h generic-y += paging.h +generic-y += random.h generic-y += vm_event.h diff --git a/xen/arch/arm/include/asm/random.h b/xen/arch/arm/include/asm/random.h deleted file mode 100644 index b4acee276b..0000000000 --- a/xen/arch/arm/include/asm/random.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef __ASM_RANDOM_H__ -#define __ASM_RANDOM_H__ - -static inline unsigned int arch_get_random(void) -{ - return 0; -} - -#endif /* __ASM_RANDOM_H__ */ diff --git a/xen/arch/ppc/include/asm/Makefile b/xen/arch/ppc/include/asm/Makefile index 9f5a0dfb31..d8f2a1453c 100644 --- a/xen/arch/ppc/include/asm/Makefile +++ b/xen/arch/ppc/include/asm/Makefile @@ -2,4 +2,5 @@ generic-y += hypercall.h generic-y += iocap.h generic-y += paging.h +generic-y += random.h generic-y += vm_event.h diff --git a/xen/arch/ppc/include/asm/random.h b/xen/arch/ppc/include/asm/random.h deleted file mode 100644 index 2f9e9bbae4..0000000000 --- a/xen/arch/ppc/include/asm/random.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef __ASM_PPC_RANDOM_H__ -#define __ASM_PPC_RANDOM_H__ - -static inline unsigned int arch_get_random(void) -{ - return 0; -} - -#endif /* __ASM_PPC_RANDOM_H__ */ diff --git a/xen/include/asm-generic/random.h b/xen/include/asm-generic/random.h new file mode 100644 index 0000000000..cd2307e70b --- /dev/null +++ b/xen/include/asm-generic/random.h @@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ASM_GENERIC_RANDOM_H__ +#define __ASM_GENERIC_RANDOM_H__ + +static inline unsigned int arch_get_random(void) +{ + return 0; +} + +#endif /* __ASM_GENERIC_RANDOM_H__ */ + + +/* + * Local variables: + * mode: C + * c-file-style: BSD + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ From patchwork Fri Nov 17 12:24:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksii Kurochko X-Patchwork-Id: 13458915 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4D495C197A0 for ; Fri, 17 Nov 2023 12:25:11 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.635115.990915 (Exim 4.92) (envelope-from ) id 1r3xu2-00029R-U7; Fri, 17 Nov 2023 12:24:54 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 635115.990915; Fri, 17 Nov 2023 12:24:54 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r3xu2-000294-PD; Fri, 17 Nov 2023 12:24:54 +0000 Received: by outflank-mailman (input) for mailman id 635115; Fri, 17 Nov 2023 12:24:53 +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 1r3xu1-0000ZQ-3D for xen-devel@lists.xenproject.org; Fri, 17 Nov 2023 12:24:53 +0000 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [2a00:1450:4864:20::12e]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 4ef436a2-8544-11ee-98dc-6d05b1d4d9a1; Fri, 17 Nov 2023 13:24:52 +0100 (CET) Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-507a62d4788so2777331e87.0 for ; Fri, 17 Nov 2023 04:24:52 -0800 (PST) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id a18-20020ac25e72000000b005094d95e8bcsm209811lfr.218.2023.11.17.04.24.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 04:24:50 -0800 (PST) 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: 4ef436a2-8544-11ee-98dc-6d05b1d4d9a1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700223891; x=1700828691; 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=CmF4A4d7FVu2Lm9OasCXvIiEmLVAs/RA3iaDX7HMtUc=; b=b+I2yTAKSwoQRzMOLIdTdSxjL2yNH2QjzoBAMBxLSg6d3L68T33hElYE68UnA6ZI45 FzMvazIh023YMv7EMjjZSiLhtEkDn/lwAdVE/s7qYIQVJW3YkJ036UM2gmt4KqmsVObb W/MemWCl3ISFhtzN/Y/ULZX8hJEN7k8llrWJZoHrpG7kdaUujoDBeBpNOWMJ3bdVPbMJ d09vPcfDCT2UBMnMBiJH+E8UKsJCJTTG2iums3sN7Cw2WGV1lAEcnFihZ6TQFBMCXeBk 5x3b6APt9U1TbASc/WV1FBXgV88pROZCFYgJLExh30YNIIdlkeJqIfJGO0CDkCThULG+ uiOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700223891; x=1700828691; 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=CmF4A4d7FVu2Lm9OasCXvIiEmLVAs/RA3iaDX7HMtUc=; b=mvyPq1rw3XVZTIVkF8BZRi6U2Ulbeks2WmwJF904QOiGr0T1WfdnQJYfv5Ofs1QHwR ZGBc84EygCzzrHcVT1IbpZ5+nMlGkNP2CPUfU7hRV0pg414PeqjBgFfLRtSf6M8z+TUQ llDvxgztTftOIOUINwb+mOoCh2Y7sxP8j8JUCVgQUQGNtU0CX5j4sQbBMkoM7Gk6GudZ pzOK5C2DgMTRpOu/SYS5aAenVtmRL8bJWJrwHparRxrBH2MaXMWuaTH7F6VYS02c/O7S poEleg8UlbcLRo4mwjtl/Ogt+a/0u5X0DLGQhJXL19DsKYIpK2mLribvhZNWSBvTOqsp m1lA== X-Gm-Message-State: AOJu0YyqXlgJ0ERJ/r8HTDufVtjExLlrbr9ZeRYfentqKfYu3XG3Nhej Vst4S37bYqQ4SEb4Oh5TzR07Bw9FyOQ= X-Google-Smtp-Source: AGHT+IEMNUY2VtMbTfqAN5gjDSjk+v1jx+g+65pLhs0lhW5GsA9mnX6iU7yUHbyRmcVc4Cxu3P2IjA== X-Received: by 2002:a05:6512:41c:b0:509:2b81:fc40 with SMTP id u28-20020a056512041c00b005092b81fc40mr12290127lfk.9.1700223891250; Fri, 17 Nov 2023 04:24:51 -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_Pau_Monn=C3=A9?= Subject: [PATCH v3 06/14] xen/asm-generic: introduce generic header percpu.h Date: Fri, 17 Nov 2023 14:24:30 +0200 Message-ID: <51ce486a825a1654998db01c4e07c127e4b1b38b.1700221559.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 The patch introduces generic percpu.h which was based on Arm's version with the following changes: * makes __per_cpu_data_end[] constant * introduce get_per_cpu_offset() for macros this_cpu() and this_cpu_ptr() * add inclustion of as get_per_cpu_offset() is located there. Also it was changed a place where is included in because asm-generic version of percpu.h started to include which requires definition of DECLARE_PER_CPU. As well the patch switches Arm, PPC and x86 architectures to use asm-generic version of percpu.h. Signed-off-by: Oleksii Kurochko Acked-by: Julien Grall --- Changes in V3: - switch all architectures to asm-generic version of percpu.h - introduce get_per_cpu_offset() and implement it architectures. - make __per_cpu_data_end constamt. - update the commit message. --- Changes in V2: - use smp_processor_id() instead of get_processor_id(). - update commit message . --- xen/arch/arm/include/asm/Makefile | 1 + xen/arch/arm/include/asm/current.h | 3 +++ xen/arch/ppc/include/asm/Makefile | 1 + xen/arch/ppc/include/asm/current.h | 6 +++++ xen/arch/ppc/include/asm/percpu.h | 24 ------------------- xen/arch/x86/include/asm/Makefile | 2 ++ xen/arch/x86/include/asm/current.h | 2 ++ xen/arch/x86/include/asm/percpu.h | 22 ----------------- .../asm => include/asm-generic}/percpu.h | 18 ++++++++------ xen/include/xen/percpu.h | 4 ++-- 10 files changed, 28 insertions(+), 55 deletions(-) delete mode 100644 xen/arch/ppc/include/asm/percpu.h create mode 100644 xen/arch/x86/include/asm/Makefile delete mode 100644 xen/arch/x86/include/asm/percpu.h rename xen/{arch/arm/include/asm => include/asm-generic}/percpu.h (57%) diff --git a/xen/arch/arm/include/asm/Makefile b/xen/arch/arm/include/asm/Makefile index cac6d5e3df..3faf1251ec 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 += iocap.h generic-y += paging.h +generic-y += percpu.h generic-y += random.h generic-y += vm_event.h diff --git a/xen/arch/arm/include/asm/current.h b/xen/arch/arm/include/asm/current.h index 51d1c8efa8..0be7ad6ef9 100644 --- a/xen/arch/arm/include/asm/current.h +++ b/xen/arch/arm/include/asm/current.h @@ -5,6 +5,7 @@ #include #include +#include /* Tell whether the guest vCPU enabled Workaround 2 (i.e variant 4) */ #define CPUINFO_WORKAROUND_2_FLAG_SHIFT 0 @@ -60,6 +61,8 @@ do { \ this_cpu(cpu_id) = (id); \ } while ( 0 ) +#define get_per_cpu_offset() READ_SYSREG(TPIDR_EL2) + #endif #endif /* __ARM_CURRENT_H__ */ diff --git a/xen/arch/ppc/include/asm/Makefile b/xen/arch/ppc/include/asm/Makefile index d8f2a1453c..c0badf5717 100644 --- a/xen/arch/ppc/include/asm/Makefile +++ b/xen/arch/ppc/include/asm/Makefile @@ -2,5 +2,6 @@ generic-y += hypercall.h generic-y += iocap.h generic-y += paging.h +generic-y += percpu.h generic-y += random.h generic-y += vm_event.h diff --git a/xen/arch/ppc/include/asm/current.h b/xen/arch/ppc/include/asm/current.h index 0ca06033f9..3d0d316bae 100644 --- a/xen/arch/ppc/include/asm/current.h +++ b/xen/arch/ppc/include/asm/current.h @@ -4,6 +4,8 @@ #include +#include + #ifndef __ASSEMBLY__ struct vcpu; @@ -38,6 +40,10 @@ static inline struct cpu_info *get_cpu_info(void) #define guest_cpu_user_regs() (&get_cpu_info()->guest_cpu_user_regs) +#define smp_processor_id() 0 /* TODO: Fix this */ + +#define get_per_cpu_offset() smp_processor_id() + #endif /* __ASSEMBLY__ */ #endif /* __ASM_PPC_CURRENT_H__ */ diff --git a/xen/arch/ppc/include/asm/percpu.h b/xen/arch/ppc/include/asm/percpu.h deleted file mode 100644 index e7c40c0f03..0000000000 --- a/xen/arch/ppc/include/asm/percpu.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef __PPC_PERCPU_H__ -#define __PPC_PERCPU_H__ - -#ifndef __ASSEMBLY__ - -extern char __per_cpu_start[], __per_cpu_data_end[]; -extern unsigned long __per_cpu_offset[NR_CPUS]; -void percpu_init_areas(void); - -#define smp_processor_id() 0 /* TODO: Fix this */ - -#define per_cpu(var, cpu) \ - (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset[cpu])) -#define this_cpu(var) \ - (*RELOC_HIDE(&per_cpu__##var, smp_processor_id())) - -#define per_cpu_ptr(var, cpu) \ - (*RELOC_HIDE(var, __per_cpu_offset[cpu])) -#define this_cpu_ptr(var) \ - (*RELOC_HIDE(var, smp_processor_id())) - -#endif - -#endif /* __PPC_PERCPU_H__ */ diff --git a/xen/arch/x86/include/asm/Makefile b/xen/arch/x86/include/asm/Makefile new file mode 100644 index 0000000000..874429ed30 --- /dev/null +++ b/xen/arch/x86/include/asm/Makefile @@ -0,0 +1,2 @@ +# SPDX-License-Identifier: GPL-2.0-only +generic-y += percpu.h diff --git a/xen/arch/x86/include/asm/current.h b/xen/arch/x86/include/asm/current.h index 35cca5cbe4..10950f36cc 100644 --- a/xen/arch/x86/include/asm/current.h +++ b/xen/arch/x86/include/asm/current.h @@ -102,6 +102,8 @@ static inline struct cpu_info *get_cpu_info(void) #define smp_processor_id() (get_cpu_info()->processor_id) #define guest_cpu_user_regs() (&get_cpu_info()->guest_cpu_user_regs) +#define get_per_cpu_offset() (get_cpu_info()->per_cpu_offset) + /* * Get the bottom-of-stack, as stored in the per-CPU TSS. This actually points * into the middle of cpu_info.guest_cpu_user_regs, at the section that diff --git a/xen/arch/x86/include/asm/percpu.h b/xen/arch/x86/include/asm/percpu.h deleted file mode 100644 index 2b0c29a233..0000000000 --- a/xen/arch/x86/include/asm/percpu.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef __X86_PERCPU_H__ -#define __X86_PERCPU_H__ - -#ifndef __ASSEMBLY__ -extern char __per_cpu_start[], __per_cpu_data_end[]; -extern unsigned long __per_cpu_offset[NR_CPUS]; -void percpu_init_areas(void); -#endif - -/* var is in discarded region: offset to particular copy we want */ -#define per_cpu(var, cpu) \ - (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset[cpu])) -#define this_cpu(var) \ - (*RELOC_HIDE(&per_cpu__##var, get_cpu_info()->per_cpu_offset)) - -#define this_cpu_ptr(var) \ - (*RELOC_HIDE(var, get_cpu_info()->per_cpu_offset)) - -#define per_cpu_ptr(var, cpu) \ - (*RELOC_HIDE(var, __per_cpu_offset[cpu])) - -#endif /* __X86_PERCPU_H__ */ diff --git a/xen/arch/arm/include/asm/percpu.h b/xen/include/asm-generic/percpu.h similarity index 57% rename from xen/arch/arm/include/asm/percpu.h rename to xen/include/asm-generic/percpu.h index f1a8768080..60af4f9ff9 100644 --- a/xen/arch/arm/include/asm/percpu.h +++ b/xen/include/asm-generic/percpu.h @@ -1,28 +1,32 @@ -#ifndef __ARM_PERCPU_H__ -#define __ARM_PERCPU_H__ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ASM_GENERIC_PERCPU_H__ +#define __ASM_GENERIC_PERCPU_H__ #ifndef __ASSEMBLY__ #include -#include +#include -extern char __per_cpu_start[], __per_cpu_data_end[]; +extern char __per_cpu_start[]; +extern const char __per_cpu_data_end[]; extern unsigned long __per_cpu_offset[NR_CPUS]; void percpu_init_areas(void); #define per_cpu(var, cpu) \ (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset[cpu])) + #define this_cpu(var) \ - (*RELOC_HIDE(&per_cpu__##var, READ_SYSREG(TPIDR_EL2))) + (*RELOC_HIDE(&per_cpu__##var, get_per_cpu_offset())) #define per_cpu_ptr(var, cpu) \ (*RELOC_HIDE(var, __per_cpu_offset[cpu])) #define this_cpu_ptr(var) \ - (*RELOC_HIDE(var, READ_SYSREG(TPIDR_EL2))) + (*RELOC_HIDE(var, get_per_cpu_offset())) #endif -#endif /* __ARM_PERCPU_H__ */ +#endif /* __ASM_GENERIC_PERCPU_H__ */ + /* * Local variables: * mode: C diff --git a/xen/include/xen/percpu.h b/xen/include/xen/percpu.h index c7bf57cbcd..57522f346b 100644 --- a/xen/include/xen/percpu.h +++ b/xen/include/xen/percpu.h @@ -1,8 +1,6 @@ #ifndef __XEN_PERCPU_H__ #define __XEN_PERCPU_H__ -#include - #define DECLARE_PER_CPU(type, name) \ extern __typeof__(type) per_cpu__ ## name @@ -29,6 +27,8 @@ #define get_per_cpu_var(var) (per_cpu__##var) +#include + /* Linux compatibility. */ #define get_cpu_var(var) this_cpu(var) #define put_cpu_var(var) From patchwork Fri Nov 17 12:24:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksii Kurochko X-Patchwork-Id: 13458916 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9F6F0C47071 for ; Fri, 17 Nov 2023 12:25:12 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.635118.990931 (Exim 4.92) (envelope-from ) id 1r3xu5-0002Ya-Of; Fri, 17 Nov 2023 12:24:57 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 635118.990931; Fri, 17 Nov 2023 12:24:57 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r3xu5-0002Xk-FL; Fri, 17 Nov 2023 12:24:57 +0000 Received: by outflank-mailman (input) for mailman id 635118; Fri, 17 Nov 2023 12:24:55 +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 1r3xu3-0000iK-9b for xen-devel@lists.xenproject.org; Fri, 17 Nov 2023 12:24:55 +0000 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [2a00:1450:4864:20::134]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 4fb95b22-8544-11ee-9b0e-b553b5be7939; Fri, 17 Nov 2023 13:24:53 +0100 (CET) Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-507e85ebf50so2543375e87.1 for ; Fri, 17 Nov 2023 04:24:53 -0800 (PST) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id a18-20020ac25e72000000b005094d95e8bcsm209811lfr.218.2023.11.17.04.24.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 04:24:52 -0800 (PST) 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: 4fb95b22-8544-11ee-9b0e-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700223892; x=1700828692; 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=LmhmHUWbvIjT7v8mc11Sz63FiVrJy0OUXCvMliE2Ht4=; b=mtREsuv4zUri87MyaDyHz0YBtzUXMgWy1t2cXNXfQVU2FjUyb3nBhKAeHDgocRQ3Xf mXnwmvLoRAfcCZ43lvnZoTU1mXOBvUl7zDOtGM0CbGtUgFVSVujvMSsSEECQK21O+xbN kFyreIBBdizNQdLK066LQleaonfSbeQZwhfEG6QJvJ+3/kLsKg7wYhEO3Uxy/JHYSXe0 QrYvwbHGlw9gCVSgXHfB3AiL6Ne7UDOAx5s5RennU26XYUuCNqxVahCFJpuR1pePzVUF GhCELLUYrJqo4AcuAOEdwzLnS4AUnvtg1cWwBm3edLlpE2VvSNsDH2enHNoW5E9VPiP2 McJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700223892; x=1700828692; 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=LmhmHUWbvIjT7v8mc11Sz63FiVrJy0OUXCvMliE2Ht4=; b=maf2cWQoxnELcS9guWGiaiSf1KI0qXoZhaHb6SDdRgtRGwaJNEoswXqL1d0pItMcg3 VLl6m3WCQ6P6DGjARN9AR7BCrUjiSFGfceiucTNKbBk+X9o4df0EEr750apjeY4bGUiG uz0nUUymqCD/25F/WfCq+WFubD6M29t805i/9Hv46oewGYjGhWHqNaMDq6LhpRz/obiz ZSBUV9rN811MZ1AYQ//7p54HSyBiJZ2XM5nS7mdNzyDtW6v7JGdVpGcrXOidGXXH994E axyywuxc1nK0o7FDshG25ExwDB8pOB+rZgnXqyDNQ2MKz67H3tKTjXNFDgEwD0PUuwOj beaQ== X-Gm-Message-State: AOJu0YzMF1KxP/UgtF6ZDmoSEsSQWBN+H7yXVS3WaKfmAML1GR5p8gD3 UMFG3xNF040HmiP+WLrE4JVn3CIjKFc= X-Google-Smtp-Source: AGHT+IEHBboeFXfJjLbpEhMOw1rwqfVPFifgWPaWKGkc3Ns3Rd8K4df0XjjxOuDHlrOIwKkLmGP5PQ== X-Received: by 2002:a05:6512:b8c:b0:50a:a14e:92c5 with SMTP id b12-20020a0565120b8c00b0050aa14e92c5mr1270060lfv.45.1700223892601; Fri, 17 Nov 2023 04:24:52 -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 v3 07/14] xen/asm-generic: introduce generalized hardirq.h Date: Fri, 17 Nov 2023 14:24:31 +0200 Message-ID: <3e5334809f5efa78eebe8e8ff342f10851f107f9.1700221559.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 is common through archs thereby it is moved to asm-generic. Arm and PPC were switched to asm generic verstion of hardirq.h. Signed-off-by: Oleksii Kurochko Reviewed-by: Jan Beulich Acked-by: Julien Grall --- Changes in V3: - Drop Arm and PPC's hardirq.h - Update the commit message. --- Changes in V2: - add #include . - update the commit message --- xen/arch/arm/include/asm/Makefile | 1 + xen/arch/ppc/include/asm/Makefile | 1 + xen/arch/ppc/include/asm/hardirq.h | 19 ------------------- .../asm => include/asm-generic}/hardirq.h | 8 +++++--- 4 files changed, 7 insertions(+), 22 deletions(-) delete mode 100644 xen/arch/ppc/include/asm/hardirq.h rename xen/{arch/arm/include/asm => include/asm-generic}/hardirq.h (79%) diff --git a/xen/arch/arm/include/asm/Makefile b/xen/arch/arm/include/asm/Makefile index 3faf1251ec..36d95d6310 100644 --- a/xen/arch/arm/include/asm/Makefile +++ b/xen/arch/arm/include/asm/Makefile @@ -1,4 +1,5 @@ # SPDX-License-Identifier: GPL-2.0-only +generic-y += hardirq.h generic-y += iocap.h generic-y += paging.h generic-y += percpu.h diff --git a/xen/arch/ppc/include/asm/Makefile b/xen/arch/ppc/include/asm/Makefile index c0badf5717..9b38d2d381 100644 --- a/xen/arch/ppc/include/asm/Makefile +++ b/xen/arch/ppc/include/asm/Makefile @@ -1,4 +1,5 @@ # SPDX-License-Identifier: GPL-2.0-only +generic-y += hardirq.h generic-y += hypercall.h generic-y += iocap.h generic-y += paging.h diff --git a/xen/arch/ppc/include/asm/hardirq.h b/xen/arch/ppc/include/asm/hardirq.h deleted file mode 100644 index 343efc7e69..0000000000 --- a/xen/arch/ppc/include/asm/hardirq.h +++ /dev/null @@ -1,19 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#ifndef __ASM_PPC_HARDIRQ_H__ -#define __ASM_PPC_HARDIRQ_H__ - -#include - -typedef struct { - unsigned long __softirq_pending; - unsigned int __local_irq_count; -} __cacheline_aligned irq_cpustat_t; - -#include /* Standard mappings for irq_cpustat_t above */ - -#define in_irq() (local_irq_count(smp_processor_id()) != 0) - -#define irq_enter() (local_irq_count(smp_processor_id())++) -#define irq_exit() (local_irq_count(smp_processor_id())--) - -#endif /* __ASM_PPC_HARDIRQ_H__ */ diff --git a/xen/arch/arm/include/asm/hardirq.h b/xen/include/asm-generic/hardirq.h similarity index 79% rename from xen/arch/arm/include/asm/hardirq.h rename to xen/include/asm-generic/hardirq.h index 67b6a673db..ddccf460b9 100644 --- a/xen/arch/arm/include/asm/hardirq.h +++ b/xen/include/asm-generic/hardirq.h @@ -1,5 +1,6 @@ -#ifndef __ASM_HARDIRQ_H -#define __ASM_HARDIRQ_H +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ASM_GENERIC_HARDIRQ_H +#define __ASM_GENERIC_HARDIRQ_H #include #include @@ -16,7 +17,8 @@ typedef struct { #define irq_enter() (local_irq_count(smp_processor_id())++) #define irq_exit() (local_irq_count(smp_processor_id())--) -#endif /* __ASM_HARDIRQ_H */ +#endif /* __ASM_GENERIC_HARDIRQ_H */ + /* * Local variables: * mode: C From patchwork Fri Nov 17 12:24:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksii Kurochko X-Patchwork-Id: 13458910 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3AC2CC072A2 for ; Fri, 17 Nov 2023 12:25:07 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.635117.990924 (Exim 4.92) (envelope-from ) id 1r3xu5-0002Ts-5m; Fri, 17 Nov 2023 12:24:57 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 635117.990924; Fri, 17 Nov 2023 12:24:57 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r3xu5-0002Tb-2d; Fri, 17 Nov 2023 12:24:57 +0000 Received: by outflank-mailman (input) for mailman id 635117; Fri, 17 Nov 2023 12:24:55 +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 1r3xu3-0000ZQ-2R for xen-devel@lists.xenproject.org; Fri, 17 Nov 2023 12:24:55 +0000 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [2a00:1450:4864:20::12c]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 503bfeab-8544-11ee-98dc-6d05b1d4d9a1; Fri, 17 Nov 2023 13:24:54 +0100 (CET) Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-5079f9ec8d9so2033198e87.0 for ; Fri, 17 Nov 2023 04:24:54 -0800 (PST) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id a18-20020ac25e72000000b005094d95e8bcsm209811lfr.218.2023.11.17.04.24.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 04:24:53 -0800 (PST) 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: 503bfeab-8544-11ee-98dc-6d05b1d4d9a1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700223894; x=1700828694; 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=h5EFcRe5i11VHN5dkWPb4m8i84DRWOYD+kJLJMwIYHU=; b=khgVVekBBYMZDZxrIgX5r+NSmEj69sJ2rihdRHAKkCzBOTZWzdVtqYxuL3HtSvT7Ry XV0z6+tVo4XcXML7hguelv1hVrePWk7f7S/NtmO9y5NlUB205QhGX7eAKWwyjDITa/sL /X/2sVFTzkYtvP9M4b2t1hpbbzEYa7mu+MPG/TusJOZaDJDmiABanvxjDetvRI73TGGD B0x4Tp+ZoLnRGRmHRq/iMEff3tIa0dNY4s7pnN5hRfKSVLDCUOJARLgSj352cz2TQ3TW n/YtatociKBMXBtEt2PQfFfqLHLg6nXsYh/FvhRTwF38np26RzrMNfYChngc1xlPWqy4 nrlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700223894; x=1700828694; 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=h5EFcRe5i11VHN5dkWPb4m8i84DRWOYD+kJLJMwIYHU=; b=PQeXnSLVuQi3d5x2ytP5hy86jza/Hotw8hqAG4Aq9vsgdPlTtdgIlc5jwdKejeLjz0 YI8sWxhpHwPo+jgIBNiE+1MOS60YvxXdXAJqkl2PnxGVmJXrEnFdedUwWNN3s7MoE/vz I7YvC6xZUvcVrbO8Twp592wQb+9Cp06mqSVSFgODOoCY2dJznpTWF1SKKG0EI0MvsVO+ FZAisV9S43sCFpImfls5ksBU6UuLDpZKKcBD/vFeJPHizDaner1iFUPQbHea/GQFzuSs 2u5o52SAHB5HY/3Bgbu777ZHHmsqT5B5vv5mnlgGyu8VW89VGC8+FsadcULrn32bESoh rPyw== X-Gm-Message-State: AOJu0YzZZMgjqZ2qm+XyW/dPPZGNpvoMzG9aNaYCmTtXu9VEJ/rJmYjr mSOR5UJJunH2LReCsmofvIWg7yHj/98= X-Google-Smtp-Source: AGHT+IHr9y044KYZlXDIF525+vEqaghyq5t8xYgVXfKhB5uq9h3N8pjlewWLM7B+IfX97VOA0g5LSw== X-Received: by 2002:ac2:4e10:0:b0:501:ba04:f352 with SMTP id e16-20020ac24e10000000b00501ba04f352mr2567197lfr.1.1700223893938; Fri, 17 Nov 2023 04:24:53 -0800 (PST) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , Shawn Anastasio , Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Subject: [PATCH v3 08/14] xen/asm-generic: introduce generic div64.h header Date: Fri, 17 Nov 2023 14:24:32 +0200 Message-ID: <13bf409f3191d066af9caef417011b6ea039dbd9.1700221559.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 All archs have the do_div implementation for BITS_PER_LONG == 64 so do_div64.h is moved to asm-generic. x86 and PPC were switched to asm-generic version of div64.h. Signed-off-by: Oleksii Kurochko Acked-by: Jan Beulich --- 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 == 64" - fix code style --- 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 +++++++++++++++++++++++++++ 5 files changed, 29 insertions(+), 28 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/ppc/include/asm/Makefile b/xen/arch/ppc/include/asm/Makefile index 9b38d2d381..b4fbcc897b 100644 --- a/xen/arch/ppc/include/asm/Makefile +++ b/xen/arch/ppc/include/asm/Makefile @@ -1,4 +1,5 @@ # SPDX-License-Identifier: GPL-2.0-only +generic-y += div64.h generic-y += hardirq.h generic-y += hypercall.h generic-y += iocap.h diff --git a/xen/arch/ppc/include/asm/div64.h b/xen/arch/ppc/include/asm/div64.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_ = (base); \ - uint32_t rem_ = (uint64_t)(n) % base_; \ - (n) = (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/Makefile 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 += div64.h generic-y += percpu.h diff --git a/xen/arch/x86/include/asm/div64.h b/xen/arch/x86/include/asm/div64.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 = (base); \ - uint32_t __rem; \ - __rem = ((uint64_t)(n)) % __base; \ - (n) = ((uint64_t)(n)) / __base; \ - __rem; \ -}) - -#endif diff --git a/xen/include/asm-generic/div64.h b/xen/include/asm-generic/div64.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 == 64 + +#define do_div(n, divisor) ({ \ + uint32_t divisor_ = (divisor); \ + uint32_t rem_ = (uint64_t)(n) % divisor_; \ + (n) = (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: + */ From patchwork Fri Nov 17 12:24:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksii Kurochko X-Patchwork-Id: 13458914 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E008DC072A2 for ; Fri, 17 Nov 2023 12:25:10 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.635119.990945 (Exim 4.92) (envelope-from ) id 1r3xu8-00037w-BC; Fri, 17 Nov 2023 12:25:00 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 635119.990945; Fri, 17 Nov 2023 12:25:00 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r3xu8-00037Y-4j; Fri, 17 Nov 2023 12:25:00 +0000 Received: by outflank-mailman (input) for mailman id 635119; Fri, 17 Nov 2023 12:24:58 +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 1r3xu6-0000iK-Lq for xen-devel@lists.xenproject.org; Fri, 17 Nov 2023 12:24:58 +0000 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [2a00:1450:4864:20::134]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 51b6f61a-8544-11ee-9b0e-b553b5be7939; Fri, 17 Nov 2023 13:24:57 +0100 (CET) Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-507cd62472dso3284831e87.0 for ; Fri, 17 Nov 2023 04:24:57 -0800 (PST) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id a18-20020ac25e72000000b005094d95e8bcsm209811lfr.218.2023.11.17.04.24.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 04:24:55 -0800 (PST) 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: 51b6f61a-8544-11ee-9b0e-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700223896; x=1700828696; 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=Rl4iF/FkI2FedcYr2gK5iEVqy4B8r/7vxJoL3llru3Y=; b=Q9xGDPf3UTgOG//69XRx6MNhY2U8JxPD0+I9aOFfuhjwTHaUIsQ8sF1EloAafWPhsZ BkfbtF8I57bc0bVNRXXNI7ZMan0Omr//+h+il7j8kdOo0NmveI5F3048dHvUdf7ulwOA 8ddEkKiFGVHAJB6fBroTbBo9ptQHFN7yRAcd8/TLQ8J1YMUu2y+mnfMFXaEywOrH9VKo Lmn1KeFoDPjW6m+cYW2F7vtcrNxU5q5iSLteLZm6neD2ZMO1T/TL53WmCMZVl+F/tapL 2qrRnlFwSZgs1EitCB/SXlfeU2xtFu5WLhaYk5zfsw43l0GQCpg4GQldgDAThCGWxc7r D84A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700223896; x=1700828696; 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=Rl4iF/FkI2FedcYr2gK5iEVqy4B8r/7vxJoL3llru3Y=; b=C5LtZD/vnmsz9fVXxkKEjomoS0QiTTBJ4kA+O2xAKHGJ0dCw1pGSMBpMT47Gb1rqu4 67ruO29mVQwZcfeHdBJBds2Rg3WcT0Dyjd4vJ26+Hqk/AbWpzYoiDHMNCCA8tLMI+JnP ES5c9+qtmJSCgoHfYEp12D8kYGLcJYbU19iQA0/kAQmUUuWhZI4hMUu3dorqLp4QygdT qNyumDLma+nb5JncYli14Tx4jUQVpOKIyZMDEgI6UqjTwF6iCGHGUeRbdE9iPKF46bk0 Odhci26gwjK6SArziMLjlh8bPar2C8pbjSKk5yo4wTRX3ir3IfdwWaGt9Zp+WtbN8x9h KRAQ== X-Gm-Message-State: AOJu0YwNCHgIG30OpGQ5fEZbYddbtQ7gaXpPO2KqeuIkZmuMlhGstgd8 gmECfsGPb4NqQnZlnwr+KclpkpY71L4= X-Google-Smtp-Source: AGHT+IGS/KYKzWD4X2WyiU5KxDXlxhn6lkHLzh8Ep5tZGdrI6Za/XhwkhBv3v/L1gzuf8l5qz49yEw== X-Received: by 2002:a05:6512:e9c:b0:509:dd1:74f8 with SMTP id bi28-20020a0565120e9c00b005090dd174f8mr2493853lfb.2.1700223895492; Fri, 17 Nov 2023 04:24:55 -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 v3 09/14] xen/asm-generic: introduce generic header altp2m.h Date: Fri, 17 Nov 2023 14:24:33 +0200 Message-ID: X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 is common between archs so it is moved to asm-generic. Arm and PPC were switched to asm-generic version of altp2m.h. Signed-off-by: Oleksii Kurochko Reviewed-by: Michal Orzel Acked-by: Jan Beulich --- Changes in V3: - Drop Arm and PPC's altp2m.h - Update the commit message. --- Changes in V2: - change uint16_t to unsigned int in declaration of altp2m_vcpu_idx - update the commit message --- xen/arch/arm/include/asm/Makefile | 1 + xen/arch/arm/include/asm/altp2m.h | 39 ------------------------------- xen/arch/ppc/include/asm/Makefile | 1 + xen/arch/ppc/include/asm/altp2m.h | 25 -------------------- xen/include/asm-generic/altp2m.h | 34 +++++++++++++++++++++++++++ 5 files changed, 36 insertions(+), 64 deletions(-) delete mode 100644 xen/arch/arm/include/asm/altp2m.h delete mode 100644 xen/arch/ppc/include/asm/altp2m.h create mode 100644 xen/include/asm-generic/altp2m.h diff --git a/xen/arch/arm/include/asm/Makefile b/xen/arch/arm/include/asm/Makefile index 36d95d6310..8221429c2c 100644 --- a/xen/arch/arm/include/asm/Makefile +++ b/xen/arch/arm/include/asm/Makefile @@ -1,4 +1,5 @@ # SPDX-License-Identifier: GPL-2.0-only +generic-y += altp2m.h generic-y += hardirq.h generic-y += iocap.h generic-y += paging.h diff --git a/xen/arch/arm/include/asm/altp2m.h b/xen/arch/arm/include/asm/altp2m.h deleted file mode 100644 index df50cb2f09..0000000000 --- a/xen/arch/arm/include/asm/altp2m.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Alternate p2m - * - * Copyright (c) 2014, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program; If not, see . - */ - -#ifndef __ASM_ARM_ALTP2M_H -#define __ASM_ARM_ALTP2M_H - -#include - -/* Alternate p2m on/off per domain */ -static inline bool altp2m_active(const struct domain *d) -{ - /* Not implemented on ARM. */ - return false; -} - -/* Alternate p2m VCPU */ -static inline uint16_t altp2m_vcpu_idx(const struct vcpu *v) -{ - /* Not implemented on ARM, should not be reached. */ - BUG(); - return 0; -} - -#endif /* __ASM_ARM_ALTP2M_H */ diff --git a/xen/arch/ppc/include/asm/Makefile b/xen/arch/ppc/include/asm/Makefile index b4fbcc897b..a8e848d4d0 100644 --- a/xen/arch/ppc/include/asm/Makefile +++ b/xen/arch/ppc/include/asm/Makefile @@ -1,4 +1,5 @@ # SPDX-License-Identifier: GPL-2.0-only +generic-y += altp2m.h generic-y += div64.h generic-y += hardirq.h generic-y += hypercall.h diff --git a/xen/arch/ppc/include/asm/altp2m.h b/xen/arch/ppc/include/asm/altp2m.h deleted file mode 100644 index bd5c9aa415..0000000000 --- a/xen/arch/ppc/include/asm/altp2m.h +++ /dev/null @@ -1,25 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#ifndef __ASM_PPC_ALTP2M_H__ -#define __ASM_PPC_ALTP2M_H__ - -#include - -struct domain; -struct vcpu; - -/* Alternate p2m on/off per domain */ -static inline bool altp2m_active(const struct domain *d) -{ - /* Not implemented on PPC. */ - return false; -} - -/* Alternate p2m VCPU */ -static inline uint16_t altp2m_vcpu_idx(const struct vcpu *v) -{ - /* Not implemented on PPC, should not be reached. */ - ASSERT_UNREACHABLE(); - return 0; -} - -#endif /* __ASM_PPC_ALTP2M_H__ */ diff --git a/xen/include/asm-generic/altp2m.h b/xen/include/asm-generic/altp2m.h new file mode 100644 index 0000000000..39865a842a --- /dev/null +++ b/xen/include/asm-generic/altp2m.h @@ -0,0 +1,34 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ASM_GENERIC_ALTP2M_H +#define __ASM_GENERIC_ALTP2M_H + +#include + +struct domain; +struct vcpu; + +/* Alternate p2m on/off per domain */ +static inline bool altp2m_active(const struct domain *d) +{ + /* Not implemented on GENERIC. */ + return false; +} + +/* Alternate p2m VCPU */ +static inline unsigned int altp2m_vcpu_idx(const struct vcpu *v) +{ + /* Not implemented on GENERIC, should not be reached. */ + BUG(); + return 0; +} + +#endif /* __ASM_GENERIC_ALTP2M_H */ + +/* + * Local variables: + * mode: C + * c-file-style: BSD + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ From patchwork Fri Nov 17 12:24:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksii Kurochko X-Patchwork-Id: 13458919 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7E41DC072A2 for ; Fri, 17 Nov 2023 12:25:18 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.635120.990954 (Exim 4.92) (envelope-from ) id 1r3xu9-0003Pi-PW; Fri, 17 Nov 2023 12:25:01 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 635120.990954; Fri, 17 Nov 2023 12:25:01 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r3xu9-0003O9-Gy; Fri, 17 Nov 2023 12:25:01 +0000 Received: by outflank-mailman (input) for mailman id 635120; Fri, 17 Nov 2023 12:25:00 +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 1r3xu8-0000iK-18 for xen-devel@lists.xenproject.org; Fri, 17 Nov 2023 12:25:00 +0000 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [2a00:1450:4864:20::12d]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 528193c7-8544-11ee-9b0e-b553b5be7939; Fri, 17 Nov 2023 13:24:58 +0100 (CET) Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-507adc3381cso2497182e87.3 for ; Fri, 17 Nov 2023 04:24:58 -0800 (PST) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id a18-20020ac25e72000000b005094d95e8bcsm209811lfr.218.2023.11.17.04.24.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 04:24:56 -0800 (PST) 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: 528193c7-8544-11ee-9b0e-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700223897; x=1700828697; 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=bqCrA4cmi94JGuUu0rnXEvBAcFwzLBG4Gu65+9LoXrk=; b=Xo5iLFYzImETXXLIyZYNWRTkQNTfqxYNCB6VcyGFlWIN8Okf7PRE+eXthgNy/+n9i8 8Noi1b2mACxISHpIkSf8UvEns5pGNwgsrbOwuKrwKt5WpJwDXiK/05RAmp/aHgYyropS H55zzZ2BsifPDS5fDuhaDMgeHNxuUjCUSZsXKO7/6jtdE8d1/+DkcmNXibKqXEo6p5NZ 516Bb7i5fSCVEUUar643X+UHwbQDZUdM+n8Z93q2iqpHMBalZMamy3yDphPYM4Le5u0+ ltzmV5X0UN1TP4IwHF/VGA7F16+7RcVZ5mE6dzDGDLxK4ljhRguzeJ8jDn3DqlxM/vAo +DaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700223897; x=1700828697; 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=bqCrA4cmi94JGuUu0rnXEvBAcFwzLBG4Gu65+9LoXrk=; b=qf8HlbXDQwd6PIUTOiVKYkT4Lj3OM/A8hRaIdJ6bjlccuXj0PIBXwhjspMMQ/jbfNf xlXpZ92pmXw4M/aZIeOySIW8nw1ZvVHy+oCVlH7alg+FDdOo2n2i30x6OCax555avl62 77RZDNTfEe80vKjPmU/MiN/shJOS5TSX3rpvoF+O2uoITpBM9dtMi6HvAiI3vp0rmd5W CJGJS7REhkGESec/Mff1HUMQww14fq7BulPCQPPcYpdBPSm/Oi2cJUg1NEniNkJsUVHi pBOeMGYFTbmn1hQYC6GnRJwjRAvyQp2gGxfvEv33sWdX9BSWSTmwDjFhHsAimOkbwuD1 sFFg== X-Gm-Message-State: AOJu0YyZZUcm44EALy2RPepkb0Mu260Tz6aixwE9ISv3NDUwfLs5934S OrdbKOFLdBX5YzDOqNs3zVKOGileeHo= X-Google-Smtp-Source: AGHT+IF33WHJwCt7yNZckLw2DNZfPJoO6TTBXIL1PFamgLtEsYrhqTxI/ztYReLy+R7TTatUyOQLHw== X-Received: by 2002:ac2:5f76:0:b0:507:9a05:1aed with SMTP id c22-20020ac25f76000000b005079a051aedmr12378937lfc.4.1700223897254; Fri, 17 Nov 2023 04:24:57 -0800 (PST) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , Shawn Anastasio , Tamas K Lengyel , Alexandru Isaila , Petre Pircalabu Subject: [PATCH v3 10/14] xen/asm-generic: introduce stub header monitor.h Date: Fri, 17 Nov 2023 14:24:34 +0200 Message-ID: <4340a173244ddf933979331762ccb0d523969738.1700221559.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 The header is shared between archs so it is moved to asm-generic. Signed-off-by: Oleksii Kurochko Acked-by: Jan Beulich --- 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/ppc/include/asm/Makefile | 1 + xen/arch/ppc/include/asm/monitor.h | 43 -------------------- xen/include/asm-generic/monitor.h | 63 ++++++++++++++++++++++++++++++ 3 files changed, 64 insertions(+), 43 deletions(-) delete mode 100644 xen/arch/ppc/include/asm/monitor.h create mode 100644 xen/include/asm-generic/monitor.h diff --git a/xen/arch/ppc/include/asm/Makefile b/xen/arch/ppc/include/asm/Makefile index a8e848d4d0..9bbae4cec8 100644 --- a/xen/arch/ppc/include/asm/Makefile +++ b/xen/arch/ppc/include/asm/Makefile @@ -4,6 +4,7 @@ generic-y += div64.h generic-y += hardirq.h generic-y += hypercall.h generic-y += iocap.h +generic-y += monitor.h generic-y += paging.h generic-y += percpu.h generic-y += random.h diff --git a/xen/arch/ppc/include/asm/monitor.h b/xen/arch/ppc/include/asm/monitor.h deleted file mode 100644 index e5b0282bf1..0000000000 --- a/xen/arch/ppc/include/asm/monitor.h +++ /dev/null @@ -1,43 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -/* Derived from xen/arch/arm/include/asm/monitor.h */ -#ifndef __ASM_PPC_MONITOR_H__ -#define __ASM_PPC_MONITOR_H__ - -#include -#include - -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. */ -} - -static inline uint32_t arch_monitor_get_capabilities(struct domain *d) -{ - BUG_ON("unimplemented"); - return 0; -} - -#endif /* __ASM_PPC_MONITOR_H__ */ diff --git a/xen/include/asm-generic/monitor.h b/xen/include/asm-generic/monitor.h new file mode 100644 index 0000000000..57b2256db7 --- /dev/null +++ b/xen/include/asm-generic/monitor.h @@ -0,0 +1,63 @@ +/* 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. */ +} + +static inline uint32_t arch_monitor_get_capabilities(struct domain *d) +{ + return 0; +} + +#endif /* __ASM_GENERIC_MONITOR_H__ */ + + +/* + * Local variables: + * mode: C + * c-file-style: BSD + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ From patchwork Fri Nov 17 12:24:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksii Kurochko X-Patchwork-Id: 13458917 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 25134C5AD4C for ; Fri, 17 Nov 2023 12:25:12 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.635121.990960 (Exim 4.92) (envelope-from ) id 1r3xuA-0003Vd-Bt; Fri, 17 Nov 2023 12:25:02 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 635121.990960; Fri, 17 Nov 2023 12:25:02 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r3xuA-0003UA-4h; Fri, 17 Nov 2023 12:25:02 +0000 Received: by outflank-mailman (input) for mailman id 635121; Fri, 17 Nov 2023 12:25:00 +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 1r3xu8-0000ZQ-5o for xen-devel@lists.xenproject.org; Fri, 17 Nov 2023 12:25:00 +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 5348235b-8544-11ee-98dc-6d05b1d4d9a1; Fri, 17 Nov 2023 13:24:59 +0100 (CET) Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-507f1c29f25so2659776e87.1 for ; Fri, 17 Nov 2023 04:24:59 -0800 (PST) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id a18-20020ac25e72000000b005094d95e8bcsm209811lfr.218.2023.11.17.04.24.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 04:24:58 -0800 (PST) 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: 5348235b-8544-11ee-98dc-6d05b1d4d9a1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700223898; x=1700828698; 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=YsnMnx3qJnhyBXB1udD6ESspWS/fknMucSDv+GOY/fs=; b=AkljVgjeVkb3b+Q3GFDXhYLRyf8R9zQic3L9DcVBhZiicJyhwtyaIb86Uf2qvAIuOi 4NMTgpY0ZglofOQIgsX0IhqAke7EQib+0Qubee+mvLQy/XYoOd2fkMX5tEPmuV45R8pi JceBtFWGSCX2NIN7mhlCQTCc0PlsvuAhI3YtyPChgHMIKH9y8iPWhX8xfPrlmSjzB63x 7NXlQPnQkNTE9LlyuFcUiyfor2k5Am1KvmAVSRnxG/3UF5PBaIgwXax6SwNSUUeEZLzz AhzRTHjgLO6BxI1yMhvyLkPKfV0Aj6NrM8AOPydD7+RodizA+7OWQtIrbxjCGuvftf/j wd5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700223898; x=1700828698; 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=YsnMnx3qJnhyBXB1udD6ESspWS/fknMucSDv+GOY/fs=; b=Q/eldrAhPY+7UNxlX08kv0gkEwlgmaU7i15Gd76x5JKpgdvANW7h//QJpteja75wvk HCllShncAYi8EMpcPTmGni89Xl0Yyz+LduHc6n/qXTTUj9gPm8Ctp0Kx8g2PZCDiZ1Vu j3hkeFIpFEiJi/EzvYZtmqMKs4DKLi9y8pCcspoyA0BwoYs++Rf9k7CJ5XnU849Lc42E QJq3bDgSMdlCwnxZXTPW511Q+bruOaRkC+NqeEGi0pazULVy9ctv9CclaNgWX+gkSVHi U30Q0ebslE4Oul2/MEZ52SfVy5DHodDa2cB/aQGO93Dfd2iIOsL60RRdY9tqX5On5IF6 Hk9Q== X-Gm-Message-State: AOJu0Yy6rDb2Cu1xVhOjBA3FP3LO5uEQJqJ5JVQD0FLKrJf3y5GfZZdq 2CAiG91OHyztUc/32pjsWz6prBz8ylI= X-Google-Smtp-Source: AGHT+IEwrI59ykOOh0OZRtckIxEPSenLZxQMITCBvRfEyqfF1KwNUKBBo1VkLPcpX+iCMbo0xi1mKg== X-Received: by 2002:a05:6512:94e:b0:509:1227:ca71 with SMTP id u14-20020a056512094e00b005091227ca71mr11881967lft.17.1700223898553; Fri, 17 Nov 2023 04:24:58 -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 v3 11/14] xen/asm-generic: introduce stub header numa.h Date: Fri, 17 Nov 2023 14:24:35 +0200 Message-ID: <7ae3b2dbdb8e711b2462af511e1f64c2700113d7.1700221559.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 is common through some archs so it is moved to asm-generic. Signed-off-by: Oleksii Kurochko 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 => include/asm-generic}/numa.h | 13 ++++++---- 4 files changed, 10 insertions(+), 31 deletions(-) delete mode 100644 xen/arch/ppc/include/asm/numa.h rename xen/{arch/arm/include/asm => include/asm-generic}/numa.h (75%) diff --git a/xen/arch/arm/include/asm/Makefile b/xen/arch/arm/include/asm/Makefile index 8221429c2c..0c855a798a 100644 --- a/xen/arch/arm/include/asm/Makefile +++ b/xen/arch/arm/include/asm/Makefile @@ -2,6 +2,7 @@ generic-y += altp2m.h generic-y += hardirq.h generic-y += iocap.h +generic-y += numa.h generic-y += paging.h generic-y += percpu.h generic-y += random.h diff --git a/xen/arch/ppc/include/asm/Makefile b/xen/arch/ppc/include/asm/Makefile index 9bbae4cec8..d5a94bc718 100644 --- a/xen/arch/ppc/include/asm/Makefile +++ b/xen/arch/ppc/include/asm/Makefile @@ -5,6 +5,7 @@ generic-y += hardirq.h generic-y += hypercall.h generic-y += iocap.h generic-y += monitor.h +generic-y += numa.h generic-y += paging.h generic-y += percpu.h generic-y += random.h diff --git a/xen/arch/ppc/include/asm/numa.h b/xen/arch/ppc/include/asm/numa.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 75% rename from xen/arch/arm/include/asm/numa.h rename to xen/include/asm-generic/numa.h index e2bee2bd82..c5b522dee8 100644 --- a/xen/arch/arm/include/asm/numa.h +++ b/xen/include/asm-generic/numa.h @@ -1,9 +1,11 @@ -#ifndef __ARCH_ARM_NUMA_H -#define __ARCH_ARM_NUMA_H +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ARCH_GENERIC_NUMA_H +#define __ARCH_GENERIC_NUMA_H -#include +#include +#include -typedef u8 nodeid_t; +typedef uint8_t nodeid_t; #ifndef CONFIG_NUMA @@ -26,7 +28,8 @@ extern mfn_t first_valid_mfn; #define arch_want_default_dmazone() (false) -#endif /* __ARCH_ARM_NUMA_H */ +#endif /* __ARCH_GENERIC_NUMA_H */ + /* * Local variables: * mode: C From patchwork Fri Nov 17 12:24:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksii Kurochko X-Patchwork-Id: 13458920 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F232CC47071 for ; Fri, 17 Nov 2023 12:25:19 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.635122.990966 (Exim 4.92) (envelope-from ) id 1r3xuB-0003e2-08; Fri, 17 Nov 2023 12:25:03 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 635122.990966; Fri, 17 Nov 2023 12:25:02 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r3xuA-0003by-J6; Fri, 17 Nov 2023 12:25:02 +0000 Received: by outflank-mailman (input) for mailman id 635122; Fri, 17 Nov 2023 12:25:01 +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 1r3xu9-0000ZQ-5s for xen-devel@lists.xenproject.org; Fri, 17 Nov 2023 12:25:01 +0000 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [2a00:1450:4864:20::12a]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 53c9b3de-8544-11ee-98dc-6d05b1d4d9a1; Fri, 17 Nov 2023 13:25:00 +0100 (CET) Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-5099184f8a3so2802956e87.2 for ; Fri, 17 Nov 2023 04:25:00 -0800 (PST) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id a18-20020ac25e72000000b005094d95e8bcsm209811lfr.218.2023.11.17.04.24.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 04:24:59 -0800 (PST) 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: 53c9b3de-8544-11ee-98dc-6d05b1d4d9a1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700223900; x=1700828700; 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=QonSCuwrPbZ3BVwuT3NYP06ZPrDraLB08reCatd0+0o=; b=f1Ep8rIcvbGcb9Fjj970a1jKtLJac5VoyeQTx8bGV0k+BT+wD0GXFAomeMJ8GZs2sM Nzr9WLnTvxF05z3G29Q5il3ctdivpNhXtbsjxfLl9uPv9Zr9fNTst8sCnxCoZDXn7hyQ ZekWHYaRdEPn2zQwwybI++A2DOOcfgO2+OOlkwoKprIJ92FOXLsTFETEjyDOjwlemUAw SNUDN1bXxBd2bVwFxeyH47Yktni/6e7CpV7Rf4kv7ZemMNpKvp5xqFP0Frub6ttKni2D xp/HrW/Z4RSK+O0itcevW05K70FC0d1nBAe7KggTjsytODMOMwH9tT7ax9AlSyd0abwM NrHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700223900; x=1700828700; 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=QonSCuwrPbZ3BVwuT3NYP06ZPrDraLB08reCatd0+0o=; b=njRtpVYBNuvdisYFxfFB2cO0V/zHj2E/VVW9XHQJGenhot+xJM+6/bc+JRnyyd2kh9 6X83DA6AmXl9C5HFIX4dCyTMpo+N7l/vA3ssSyH6yf+dovbZPng8heebyXCcWlQeht9e gWgpUzNSlGsqe0TH6PU65Itxk058dsiF9BKFyTVIZrUrWrM9DrCuoX1r2MtgnoHbpptJ U1WRcWn56Ca7bjh7zNNKnFBalPyApyW9YQakWQGfBaArq/6FF6yhJB36O9qLA/aFqQYx ZLkuVFFhRwz/xougQ2wldC9ZymM5XFwpxfTQvAWEK0sL+L01Rr4RmxAbrtecd4geoBXT ZqVA== X-Gm-Message-State: AOJu0YxgxPNgDpixrLyvC0DwWtOPDTkDTASMcxvb0IR9u2oumZhW3S+a ziiyn0Ua4Zgxu+FmeiNtXgGS4Z6x5xk= X-Google-Smtp-Source: AGHT+IHaKfR3Y7LwzJZtrA7bo685nqeXeJgJYC6v47j0WKICBp9bTY3uHYYadaEnYydLC2spdIQiVQ== X-Received: by 2002:a05:6512:2382:b0:509:1368:ddc1 with SMTP id c2-20020a056512238200b005091368ddc1mr18620572lfv.53.1700223899936; Fri, 17 Nov 2023 04:24:59 -0800 (PST) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk , Shawn Anastasio Subject: [PATCH v3 12/14] xen/asm-generic: introduce stub header softirq.h Date: Fri, 17 Nov 2023 14:24:36 +0200 Message-ID: <8b1969350a4f05758969058d47ac3ec10d80db50.1700221559.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 is common between Arm, PPC and RISC-V so it is moved to asm-generic. Signed-off-by: Oleksii Kurochko Reviewed-by: Michal Orzel 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 => 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 => include/asm-generic}/softirq.h (56%) diff --git a/xen/arch/arm/include/asm/Makefile b/xen/arch/arm/include/asm/Makefile index 0c855a798a..a28cc5d1b1 100644 --- a/xen/arch/arm/include/asm/Makefile +++ b/xen/arch/arm/include/asm/Makefile @@ -6,4 +6,5 @@ generic-y += numa.h generic-y += paging.h generic-y += percpu.h generic-y += random.h +generic-y += softirq.h generic-y += vm_event.h diff --git a/xen/arch/ppc/include/asm/Makefile b/xen/arch/ppc/include/asm/Makefile index d5a94bc718..a3f44baa34 100644 --- a/xen/arch/ppc/include/asm/Makefile +++ b/xen/arch/ppc/include/asm/Makefile @@ -9,4 +9,5 @@ generic-y += numa.h generic-y += paging.h generic-y += percpu.h generic-y += random.h +generic-y += softirq.h generic-y += 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/softirq.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__ #define NR_ARCH_SOFTIRQS 0 #define arch_skip_send_event_check(cpu) 0 -#endif /* __ASM_SOFTIRQ_H__ */ +#endif /* __ASM_GENERIC_SOFTIRQ_H__ */ /* * Local variables: * mode: C From patchwork Fri Nov 17 12:24:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksii Kurochko X-Patchwork-Id: 13458918 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0B538C072A2 for ; Fri, 17 Nov 2023 12:25:15 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.635123.990977 (Exim 4.92) (envelope-from ) id 1r3xuD-00046S-4e; Fri, 17 Nov 2023 12:25:05 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 635123.990977; Fri, 17 Nov 2023 12:25:05 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r3xuC-00044W-L9; Fri, 17 Nov 2023 12:25:04 +0000 Received: by outflank-mailman (input) for mailman id 635123; Fri, 17 Nov 2023 12:25:03 +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 1r3xuA-0000ZQ-M4 for xen-devel@lists.xenproject.org; Fri, 17 Nov 2023 12:25:02 +0000 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [2a00:1450:4864:20::135]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 54bf2552-8544-11ee-98dc-6d05b1d4d9a1; Fri, 17 Nov 2023 13:25:02 +0100 (CET) Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-507cee17b00so2493491e87.2 for ; Fri, 17 Nov 2023 04:25:02 -0800 (PST) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id a18-20020ac25e72000000b005094d95e8bcsm209811lfr.218.2023.11.17.04.25.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 04:25:00 -0800 (PST) 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: 54bf2552-8544-11ee-98dc-6d05b1d4d9a1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700223901; x=1700828701; 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=tJjcySsrWCUTisDHIaY5a1c2SD1fU/bpuLwPL2CuBTA=; b=kVlnbOm77zfqpTI7bhsw7GfxK69nRmBl5XSxY1Zdqyw2TXg2Y9pUZ6igHxjqMYz6Ci KCp00FOZHpGA14ImMDUQhz8cJ2lJG0nxee+WMhBOC6ZDjjavbi1GEz1ysRz71MjiwLHO PlMETrbFuWbvX0SPh5vlTf8rVUYd6bHMXUyVWYLggmAlyUzlgTaauGCzvurmmsENmHbn Bc0zS2uR7a0b+EB2DIyJJWFezBDtMn/wrrot3MBSy2BoK04zBpO9vckJbmMBqVrL1fma aQnXXS9TIHgwflC3TrR3tTknuN5vSdQWr/k6MMsZsJ1F6Wybmpblc04E53f13hMQRPH4 a/FQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700223901; x=1700828701; 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=tJjcySsrWCUTisDHIaY5a1c2SD1fU/bpuLwPL2CuBTA=; b=I+b/Sn/dKBaXLVBtwWrPcE6aCg9VGSly+m4d0ASMmPvcMe1myWEJpYCHhB/lJWdMGo 9efFLeC2zB0t0+8y37YNDM02TBICOVtxFo3em7hZejPS84U09gtRQ/N2cICidUyk54ZM 42wKwsoXZgXlTsmPMjdpGtfNLXj1vHzvs1g1aNE0JT30nIUj0kWoL4jVrw6nh2hprrx/ KmWYP+KuqM7nD9otAOq71biXKaAYW4W3XIkeyXwjv5+CjJ2m4AxsBsR+T/GJUBSMnS6X Gi6HoTOgYsYiU6FpZxI6MJ4SxjApUFZmpNAjmPyqsI8nlIsnHEA7yYvYO8wntMDhqYnc rMQw== X-Gm-Message-State: AOJu0YwVa/H1y3OCyyKfJJRRrpXwjAUNdac2M+qDBfmn3TIZGn7a8cDN 9AF7F7rrANyII30NdCnwLM5+hyI6Y5s= X-Google-Smtp-Source: AGHT+IFYxXcNyg3SvVQe/LDOT6dpnjF82/o1CSl8OOCxiVTZeiGHE1uvF5kyLOIQ17nCI2mCCn+XvQ== X-Received: by 2002:a05:6512:1383:b0:50a:9652:31d2 with SMTP id fc3-20020a056512138300b0050a965231d2mr7469171lfb.15.1700223900985; Fri, 17 Nov 2023 04:25:00 -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 v3 13/14] xen: ifdef inclusion of in Date: Fri, 17 Nov 2023 14:24:37 +0200 Message-ID: X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 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 V3: - Remove unnecessary comment. --- xen/arch/arm/domain_build.c | 1 + xen/arch/ppc/include/asm/grant_table.h | 5 ----- xen/include/xen/grant_table.h | 3 +++ 3 files changed, 4 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 2dd2926b41..6e8cc6bbb5 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -34,6 +34,7 @@ #include #include +#include #include #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/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 struct grant_table; From patchwork Fri Nov 17 12:24:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksii Kurochko X-Patchwork-Id: 13458921 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E51C6C072A2 for ; Fri, 17 Nov 2023 12:25:21 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.635125.990984 (Exim 4.92) (envelope-from ) id 1r3xuF-0004T5-0r; Fri, 17 Nov 2023 12:25:07 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 635125.990984; Fri, 17 Nov 2023 12:25:06 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r3xuE-0004R6-JI; Fri, 17 Nov 2023 12:25:06 +0000 Received: by outflank-mailman (input) for mailman id 635125; Fri, 17 Nov 2023 12:25:05 +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 1r3xuC-0000iK-Mu for xen-devel@lists.xenproject.org; Fri, 17 Nov 2023 12:25:04 +0000 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [2a00:1450:4864:20::12c]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 55588d98-8544-11ee-9b0e-b553b5be7939; Fri, 17 Nov 2023 13:25:03 +0100 (CET) Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-50a6ff9881fso2809283e87.1 for ; Fri, 17 Nov 2023 04:25:03 -0800 (PST) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id a18-20020ac25e72000000b005094d95e8bcsm209811lfr.218.2023.11.17.04.25.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 04:25:01 -0800 (PST) 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: 55588d98-8544-11ee-9b0e-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700223902; x=1700828702; 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=MGLHKG6to9Zisdv7aexs3y4v8t2ouBEO3ihJtRG23GQ=; b=Jt9XqxXfzI8nlqOL2J8CC6cYViSQpwxIq45We/fVKF97fG7P4H/M+R+S0yB6y5bySE BvvhI6NRo6KgpcsJ/2jBvLQCR09Rh0gljK3da6RdGk6X3AMLgnEoLBtYRyHGtwwMfb6F pEX3XEVqa297B2lGcvM+PGcF3AVWDAHrn2WwuuRnbbJxGTRFQTPr4vhr0rodFJ7aLLEp i7MgeLvJCM+mIZhYvMi2I1kjN6UfTdbFqZDrCaoPmRECDCXrKJ6sA3ceuUKqJS/XOYN7 Lom29jfkK1z7Bzi74XqKMWv9xYzJN+uOazu63rbiEQSjs1WOrdyMr/A47IgaQknHZC47 f1Kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700223902; x=1700828702; 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=MGLHKG6to9Zisdv7aexs3y4v8t2ouBEO3ihJtRG23GQ=; b=YZFKc/ypUcIFIjVZKFnKUZO+UBDdURcoujd0d/48Pbx2LMYsdHinUbMzkr9H5qT3Vl O1DmgmKB6EcUmTiV+vvubiFF+fT6BJ05aBAr2KnAtFXL/7e3IwK+IL6aryay83f/5TBY yPYyt3H2M22cxI/oTTFy2ht3I1K7N8KYN0UkHiT/B7knyPwXIWZT4FBGGRxbwlr27M5j GqWFhPGXJQGxodcf/sUaPPvx2Svku/5s3WKHl5/ar3Y6LEj7LGwe2gpJjTCF9H2kM3LC rJ4ZxPFDEaIEHBjbz4/VdFb4ATmzTl4ivKvLlT0cCYNF2uk5goS3FHqPz84IzOHzTsvX l/0g== X-Gm-Message-State: AOJu0YzR6HdmLX9j1j68T40Gjj2Mz9O8w4LbxM+10btZHV1PqzH2ZVeZ Ifo/MrA3CgauCo1s5RIcNB+0os6nMqg= X-Google-Smtp-Source: AGHT+IFjh6wlNjIdIr5T/LlRtXMPbxEloY6iPAfFEpgECpLHz6O4PtpUnBRcyd5hbT261qKOY6VhOw== X-Received: by 2002:a19:8c10:0:b0:50a:9652:31d4 with SMTP id o16-20020a198c10000000b0050a965231d4mr6074727lfd.22.1700223902364; Fri, 17 Nov 2023 04:25:02 -0800 (PST) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk , Tamas K Lengyel , Alexandru Isaila , Petre Pircalabu , Shawn Anastasio , Jan Beulich Subject: [PATCH v3 14/14] xen/asm-generic: ifdef inclusion of Date: Fri, 17 Nov 2023 14:24:38 +0200 Message-ID: <12178d67c5e711723bfda55b3f79287f18231282.1700221559.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 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 which aren't available in case of !CONFIG_MEM_ACCESS. Suggested-by: Jan Beulich Signed-off-by: Oleksii Kurochko --- 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/include/xen/mem_access.h | 2 ++ 4 files changed, 4 insertions(+), 5 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 de32a2d638..b6ea4480a0 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c index ce89f16404..b720b49dd2 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/asm/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/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; +#ifdef CONFIG_MEM_ACCESS #include +#endif /* * Additional access types, which are used to further restrict