From nobody Thu May 9 04:34:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1708087195; cv=none; d=zohomail.com; s=zohoarc; b=KqP/WZQTkwwGaeobnOwNa9qj3WsWfthY8fAFIhphXmG7c8L1w5q5Z43E1WF3tBSe0P5xzilhIPkR9SFBmc0puJzmw3RnESCpKNhup2nQgUZvRh5gHDRpBBJKFHTkxAMC3q3p0awd3GJt+kxxVgz9GX1QryUsR8j9xplwgaWK4Mw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1708087195; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=2suBialpU5BjJzL1fdKyYOY1IMWl7vfTqJIHrpvRUSg=; b=ety0R4EV/PVcCiUBydTYCoB+fexPzxeBOaPke5Bfd9Ltp8sqUBwLRl7xCNwf2k/aArqQU0HJHmzMw8psTTmHGXt2vTNjXmLpm/hLELPUB1Pd2Z7ulQxQvg8ciGeKtw+rlzkjzpc1pC9+OYjf70ehfiA9VsxsBrnQ/97oaa0PDvY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1708087195266355.7943170540357; Fri, 16 Feb 2024 04:39:55 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.682187.1061277 (Exim 4.92) (envelope-from ) id 1raxV2-0006s2-JL; Fri, 16 Feb 2024 12:39:28 +0000 Received: by outflank-mailman (output) from mailman id 682187.1061277; Fri, 16 Feb 2024 12:39:28 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1raxV2-0006qU-Cn; Fri, 16 Feb 2024 12:39:28 +0000 Received: by outflank-mailman (input) for mailman id 682187; Fri, 16 Feb 2024 12:39:28 +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 1raxV2-0006oP-40 for xen-devel@lists.xenproject.org; Fri, 16 Feb 2024 12:39:28 +0000 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [2a00:1450:4864:20::635]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 6b26746a-ccc8-11ee-98f5-efadbce2ee36; Fri, 16 Feb 2024 13:39:26 +0100 (CET) Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-a3d159220c7so98507866b.2 for ; Fri, 16 Feb 2024 04:39:25 -0800 (PST) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id lj8-20020a170907188800b00a3db1734b92sm1121608ejc.43.2024.02.16.04.39.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 04:39:24 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 6b26746a-ccc8-11ee-98f5-efadbce2ee36 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708087164; x=1708691964; 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=2suBialpU5BjJzL1fdKyYOY1IMWl7vfTqJIHrpvRUSg=; b=kywOSd+l4VGNdqU+kApN/F421auBEquX1WyElNedeKBax9VippHO0XkPqQeSDc/nOa AoasIQxYca6GmAqgoHS8IIxwYPhePbpyDstrxQ9rUPMx05STAFrzCDc7rnYouIpkDpI9 sqaSC3iJXZatqeYGtOgkD+NCB5pweAtpy9872iz6uEo8xPqO1ajGJlYIZIj7pN7/n3F7 qgJTbspeVi5jct3Rf4Hk0/G0GrHPsgR/fyjS02QiUXMAb74L2gyzUBmFEzgfAqCiBk9c umbUmVh8rg4ywEoz+7+GPbzhZoOyu+ekSbP11V5S6kapj0IrOzwfru5F0/8jCD3M6FrT cEPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708087164; x=1708691964; 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=2suBialpU5BjJzL1fdKyYOY1IMWl7vfTqJIHrpvRUSg=; b=LXdJcDOQntXxfcQsg/V1qhhNlXZI+udy0CdsuAECO2MsrbNfmpLQa1fyRp2ZK4VegZ cIevqZrZeYYw3r23l4/GwtN0wRVHGWGCpR7ukEzX78sjnnxgXELZT+3WlXYotajACyQO d9BNvJz+IQZipucKu2xjS68KXJlIZzsUM/kl4TG7RQT/u+IEHW1ZdzdFQ8PfJacwJb92 chjLOvvWOjM4cTjTwBIcikGI3LG2VnsmhCLikOJrYqA3RUrrS0t7Ke+wXMUgun1Wv9t+ exEWrmEgUSYwiRmGaol16VuQbmvTGQh0Z/XAxyGouzXGTxuMhA3kzLJXYoqWubWfuVAw rJGA== X-Gm-Message-State: AOJu0YxMOYsB5dMCcLZoTNeiDOE89ZLmEKoM05qq7C6TD+rCehq1hGEj zpskEcB6rvdqpSTz+QqPwRwciOjogSHs7cKk/Hs71QPcK1XQwZamOnbFooZj X-Google-Smtp-Source: AGHT+IF+gJdo062UNYdwzzpd3f0cRJp8HoZz6cESOee4FvYvkdZq8KaInyjt7Ehjy6GZCWBEY2tQ+g== X-Received: by 2002:a17:906:3e09:b0:a3d:1cdf:19eb with SMTP id k9-20020a1709063e0900b00a3d1cdf19ebmr3361862eji.11.1708087164440; Fri, 16 Feb 2024 04:39:24 -0800 (PST) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , Doug Goldstein , Stefano Stabellini , Michal Orzel Subject: [PATCH v9 1/7] automation: introduce fixed randconfig for RISC-V Date: Fri, 16 Feb 2024 13:39:13 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1708087196880100003 Content-Type: text/plain; charset="utf-8" This patch introduces the anchor riscv-fixed-randconfig, which includes all configurations that should be disabled for randconfig builds. Suggested-by: Stefano Stabellini Signed-off-by: Oleksii Kurochko Acked-by: Stefano Stabellini Reviewed-by: Michal Orzel --- The patch were introduced after discussion in a topic: https://lore.kernel.org/xen-devel/cover.1701966261.git.oleksii.kurochko@gm= ail.com/ --- Changes in V9: - add '|' symbol after EXTRA_FIXED_RANDCONFIG to make variables in EXTRA_F= IXED_RANDCONFIG be separated by new line. - instead of introduction of new file for riscv-fixed-randconfig, introduc= e an anchor inside build.yaml --- Changes in V8: - Nothing changed. Only rebase --- Changes in V7: - Nothing changed. Only rebase --- Changes in V6: - The patch was introduced in this version of patch series. --- automation/gitlab-ci/build.yaml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.y= aml index 6d2cb18b88..aac29ee13a 100644 --- a/automation/gitlab-ci/build.yaml +++ b/automation/gitlab-ci/build.yaml @@ -512,6 +512,14 @@ alpine-3.18-gcc-debug-arm64-boot-cpupools: CONFIG_BOOT_TIME_CPUPOOLS=3Dy =20 # RISC-V 64 cross-build +.riscv-fixed-randconfig: + variables: &riscv-fixed-randconfig + EXTRA_FIXED_RANDCONFIG: | + CONFIG_COVERAGE=3Dn + CONFIG_EXPERT=3Dy + CONFIG_GRANT_TABLE=3Dn + CONFIG_MEM_ACCESS=3Dn + archlinux-current-gcc-riscv64: extends: .gcc-riscv64-cross-build variables: @@ -532,8 +540,7 @@ archlinux-current-gcc-riscv64-randconfig: CONTAINER: archlinux:current-riscv64 KBUILD_DEFCONFIG: tiny64_defconfig RANDCONFIG: y - EXTRA_FIXED_RANDCONFIG: - CONFIG_COVERAGE=3Dn + <<: *riscv-fixed-randconfig =20 archlinux-current-gcc-riscv64-debug-randconfig: extends: .gcc-riscv64-cross-build-debug @@ -541,8 +548,7 @@ archlinux-current-gcc-riscv64-debug-randconfig: CONTAINER: archlinux:current-riscv64 KBUILD_DEFCONFIG: tiny64_defconfig RANDCONFIG: y - EXTRA_FIXED_RANDCONFIG: - CONFIG_COVERAGE=3Dn + <<: *riscv-fixed-randconfig =20 # Power cross-build debian-bullseye-gcc-ppc64le: --=20 2.43.0 From nobody Thu May 9 04:34:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1708087202; cv=none; d=zohomail.com; s=zohoarc; b=CGi41RvhW1X+DNgREnO2wnICRKxBMatEvItGrgDws9RhN/uVyJvZAHcaKxM0bZvdk+joerA9N1Rk4hmr4pRhTmKbzrfVanCCHpVV2JaGig04AqNVAgNIz/r116HAxRCDKGliO0iltOuFZY4MW9RWye2FCsQ+sXjyk5c67Zdypi4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1708087202; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ThFYlqJK5oTZpY8W/cIg7Lb/8W/p8jm22dHZpYH2e2M=; b=TJ6tmCzZF7AkTAv/g5DWdBv5qnireQ6KOVUexcHNIacvvNoCvewALAwPT5+AJJFxshu+hJJtO8ysTD6yU5owv9MNpn4iWgSdRBl91NfeSRn8zlHqXFyw7Ho95sorbhnHugtixjwyNvUMXemxw3Rmd+djR3lqSa61tE2o7nOV4Ys= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1708087202763666.2576505154257; Fri, 16 Feb 2024 04:40:02 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.682189.1061296 (Exim 4.92) (envelope-from ) id 1raxV4-0007K4-2X; Fri, 16 Feb 2024 12:39:30 +0000 Received: by outflank-mailman (output) from mailman id 682189.1061296; Fri, 16 Feb 2024 12:39:30 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1raxV3-0007JU-SG; Fri, 16 Feb 2024 12:39:29 +0000 Received: by outflank-mailman (input) for mailman id 682189; Fri, 16 Feb 2024 12:39:29 +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 1raxV3-0006oP-5c for xen-devel@lists.xenproject.org; Fri, 16 Feb 2024 12:39:29 +0000 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [2a00:1450:4864:20::536]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 6c0f7a5b-ccc8-11ee-98f5-efadbce2ee36; Fri, 16 Feb 2024 13:39:27 +0100 (CET) Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-563c2b2bddbso1917233a12.1 for ; Fri, 16 Feb 2024 04:39:27 -0800 (PST) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id lj8-20020a170907188800b00a3db1734b92sm1121608ejc.43.2024.02.16.04.39.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 04:39:25 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 6c0f7a5b-ccc8-11ee-98f5-efadbce2ee36 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708087166; x=1708691966; 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=ThFYlqJK5oTZpY8W/cIg7Lb/8W/p8jm22dHZpYH2e2M=; b=g18ZyPL6DZGbI1XbJJ/pOsMnhC1qgil3AsgbM/i+4rUhJaEanKRMTbA8rjSXXtiZcq CkHzb7elCmt0CWRy6QgtDBiMF9ygwwg+10iEaY06w3EbzFQT1Fg43suOB3hyykQrD3Yd OT8n37upIIdCEbcPXEizjOFE6xJ0A58JHtevqDsBm+ocz88tHrCQaJPr5296Hu7fM9JK gHnhNr1Z2qAblPRGcGsRnNem8FnWmKeoOvH43N7MYdmraMQoH5vWWkyyljTKwZTDNu39 ujYbk/oJOlnt0GRDnDfNwtgFMFfJNHOwiIZ6jsVMU459xqcl6X87G+QqxCwEMSD99Wsq YokQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708087166; x=1708691966; 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=ThFYlqJK5oTZpY8W/cIg7Lb/8W/p8jm22dHZpYH2e2M=; b=UvwUxUpFbLj/LrwE8tChBF4fzapf30xVhL4YeICQgcyJZVNO0kNOWnw+ZufYt0cs8f 6i9mM0w1T1m9iUiVy1kiwv+s5RHiqfdWRgQCh5Ky5CS9w2OdnfiMhJIOoi5AWeHwFFy1 2dzIAFfDmpI/KruXEpwtSKOjYShiO0kzX0RmuSUCN7jsHgQGQYgkNxGfXVtzt5VcrjHR sSpXdS3wBA5xtVkQuTQpw9R5Mf8ShKKJY3WEOnrwCMKU4yqoEp6/KBrJxczvnVhVwXiy coSj3nYaB/CCgq1y7PH2wVlOcAxzqfR4AG26IGXIGRt2r8lvyJkYY0QRYbK62bdPcgHu /fZw== X-Gm-Message-State: AOJu0Ywd4nNW5BEXow7QsbJTKOrz2hdDhVEcpWUniau5MufleAFCOVH6 V8edHqRl/7tTEZeJlcn0veCXWT1E0rsL9HDHQ/kIQGjkxe5DA+zkkITFrYf3 X-Google-Smtp-Source: AGHT+IFgq4auslyaCnWeuNKH+MtZ4S5D0tRHphnqTMD5UeBYjyISJtyIhIEUjTq7mMP+mc7a+GeRGA== X-Received: by 2002:a17:906:2b09:b0:a3d:6592:a72 with SMTP id a9-20020a1709062b0900b00a3d65920a72mr3093778ejg.8.1708087166161; Fri, 16 Feb 2024 04:39:26 -0800 (PST) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , Tamas K Lengyel , Alexandru Isaila , Petre Pircalabu , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk , Shawn Anastasio , Jan Beulich , Julien Grall Subject: [PATCH v9 2/7] xen/asm-generic: introduce stub header monitor.h Date: Fri, 16 Feb 2024 13:39:14 +0100 Message-ID: <296530c13b8400f6872d4afc8cc14e2fcfc7a2d5.1708086092.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1708087204850100001 Content-Type: text/plain; charset="utf-8" The header is shared between several archs so it is moved to asm-generic. Switch partly Arm and PPC to asm-generic/monitor.h and only arch_monitor_get_capabilities() left in arch-specific/monitor.h. Signed-off-by: Oleksii Kurochko Acked-by: Jan Beulich Acked-by: Tamas K Lengyel Acked-by: Julien Grall Acked-by: Shawn Anastasio --- Changes in V9: - Add Acked-by: Julien Grall for Arm part --- Changes in V8: - Add Acked-by: Tamas K Lengyel --- Changes in V7: - Drop definition of arch_monitor_domctl_event for PPC. - define arch_monitor_domctl_event in asm-generic/monitor.h. - add "define HAS_ARCH_MONITOR_DOMCTL_EVENT" in arm/.../monitor.h as it ha= s arch specific implementation. --- Changes in V6: - Rebase only. --- Changes in V5: - Switched partly Arm and PPC to asm-generic monitor.h only arch_monitor_get_capabilities() left in arch-specific/monitor.h. - Updated the commit message. --- Changes in V4: - Removed the double blank line. - Added Acked-by: Jan Beulich . - Update the commit message --- Changes in V3: - Use forward-declaration of struct domain instead of " #include ". - Add ' include ' - Drop PPC's monitor.h. --- Changes in V2: - remove inclusion of "+#include " - add "struct xen_domctl_monitor_op;" - remove one of SPDX tags. --- xen/arch/arm/include/asm/monitor.h | 25 +----------- xen/arch/ppc/include/asm/monitor.h | 28 +------------ xen/arch/ppc/stubs.c | 8 ---- xen/include/asm-generic/monitor.h | 64 ++++++++++++++++++++++++++++++ 4 files changed, 67 insertions(+), 58 deletions(-) create mode 100644 xen/include/asm-generic/monitor.h diff --git a/xen/arch/arm/include/asm/monitor.h b/xen/arch/arm/include/asm/= monitor.h index 7567be66bd..77a3c1a36c 100644 --- a/xen/arch/arm/include/asm/monitor.h +++ b/xen/arch/arm/include/asm/monitor.h @@ -25,34 +25,13 @@ #include #include =20 -static inline -void arch_monitor_allow_userspace(struct domain *d, bool allow_userspace) -{ -} +#define HAS_ARCH_MONITOR_DOMCTL_EVENT =20 -static inline -int arch_monitor_domctl_op(struct domain *d, struct xen_domctl_monitor_op = *mop) -{ - /* No arch-specific monitor ops on ARM. */ - return -EOPNOTSUPP; -} +#include =20 int arch_monitor_domctl_event(struct domain *d, struct xen_domctl_monitor_op *mop); =20 -static inline -int arch_monitor_init_domain(struct domain *d) -{ - /* No arch-specific domain initialization on ARM. */ - return 0; -} - -static inline -void arch_monitor_cleanup_domain(struct domain *d) -{ - /* No arch-specific domain cleanup on ARM. */ -} - static inline uint32_t arch_monitor_get_capabilities(struct domain *d) { uint32_t capabilities =3D 0; diff --git a/xen/arch/ppc/include/asm/monitor.h b/xen/arch/ppc/include/asm/= monitor.h index e5b0282bf1..89000dacc6 100644 --- a/xen/arch/ppc/include/asm/monitor.h +++ b/xen/arch/ppc/include/asm/monitor.h @@ -6,33 +6,7 @@ #include #include =20 -static inline -void arch_monitor_allow_userspace(struct domain *d, bool allow_userspace) -{ -} - -static inline -int arch_monitor_domctl_op(struct domain *d, struct xen_domctl_monitor_op = *mop) -{ - /* No arch-specific monitor ops on PPC. */ - return -EOPNOTSUPP; -} - -int arch_monitor_domctl_event(struct domain *d, - struct xen_domctl_monitor_op *mop); - -static inline -int arch_monitor_init_domain(struct domain *d) -{ - /* No arch-specific domain initialization on PPC. */ - return 0; -} - -static inline -void arch_monitor_cleanup_domain(struct domain *d) -{ - /* No arch-specific domain cleanup on PPC. */ -} +#include =20 static inline uint32_t arch_monitor_get_capabilities(struct domain *d) { diff --git a/xen/arch/ppc/stubs.c b/xen/arch/ppc/stubs.c index a96e45626d..da193839bd 100644 --- a/xen/arch/ppc/stubs.c +++ b/xen/arch/ppc/stubs.c @@ -95,14 +95,6 @@ void arch_get_domain_info(const struct domain *d, BUG_ON("unimplemented"); } =20 -/* monitor.c */ - -int arch_monitor_domctl_event(struct domain *d, - struct xen_domctl_monitor_op *mop) -{ - BUG_ON("unimplemented"); -} - /* smp.c */ =20 void arch_flush_tlb_mask(const cpumask_t *mask) diff --git a/xen/include/asm-generic/monitor.h b/xen/include/asm-generic/mo= nitor.h new file mode 100644 index 0000000000..1ade289099 --- /dev/null +++ b/xen/include/asm-generic/monitor.h @@ -0,0 +1,64 @@ +/* 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 +#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; +} + +#ifndef HAS_ARCH_MONITOR_DOMCTL_EVENT +static inline +int arch_monitor_domctl_event(struct domain *d, + struct xen_domctl_monitor_op *mop) +{ + BUG_ON("unimplemented"); +} +#endif + +static inline +int arch_monitor_init_domain(struct domain *d) +{ + /* No arch-specific domain initialization on GENERIC. */ + return 0; +} + +static inline +void arch_monitor_cleanup_domain(struct domain *d) +{ + /* No arch-specific domain cleanup on GENERIC. */ +} + +#endif /* __ASM_GENERIC_MONITOR_H__ */ + +/* + * Local variables: + * mode: C + * c-file-style: BSD + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ --=20 2.43.0 From nobody Thu May 9 04:34:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1708087197; cv=none; d=zohomail.com; s=zohoarc; b=dib1f93g53XBcTzf+wR/mTIDaUAU2CWtLXj3gut36yHM5pKSKkavXRxM/VqB5z6yb/SawiQjZf+ore5I1L2IHO2AxCO5DtKLumAjl/CYGnA8kHkOPt/f0gQlii2nZ94tnHtA1+ClJ0P3ZRC5LF2Tuj/UUa+no7VN7q/nexCRiuU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1708087197; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=r9oJ766LbpEcU1AnuyDzWxkmbkR4vj0ev3jWEPdVTr0=; b=hhNFi8TfYu3zWqULub55PlJynm0JoMfUFWjVL/IMoyVXYNP2N5Jz8FlVWxO4qnUQyJPh3a2eZ7QV3BNYVr7WtgbwVO/9BHUGoIhlVMYis0g9SY+7SaKaa9enpVMI0JVz8WLOI1F267asSUc+uhJc1RpU11A4nnqaBvRQUr9TNDY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1708087197894524.5945429838462; Fri, 16 Feb 2024 04:39:57 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.682188.1061290 (Exim 4.92) (envelope-from ) id 1raxV3-0007Hz-OL; Fri, 16 Feb 2024 12:39:29 +0000 Received: by outflank-mailman (output) from mailman id 682188.1061290; Fri, 16 Feb 2024 12:39:29 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1raxV3-0007Hs-La; Fri, 16 Feb 2024 12:39:29 +0000 Received: by outflank-mailman (input) for mailman id 682188; Fri, 16 Feb 2024 12:39:28 +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 1raxV2-0006oJ-Rv for xen-devel@lists.xenproject.org; Fri, 16 Feb 2024 12:39:28 +0000 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [2a00:1450:4864:20::62e]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 6c9484dc-ccc8-11ee-8a4f-1f161083a0e0; Fri, 16 Feb 2024 13:39:28 +0100 (CET) Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-a3d159220c7so98511866b.2 for ; Fri, 16 Feb 2024 04:39:28 -0800 (PST) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id lj8-20020a170907188800b00a3db1734b92sm1121608ejc.43.2024.02.16.04.39.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 04:39:27 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 6c9484dc-ccc8-11ee-8a4f-1f161083a0e0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708087167; x=1708691967; 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=r9oJ766LbpEcU1AnuyDzWxkmbkR4vj0ev3jWEPdVTr0=; b=T6AbBBqzW/PkbkoMPR8SFC82svWHO2/Y+EYjo3vVDMzknTETV7wMcY4Xw2gbxL+9Ew XVmA2qKPCd+E0jqkjyg05l0mSVl7+/yt+bZrcfI+viAcelxtgNEHd7qAZjBdn/pYp1bW T2NSPhQtOMAr8TuShDeFjxRQ8/f5VcCtIdo1U8Dd2sbYW75v2reB3U5WtYm6uw/sOd6T y1XZiOHKkI4s6wgcEcoKTmKCVYrT0RqTM1KCvHaAoIektZVWSirOfXeOxgAeLorIHaZW wWwEmMZ02e6Gsi6MUMwRaeaIZfeejzvAP/miCXwI7GJB95dLF8f2hZ/hwn8dCGPz0Dz7 0KpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708087167; x=1708691967; 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=r9oJ766LbpEcU1AnuyDzWxkmbkR4vj0ev3jWEPdVTr0=; b=w7fqXimy4hKSUeecbzJZBNWgqvLN2RK72fxYNlOEgfmp6hANPhwcBWneu0h8u4Zigv 8ILWsx+JD/09++RaXjmI4CMi8HiFpNuXFdVPlqsA4v9G6gYEJXt2GdMBzq/2bjVgE6j3 wvsTwoRZlBcbmooaFU2ea98O0+iMArPfGby7gs3hiK2Op+L9D0LXWo0qFP2fh9QBeuzA 8l6LVvL/FCJcTRgDK02hWosYKBHTZFZtUX3wiaJNFfwzDC6CtLb83cFzXgfDl7U0RQyP Y1EAsZYplilOSLYeBR3g3G82arrF3xDLGRT4klo+9GdEzop6V+IUOlUlkOPvdd3F/Igu mb7g== X-Gm-Message-State: AOJu0Yysxa7Uk62yVqWTx9sbzMpFcfbNPPaBf0cPcybKyiQ4RiuG+BsR jJrIo4iUJm4R3eJCA3+U+qRLy2bqMZlVoqsLLeMF3ag6RCJrMJSQIM7UBNDw X-Google-Smtp-Source: AGHT+IFCVznff4oPa0Fh9bza1Xg0r9lv4O6Pdop5CWcmfw+tuMLxmqeMJ9Wsk4s405FP8s0ldCM8Ig== X-Received: by 2002:a17:906:4ed0:b0:a3d:fb76:cdf5 with SMTP id i16-20020a1709064ed000b00a3dfb76cdf5mr318024ejv.68.1708087167626; Fri, 16 Feb 2024 04:39:27 -0800 (PST) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk , Shawn Anastasio , Tamas K Lengyel , Alexandru Isaila , Petre Pircalabu , Alistair Francis , Bob Eshleman , Connor Davis , Jan Beulich , Julien Grall Subject: [PATCH v9 3/7] xen/asm-generic: ifdef inclusion of Date: Fri, 16 Feb 2024 13:39:15 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1708087198806100008 Content-Type: text/plain; charset="utf-8" ifdefing inclusion of in allows to avoid generation of empty header for the case when !CONFIG_MEM_ACCESS. For Arm it was explicitly added inclusion of for p2m.c and traps.c because they require some functions from whi= ch aren't available in case of !CONFIG_MEM_ACCESS. Suggested-by: Jan Beulich Signed-off-by: Oleksii Kurochko Acked-by: Tamas K Lengyel Acked-by: Julien Grall Acked-by: Shawn Anastasio --- Changes in V9: - Acked-by: Julien Grall --- Changes in V8: - Add Acked-by: Tamas K Lengyel --- Changes in V7: - Nothing changed. Only rebase --- Changes in V6: - Remove the way how CONFIG_MEM_ACCESS is disabled for PPC and RISC-V. - Disable the config in ppc64_defconfig and tiny64_defconfig (RISC-V). --- Changes in V5: - Added dependencies for "Config MEM_ACCESS" to be sure that randconfig wi= ll not turn on the config. --- Changes in V4: - Nothing changed. Only rebase. --- Changes in V3: - Remove unnecessary comment. --- xen/arch/arm/p2m.c | 1 + xen/arch/arm/traps.c | 1 + xen/arch/ppc/configs/ppc64_defconfig | 1 + xen/arch/ppc/include/asm/mem_access.h | 5 ----- xen/arch/riscv/configs/tiny64_defconfig | 1 + xen/include/xen/mem_access.h | 2 ++ 6 files changed, 6 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 b991b76ce4..2465c266e9 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include =20 diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c index 9c10e8f78c..8ddca643d4 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/configs/ppc64_defconfig b/xen/arch/ppc/configs/pp= c64_defconfig index f7cc075e45..48a053237a 100644 --- a/xen/arch/ppc/configs/ppc64_defconfig +++ b/xen/arch/ppc/configs/ppc64_defconfig @@ -6,6 +6,7 @@ # CONFIG_HYPFS is not set # CONFIG_GRANT_TABLE is not set # CONFIG_SPECULATIVE_HARDEN_ARRAY is not set +# CONFIG_MEM_ACCESS is not set =20 CONFIG_PPC64=3Dy CONFIG_DEBUG=3Dy diff --git a/xen/arch/ppc/include/asm/mem_access.h b/xen/arch/ppc/include/a= sm/mem_access.h deleted file mode 100644 index e7986dfdbd..0000000000 --- a/xen/arch/ppc/include/asm/mem_access.h +++ /dev/null @@ -1,5 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#ifndef __ASM_PPC_MEM_ACCESS_H__ -#define __ASM_PPC_MEM_ACCESS_H__ - -#endif /* __ASM_PPC_MEM_ACCESS_H__ */ diff --git a/xen/arch/riscv/configs/tiny64_defconfig b/xen/arch/riscv/confi= gs/tiny64_defconfig index 3c9a2ff941..09defe236b 100644 --- a/xen/arch/riscv/configs/tiny64_defconfig +++ b/xen/arch/riscv/configs/tiny64_defconfig @@ -6,6 +6,7 @@ # CONFIG_HYPFS is not set # CONFIG_GRANT_TABLE is not set # CONFIG_SPECULATIVE_HARDEN_ARRAY is not set +# CONFIG_MEM_ACCESS is not set =20 CONFIG_RISCV_64=3Dy CONFIG_DEBUG=3Dy diff --git a/xen/include/xen/mem_access.h b/xen/include/xen/mem_access.h index 4e4811680d..87d93b31f6 100644 --- a/xen/include/xen/mem_access.h +++ b/xen/include/xen/mem_access.h @@ -33,7 +33,9 @@ */ struct vm_event_st; =20 +#ifdef CONFIG_MEM_ACCESS #include +#endif =20 /* * Additional access types, which are used to further restrict --=20 2.43.0 From nobody Thu May 9 04:34:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1708087200; cv=none; d=zohomail.com; s=zohoarc; b=YVjo6ZBCiYPFPHagSCZWEmqVU+oYY59oAdE65Nq9KMDJihuAOcvJj4tDnqywmJ2loCIhbWXzlwBQO3JD1ify1l3oAADQeNvbBY/l3tQXSqZ+iwqANrQoAjyrIUGW9ajhNK9xISapMClmdvPXL1UVJGJr/WGhJZA443KWd2m4Zjw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1708087200; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=CLqhOGTUK80zlqCeFoI7si1NHAXYOmuSN6ghjuHIAG8=; b=VqddZiuVV1uuZ9L+xTGAhRIiMtfFbf/+WaKyekfvUoQzsXyiAjX2ygpzVOBxDqQQR4Jj2bHZ/SHKf0fHGFhwBF+zr8/4FH0Rs5V/yYzfdrRYkeAyT31Ov59F9Wo9mVN/LGhcLqXA5FPlmNJF/KZdndzOarXkan7WcU3c5N0rToU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1708087200243875.3507027652707; Fri, 16 Feb 2024 04:40:00 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.682190.1061311 (Exim 4.92) (envelope-from ) id 1raxV6-0007mH-Av; Fri, 16 Feb 2024 12:39:32 +0000 Received: by outflank-mailman (output) from mailman id 682190.1061311; Fri, 16 Feb 2024 12:39:32 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1raxV6-0007m4-76; Fri, 16 Feb 2024 12:39:32 +0000 Received: by outflank-mailman (input) for mailman id 682190; Fri, 16 Feb 2024 12:39:30 +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 1raxV4-0006oJ-KC for xen-devel@lists.xenproject.org; Fri, 16 Feb 2024 12:39:30 +0000 Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [2a00:1450:4864:20::531]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 6d8db062-ccc8-11ee-8a4f-1f161083a0e0; Fri, 16 Feb 2024 13:39:30 +0100 (CET) Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-563d56ee65cso914509a12.2 for ; Fri, 16 Feb 2024 04:39:30 -0800 (PST) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id lj8-20020a170907188800b00a3db1734b92sm1121608ejc.43.2024.02.16.04.39.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 04:39:28 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 6d8db062-ccc8-11ee-8a4f-1f161083a0e0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708087169; x=1708691969; 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=CLqhOGTUK80zlqCeFoI7si1NHAXYOmuSN6ghjuHIAG8=; b=DdLycTm+40w/dq3uMaS6vf1l8cze6yLMu35ZdKDSu3lP9DNs9G4bz0IAFXQxeRew3r MHQGQx28YIvIR8hHwGWhn810bs41rTGLeIKJg/HNW6tKjveooBM61AGu4687aXD8BcFf dAEjNG5CI8OnkGz2Q7mn7OWUV+K+m9xOYVD45eddw2H24cyK6yy06enLxUovCoS6N6v5 FYI6pVPxRr8siG4+q1uXrEl2wqp2XJVjPM92pexCmluLV0pM2sjfYI0lob8XiLyY3rMx aWa8GWR+1Y4fA78WRMBzVew9Q5dRYeZC42+bdH89yZFKF8l5ztLR8vxAFZwD03sD3oJZ uN2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708087169; x=1708691969; 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=CLqhOGTUK80zlqCeFoI7si1NHAXYOmuSN6ghjuHIAG8=; b=RItpEegOJdVX19oFlOXDVxmPvJ4UgNWcysp6nhfVXqNQdnnQHKnc49e0gLHCjQogiK h8x8TRqPCK8shubh4ittU+/glIFw0tVC1XR8F2+YU97eJp32mefM/6+zC1Yv+GecNYDM Fjcmu5igm8ACPZ8w1PBcP1CfKxcZu02adlzbFsbnAWqkT5UVvNHs/4/1KqSf99EKirb4 HBN93MvRl65Khagu3C/7nYjMFtwzn+9wFQVCP3Z9rABsxdZGfKvBn+10HX4xsddZEESq uUvOW2bLgtTyOBOpLYJKOQZZzirpehCXhDXCOAF0LsfqtBePI7D8ehxsf9lepcov3H5O theQ== X-Gm-Message-State: AOJu0Yw8ZLkS3bN8HupkOFWUmnEDiKEfZZlqO7+6gMhTPdILYEMzTY3/ Mahik4YIviaQWkzguYUTXbVwxE3xYhL8e7Ffgoczb7+yX1JhJCy3HqsQ+zEp X-Google-Smtp-Source: AGHT+IHvLiLfCT0H+vGdVFTX1p2sg25x/p7DSf50cigHt5WcaHswwiFLYJLcD94eG7smSK8KHoT8sg== X-Received: by 2002:a17:906:f80e:b0:a3d:eec8:6679 with SMTP id kh14-20020a170906f80e00b00a3deec86679mr810735ejb.54.1708087168577; Fri, 16 Feb 2024 04:39:28 -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 v9 4/7] xen/asm-generic: introduce generic device.h Date: Fri, 16 Feb 2024 13:39:16 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1708087200851100013 Content-Type: text/plain; charset="utf-8" Arm, PPC and RISC-V introduce the same things in asm/device.h, so generic device.h was introduced. Arm's device.h was taken as a base with the following changes: - #ifdef ACPI related things. - Rename #ifdef guards. - Add SPDX tag. - #ifdef CONFIG_HAS_DEVICE_TREE related things. - #ifdef-ing iommu related things with CONFIG_HAS_PASSTHROUGH. Signed-off-by: Oleksii Kurochko Acked-by: Jan Beulich Acked-by: Julien Grall --- Changes in V9: - move 'struct device_desc' to #ifdef CONFIG_HAS_DEVICE_TREE as it is expe= cted to have this structure only in case of CONFIG_HAS_DEVICE_TREE. - rename name_, namestr_, class_ to dev_name, ident and cls in DT_DEVICE_S= TART and ACPI_DEVICE_START macros. - Add Acked-by: Jan Beulich --- Changes in V8: - drop #ifdef HAS_PCI around DEV_PCI in enum device_type to be consistent = with DEVICE_PCI_HOSTBRIDGE - drop the comment above enum device_type, after DEV_PCI is alaways presen= t in enum device_type, so there is no need anymore in comment and DEV_TYPE_MAX. - drop #ifdef HAS_PCI around dev_is_pci() as DEV_PCI is alwayds define now. - rename args _name, _namestr, _class to name, namestr, class. - drop unnessary backslash after .class =3D class in defines ACPI_DEVICE_S= TART() and DT_DEVICE_START() - update the commit message=20 --- Changes in V7: - keeping DEVICE_PCI_HOSTBRIDGE available for every build based on the rep= ly: https://lore.kernel.org/xen-devel/926a5c12-7f02-42ec-92a8-1c82d060c710@= xen.org/ - add comment above enum device_type.h with explanation about DEV_TYPE_MAX= . =20 - separate patch "[PATCH v6 9/9] xen/asm-generic: introduce generic devic= e.h" into 3 patches. --- Changes in V6: - Rebase only. --- Changes in V5: - Removed generated file: xen/include/headers++.chk.new - Removed pointless #ifdef CONFIG_HAS_DEVICE_TREE ... #endif for PPC as CONFIG_HAS_DEVICE_TREE will be always used for PPC. --- Changes in V4: - Updated the commit message - Switched Arm and PPC to asm-generic version of device.h - Replaced HAS_PCI with CONFIG_HAS_PCI - ifdef-ing iommu filed of dev_archdata struct with CONFIG_HAS_PASSTHROUGH - ifdef-ing iommu_fwspec of device struct with CONFIG_HAS_PASSTHROUGH - ifdef-ing DT related things with CONFIG_HAS_DEVICE_TREE - Updated the commit message ( remove a note with question about if device.h should be in asm-generic or not ) - Replaced DEVICE_IC with DEVICE_INTERRUPT_CONTROLLER - Rationalized usage of CONFIG_HAS_* in device.h - Fixed indents for ACPI_DEVICE_START and ACPI_DEVICE_END --- Changes in V3: - ifdef device tree related things. - update the commit message --- Changes in V2: - take ( as common ) device.h from Arm as PPC and RISC-V use it as a base. - #ifdef PCI related things. - #ifdef ACPI related things. - rename DEVICE_GIC to DEVIC_IC. - rename #ifdef guards. - switch Arm and PPC to generic device.h - add SPDX tag - update the commit message --- xen/include/asm-generic/device.h | 145 +++++++++++++++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 xen/include/asm-generic/device.h diff --git a/xen/include/asm-generic/device.h b/xen/include/asm-generic/dev= ice.h new file mode 100644 index 0000000000..f91bb7f771 --- /dev/null +++ b/xen/include/asm-generic/device.h @@ -0,0 +1,145 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ASM_GENERIC_DEVICE_H__ +#define __ASM_GENERIC_DEVICE_H__ + +#include + +enum device_type +{ +#ifdef CONFIG_HAS_DEVICE_TREE + DEV_DT, +#endif + DEV_PCI +}; + +enum device_class +{ + DEVICE_SERIAL, + DEVICE_IOMMU, + DEVICE_INTERRUPT_CONTROLLER, + DEVICE_PCI_HOSTBRIDGE, + /* Use for error */ + DEVICE_UNKNOWN, +}; + +struct dev_archdata { +#ifdef CONFIG_HAS_PASSTHROUGH + void *iommu; /* IOMMU private data */ +#endif +}; + +/* 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; +#ifdef CONFIG_HAS_PASSTHROUGH + struct iommu_fwspec *iommu_fwspec; /* per-device IOMMU instance data */ +#endif +}; + +typedef struct device device_t; + +#ifdef CONFIG_HAS_DEVICE_TREE + +#include + +#define dev_is_dt(dev) ((dev)->type =3D=3D DEV_DT) + +/** + * 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(dev_name, ident, cls) \ +static const struct device_desc __dev_desc_##dev_name __used \ +__section(".dev.info") =3D { \ + .name =3D ident, \ + .class =3D cls, + +#define DT_DEVICE_END \ +}; + +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); +}; + +#else /* !CONFIG_HAS_DEVICE_TREE */ +#define dev_is_dt(dev) ((void)(dev), false) +#endif /* CONFIG_HAS_DEVICE_TREE */ + +#define dev_is_pci(dev) ((dev)->type =3D=3D DEV_PCI) + +#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); + +#define ACPI_DEVICE_START(dev_name, ident, cls) \ +static const struct acpi_device_desc __dev_desc_##dev_name __used \ +__section(".adev.info") =3D { \ + .name =3D ident, \ + .class =3D cls, + +#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: + */ --=20 2.43.0 From nobody Thu May 9 04:34:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1708087194; cv=none; d=zohomail.com; s=zohoarc; b=NwWD9At1I2PN7Ibb7lvSlxi5xZjyxtAW9zJ8YC5k1CJQHvifeejXiQczZkKH2lA48S94YTsvjcshYe04GCsL0ezudG6UjA0TDi3nbksLqR9R/BbISpjEh0LODrcY0/9ZZ5+7Fp4GECDPgEKzoWvXhS0L0Lfm0ADoB/pgqkqR1Wc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1708087194; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=YrSY4X90IuSAbrPbKK2oOfiNpaRxGc61KTsJ00MVrAM=; b=cJ03ST4zPJ3hBv0vJX72hX8CFxEsoYiInY/3HIxYrD2Eay5/fwd68YO2NzCxwsGWMU9eViItssbqI3RLg+l7xtVZL9laubEB6s1PMAfmT1uwgUmjFQA+ch7jc2dQn+Ki33UIllFGZzf/NjKbD5KKbPP14Z3ioFxRymT62KaHJ8Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1708087194634743.4913352240635; Fri, 16 Feb 2024 04:39:54 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.682191.1061321 (Exim 4.92) (envelope-from ) id 1raxV8-000851-J2; Fri, 16 Feb 2024 12:39:34 +0000 Received: by outflank-mailman (output) from mailman id 682191.1061321; Fri, 16 Feb 2024 12:39:34 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1raxV8-00084t-FO; Fri, 16 Feb 2024 12:39:34 +0000 Received: by outflank-mailman (input) for mailman id 682191; Fri, 16 Feb 2024 12:39:33 +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 1raxV7-0006oP-4Q for xen-devel@lists.xenproject.org; Fri, 16 Feb 2024 12:39:33 +0000 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [2a00:1450:4864:20::630]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 6e5a3f02-ccc8-11ee-98f5-efadbce2ee36; Fri, 16 Feb 2024 13:39:31 +0100 (CET) Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-a3deb3f563bso51047466b.2 for ; Fri, 16 Feb 2024 04:39:31 -0800 (PST) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id lj8-20020a170907188800b00a3db1734b92sm1121608ejc.43.2024.02.16.04.39.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 04:39:29 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 6e5a3f02-ccc8-11ee-98f5-efadbce2ee36 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708087170; x=1708691970; 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=YrSY4X90IuSAbrPbKK2oOfiNpaRxGc61KTsJ00MVrAM=; b=czg1v7XYdT9o/V/v13CAIKI0vIlr264WjINv5uI5G/UN73bdM/2Xw6UowfSeI6zTDC Hkl5hFaWsKxFjOaknAEWAdW4VL1WVUjPywqWXP178LreDJ78VyBQ1slcyOPnA92HMNQ8 85/Pwye+cQfbZlMbuERXumaIOFUSzFvdkaSkyjGIHdYoMced0A+KEm6ACMoNqGmg7FZu x3aXie4189E5VMH6fwmTAy8pZtYIiC45CB3Z4pCd4+EC3j67qG/PoxECBhXycIfjos+r ENcjBANvz39WSEovaiTH1/NNgAIcxW7TVb3NNdyiWZt1lxYNeWMBb/TrzQjV+7gr5pEv oNag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708087170; x=1708691970; 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=YrSY4X90IuSAbrPbKK2oOfiNpaRxGc61KTsJ00MVrAM=; b=Cj+ToHO4DdqTtYwer6L5KsxsVMzwwsEgybyLt8OsRxzG/Z+YjnAiaAILfBHlfSX56D ScKxuo3bsSXvIdvlc1U5l9DOxI9p0daE9sx54F6KpyIah5Ra1ksx1NXL5POw8s2pezRt vURLJojDFHvxPJNOtYFsa90Y+0n1CDjowy7saNAO3XnJIaqS/WNhfV5av56ZvH4m9hjr a5A7Jqiwlhh/e0MACPih8bT7gESvvCjTwC7TlinA5XPzj0E1uEW0PhIgwKMlxzNX64Vn ieIieyv3eHevsKGTKVtTWIvbTM+rX6DE6sNPKMh8uniDD0qKMKmIjL8I5D5EUW3fpy4z u18w== X-Gm-Message-State: AOJu0Yz8dmeudbG+upMi08okSNWMh02QvY83/D0rvyC6anYe9/d/lpRr h7KfN+DTR8Oe6mwic545m2nUKrD7S+malkh7OAxa5/smjiUQIOxpZD2aTAsi X-Google-Smtp-Source: AGHT+IEshWja8Iu0W37U0QhlRH6bVp5bEopQ6HBO0evdbwZ9+7eDnlQ2tD47VoC+ACQhbgr2qdhHjA== X-Received: by 2002:a17:906:e28f:b0:a3d:8a86:a8fd with SMTP id gg15-20020a170906e28f00b00a3d8a86a8fdmr867935ejb.30.1708087170060; Fri, 16 Feb 2024 04:39:30 -0800 (PST) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk , Julien Grall Subject: [PATCH v9 5/7] xen/arm: switch Arm to use asm-generic/device.h Date: Fri, 16 Feb 2024 13:39:17 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1708087196935100005 Content-Type: text/plain; charset="utf-8" The following changes were done as a result of switching to asm-generic/device.h: * DEVICE_GIC was renamed to DEVICE_INTERRUPT_CONTROLLER according to definition of enum device_class in asm-generic/device.h. * acpi-related things in Arm code were guarded by #ifdef CONFIG_ACPI as struct acpi_device_desc was guarded in asm-generic, also functions acpi_device_init() was guarded too as they are using structure acpi_device_desc inside. * drop arm/include/asm/device.h and update arm/include/asm/Makefile to use asm-generic/device.h instead. As 'struct device_desc' is protected by CONFIG_HAS_DEVICE_TREE, _sdevice, _edevice, device_init(), and device_get_class should also be protected. However, this protection was not implemented because Arm always has CONFIG_HAS_DEVICE_TREE=3Dy at the moment. Signed-off-by: Oleksii Kurochko Reviewed-by: Julien Grall --- Changes in V9: - protect .adev_info in Arm linker script by #ifdef CONFIG_ACPI. - update the commit message.=20 - add Reviewed-by: Julien Grall --- Changes in V8: - update the commit message --- Changes in V7: - newly introduced patch which is based on the previous version of the pat= ch: [PATCH v6 9/9] xen/asm-generic: introduce generic device.h --- xen/arch/arm/device.c | 5 ++ xen/arch/arm/domain_build.c | 2 +- xen/arch/arm/gic-v2.c | 4 +- xen/arch/arm/gic-v3.c | 6 +- xen/arch/arm/gic.c | 4 +- xen/arch/arm/include/asm/Makefile | 1 + xen/arch/arm/include/asm/device.h | 124 ------------------------------ xen/arch/arm/xen.lds.S | 2 + 8 files changed, 16 insertions(+), 132 deletions(-) delete mode 100644 xen/arch/arm/include/asm/device.h diff --git a/xen/arch/arm/device.c b/xen/arch/arm/device.c index 1f631d3274..3e02cff008 100644 --- a/xen/arch/arm/device.c +++ b/xen/arch/arm/device.c @@ -16,7 +16,10 @@ #include =20 extern const struct device_desc _sdevice[], _edevice[]; + +#ifdef CONFIG_ACPI extern const struct acpi_device_desc _asdevice[], _aedevice[]; +#endif =20 int __init device_init(struct dt_device_node *dev, enum device_class class, const void *data) @@ -45,6 +48,7 @@ int __init device_init(struct dt_device_node *dev, enum d= evice_class class, return -EBADF; } =20 +#ifdef CONFIG_ACPI int __init acpi_device_init(enum device_class class, const void *data, int= class_type) { const struct acpi_device_desc *desc; @@ -61,6 +65,7 @@ int __init acpi_device_init(enum device_class class, cons= t void *data, int class =20 return -EBADF; } +#endif =20 enum device_class device_get_class(const struct dt_device_node *dev) { diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 46161848dc..085d88671e 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -1651,7 +1651,7 @@ static int __init handle_node(struct domain *d, struc= t kernel_info *kinfo, * Replace these nodes with our own. Note that the original may be * used_by DOMID_XEN so this check comes first. */ - if ( device_get_class(node) =3D=3D DEVICE_GIC ) + if ( device_get_class(node) =3D=3D DEVICE_INTERRUPT_CONTROLLER ) return make_gic_node(d, kinfo->fdt, node); if ( dt_match_node(timer_matches, node) ) return make_timer_node(kinfo); diff --git a/xen/arch/arm/gic-v2.c b/xen/arch/arm/gic-v2.c index cf392bfd1c..5d6885e389 100644 --- a/xen/arch/arm/gic-v2.c +++ b/xen/arch/arm/gic-v2.c @@ -1366,7 +1366,7 @@ static const struct dt_device_match gicv2_dt_match[] = __initconst =3D { /* sentinel */ }, }; =20 -DT_DEVICE_START(gicv2, "GICv2", DEVICE_GIC) +DT_DEVICE_START(gicv2, "GICv2", DEVICE_INTERRUPT_CONTROLLER) .dt_match =3D gicv2_dt_match, .init =3D gicv2_dt_preinit, DT_DEVICE_END @@ -1381,7 +1381,7 @@ static int __init gicv2_acpi_preinit(const void *data) return 0; } =20 -ACPI_DEVICE_START(agicv2, "GICv2", DEVICE_GIC) +ACPI_DEVICE_START(agicv2, "GICv2", DEVICE_INTERRUPT_CONTROLLER) .class_type =3D ACPI_MADT_GIC_VERSION_V2, .init =3D gicv2_acpi_preinit, ACPI_DEVICE_END diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c index bf0e5c1b75..1cb1360606 100644 --- a/xen/arch/arm/gic-v3.c +++ b/xen/arch/arm/gic-v3.c @@ -1909,7 +1909,7 @@ static const struct dt_device_match gicv3_dt_match[] = __initconst =3D { /* sentinel */ }, }; =20 -DT_DEVICE_START(gicv3, "GICv3", DEVICE_GIC) +DT_DEVICE_START(gicv3, "GICv3", DEVICE_INTERRUPT_CONTROLLER) .dt_match =3D gicv3_dt_match, .init =3D gicv3_dt_preinit, DT_DEVICE_END @@ -1924,12 +1924,12 @@ static int __init gicv3_acpi_preinit(const void *da= ta) return 0; } =20 -ACPI_DEVICE_START(agicv3, "GICv3", DEVICE_GIC) +ACPI_DEVICE_START(agicv3, "GICv3", DEVICE_INTERRUPT_CONTROLLER) .class_type =3D ACPI_MADT_GIC_VERSION_V3, .init =3D gicv3_acpi_preinit, ACPI_DEVICE_END =20 -ACPI_DEVICE_START(agicv4, "GICv4", DEVICE_GIC) +ACPI_DEVICE_START(agicv4, "GICv4", DEVICE_INTERRUPT_CONTROLLER) .class_type =3D ACPI_MADT_GIC_VERSION_V4, .init =3D gicv3_acpi_preinit, ACPI_DEVICE_END diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c index d922ea67aa..b5a9c8266c 100644 --- a/xen/arch/arm/gic.c +++ b/xen/arch/arm/gic.c @@ -234,7 +234,7 @@ static void __init gic_dt_preinit(void) if ( !dt_get_parent(node) ) continue; =20 - rc =3D device_init(node, DEVICE_GIC, NULL); + rc =3D device_init(node, DEVICE_INTERRUPT_CONTROLLER, NULL); if ( !rc ) { /* NOTE: Only one GIC is supported */ @@ -262,7 +262,7 @@ static void __init gic_acpi_preinit(void) =20 dist =3D container_of(header, struct acpi_madt_generic_distributor, he= ader); =20 - if ( acpi_device_init(DEVICE_GIC, NULL, dist->version) ) + if ( acpi_device_init(DEVICE_INTERRUPT_CONTROLLER, NULL, dist->version= ) ) panic("Unable to find compatible GIC in the ACPI table\n"); } #else diff --git a/xen/arch/arm/include/asm/Makefile b/xen/arch/arm/include/asm/M= akefile index 505cb49090..4a4036c951 100644 --- a/xen/arch/arm/include/asm/Makefile +++ b/xen/arch/arm/include/asm/Makefile @@ -1,5 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-only generic-y +=3D altp2m.h +generic-y +=3D device.h generic-y +=3D hardirq.h generic-y +=3D iocap.h generic-y +=3D paging.h diff --git a/xen/arch/arm/include/asm/device.h b/xen/arch/arm/include/asm/d= evice.h deleted file mode 100644 index b5d451e087..0000000000 --- a/xen/arch/arm/include/asm/device.h +++ /dev/null @@ -1,124 +0,0 @@ -#ifndef __ASM_ARM_DEVICE_H -#define __ASM_ARM_DEVICE_H - -enum device_type -{ - DEV_DT, - DEV_PCI, -}; - -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; - -#include - -#define dev_is_pci(dev) ((dev)->type =3D=3D DEV_PCI) -#define dev_is_dt(dev) ((dev)->type =3D=3D DEV_DT) - -enum device_class -{ - DEVICE_SERIAL, - DEVICE_IOMMU, - DEVICE_GIC, - DEVICE_PCI_HOSTBRIDGE, - /* Use for error */ - DEVICE_UNKNOWN, -}; - -struct device_desc { - /* Device name */ - const char *name; - /* Device class */ - enum device_class class; - /* List of devices supported by this driver */ - const struct dt_device_match *dt_match; - /* - * Device initialization. - * - * -EAGAIN is used to indicate that device probing is deferred. - */ - int (*init)(struct dt_device_node *dev, const void *data); -}; - -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); - -/** - * device_init - Initialize a device - * @dev: device to initialize - * @class: class of the device (serial, network...) - * @data: specific data for initializing the device - * - * Return 0 on success. - */ -int device_init(struct dt_device_node *dev, enum device_class class, - const void *data); - -/** - * device_get_type - Get the type of the device - * @dev: device to match - * - * Return the device type on success or DEVICE_ANY on failure - */ -enum device_class device_get_class(const struct dt_device_node *dev); - -#define DT_DEVICE_START(_name, _namestr, _class) \ -static const struct device_desc __dev_desc_##_name __used \ -__section(".dev.info") =3D { \ - .name =3D _namestr, \ - .class =3D _class, \ - -#define DT_DEVICE_END \ -}; - -#define ACPI_DEVICE_START(_name, _namestr, _class) \ -static const struct acpi_device_desc __dev_desc_##_name __used \ -__section(".adev.info") =3D { \ - .name =3D _namestr, \ - .class =3D _class, \ - -#define ACPI_DEVICE_END \ -}; - -#endif /* __ASM_ARM_DEVICE_H */ - -/* - * Local variables: - * mode: C - * c-file-style: "BSD" - * c-basic-offset: 4 - * indent-tabs-mode: nil - * End: - */ diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S index 470c8f2208..2266c9536f 100644 --- a/xen/arch/arm/xen.lds.S +++ b/xen/arch/arm/xen.lds.S @@ -138,12 +138,14 @@ SECTIONS _edevice =3D .; } :text =20 +#ifdef CONFIG_ACPI . =3D ALIGN(8); .adev.info : { _asdevice =3D .; *(.adev.info) _aedevice =3D .; } :text +#endif =20 . =3D ALIGN(8); .teemediator.info : { --=20 2.43.0 From nobody Thu May 9 04:34:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1708087198; cv=none; d=zohomail.com; s=zohoarc; b=GGZw6iBIK6qkZD07GpfIs5FOiPIAFRhHTp3GSAgfTyekU6y0wClAhQnwG8IkJe7TKIvuwTDjIBgoFf5JzLqfM4DcDt3jWnEqXwf2aQXsdE99DLfeVMrGasLz2KV8ok2gDC+khRfjQqwCAz2VY0bORWGT1m6iwyu7LiPcw4HbQ7A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1708087198; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=1zM8XpDaj0bwgFuwnlMqun0OZXmeuznnNGSwY8Hidtw=; b=i4Pb6TyCcfjQCsw/aiO096TlQYoCcwukBxXYyBAfDU54sCPrHz+6sIwPgYzwF6eAkmee1+ndNQqO1Q6FJedelxTtlY0Jx8slTH3LspnCY8TyVzWTfxj3AiAlsKvd5H3hIN9dzzCWt74atBEaRWviefsi/CkGERmkJFuCPTpoUkQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 17080871982791004.7434161231978; Fri, 16 Feb 2024 04:39:58 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.682192.1061326 (Exim 4.92) (envelope-from ) id 1raxV9-00089E-1X; Fri, 16 Feb 2024 12:39:35 +0000 Received: by outflank-mailman (output) from mailman id 682192.1061326; Fri, 16 Feb 2024 12:39:35 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1raxV8-00088H-Qf; Fri, 16 Feb 2024 12:39:34 +0000 Received: by outflank-mailman (input) for mailman id 682192; Fri, 16 Feb 2024 12:39:33 +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 1raxV7-0006oJ-3a for xen-devel@lists.xenproject.org; Fri, 16 Feb 2024 12:39:33 +0000 Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [2a00:1450:4864:20::634]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 6f1d6ee9-ccc8-11ee-8a4f-1f161083a0e0; Fri, 16 Feb 2024 13:39:32 +0100 (CET) Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-a2a17f3217aso254729366b.2 for ; Fri, 16 Feb 2024 04:39:32 -0800 (PST) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id lj8-20020a170907188800b00a3db1734b92sm1121608ejc.43.2024.02.16.04.39.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 04:39:30 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 6f1d6ee9-ccc8-11ee-8a4f-1f161083a0e0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708087171; x=1708691971; 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=1zM8XpDaj0bwgFuwnlMqun0OZXmeuznnNGSwY8Hidtw=; b=k/X+f+qT3NDcd79wTBrBlAKnwTOjXC249j9A3vqWWUR3StHY9kogDBwzrOcol/kWYd 1I910uUeXJBUMXr7ijlbH0/051FPHS3fKZTwMt6RK+pHFb/rIefknv/zRl5gKyDUdWia bHDLKAZ62ymi9JC2AA54CIO5Jfg91MNX+uej19+pb+0E8SvMtXHOQsf50KueKFZI3+rI c2Q452PSu/Xc2bkWdSQq9pFMvNrrGU9s89yd4tjOGKF+C0R49A4/JIGchru8BoBysFlz j4u36+5sTi4AvflAWRUEuVk/xD8WWa3NyO9/0+36LAJxLi7Ji/cRBhFmpVhhqQ5uwhVI Qrhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708087171; x=1708691971; 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=1zM8XpDaj0bwgFuwnlMqun0OZXmeuznnNGSwY8Hidtw=; b=absOU9t54rQ2FpriOtqcTw+VSg25hXH7LIQ7gfunFjfao4Yn9n66w5OLEuJpspS/F2 b021vKBjkGkKDqr2ut858jhyMC9RsNjwFLANgqIdFwGqPKttjec4Cb6dWGf5m8NuCm5w upYiU3CvZBh6wqRYBHVg+i8MD7j/7sN3/k1yFmv4WImFySAKKItosP26Rmi9HrtLHFYN vlYj95vFQeGAbPFXH5YeKtm9IBP80FXgj8lL1gV1HAQIZyHvSP8tXnoO2kRBErtCw/Jj kFz7EGQZWn85zav1wlE65+TJ2l/HXDgdE+8nMVXg4wmoBslmxakXuPTQVl1JipJYEQH3 P2pw== X-Gm-Message-State: AOJu0YyNkSm4/x9Vvf5NBcPMtgnG4tlMYLCs0UXvWQ6BGrDRehVL4tUH HYzwONoY4ND3bxSEHmHGs+I5slZVUK24RkUpfP8kHoTs4b5/O3jCnJneHFvx X-Google-Smtp-Source: AGHT+IF+iDaRaUHdatlA0i3c5lu7YparT93bpBVp2gnoxYvBLfVtPC1KMpjFtLaILr0DpwOngQTlgA== X-Received: by 2002:a17:906:254e:b0:a3d:ab64:7524 with SMTP id j14-20020a170906254e00b00a3dab647524mr2778795ejb.36.1708087171378; Fri, 16 Feb 2024 04:39:31 -0800 (PST) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , Shawn Anastasio Subject: [PATCH v9 6/7] xen/ppc: switch PPC to use asm-generic/device.h Date: Fri, 16 Feb 2024 13:39:18 +0100 Message-ID: <222ae66639312712e145bd04d5dd1ebd2c511d43.1708086092.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1708087198793100007 Content-Type: text/plain; charset="utf-8" Signed-off-by: Oleksii Kurochko Acked-by: Shawn Anastasio --- Changed in V8: - nothing changed. only rebase. --- Changes in V7: - newly introduced patch which is based on the previous version of the pat= ch: [PATCH v6 9/9] xen/asm-generic: introduce generic device.h --- xen/arch/ppc/include/asm/Makefile | 1 + xen/arch/ppc/include/asm/device.h | 53 ------------------------------- 2 files changed, 1 insertion(+), 53 deletions(-) delete mode 100644 xen/arch/ppc/include/asm/device.h diff --git a/xen/arch/ppc/include/asm/Makefile b/xen/arch/ppc/include/asm/M= akefile index 3fd893f3e0..ced02e26ed 100644 --- a/xen/arch/ppc/include/asm/Makefile +++ b/xen/arch/ppc/include/asm/Makefile @@ -1,5 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-only generic-y +=3D altp2m.h +generic-y +=3D device.h generic-y +=3D div64.h generic-y +=3D hardirq.h generic-y +=3D hypercall.h diff --git a/xen/arch/ppc/include/asm/device.h b/xen/arch/ppc/include/asm/d= evice.h deleted file mode 100644 index 8253e61d51..0000000000 --- a/xen/arch/ppc/include/asm/device.h +++ /dev/null @@ -1,53 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#ifndef __ASM_PPC_DEVICE_H__ -#define __ASM_PPC_DEVICE_H__ - -enum device_type -{ - DEV_DT, - DEV_PCI, -}; - -struct device { - enum device_type type; -#ifdef CONFIG_HAS_DEVICE_TREE - struct dt_device_node *of_node; /* Used by drivers imported from Linux= */ -#endif -}; - -enum device_class -{ - DEVICE_SERIAL, - DEVICE_IOMMU, - DEVICE_PCI_HOSTBRIDGE, - /* Use for error */ - DEVICE_UNKNOWN, -}; - -struct device_desc { - /* Device name */ - const char *name; - /* Device class */ - enum device_class class; - /* List of devices supported by this driver */ - const struct dt_device_match *dt_match; - /* - * Device initialization. - * - * -EAGAIN is used to indicate that device probing is deferred. - */ - int (*init)(struct dt_device_node *dev, const void *data); -}; - -typedef struct device device_t; - -#define DT_DEVICE_START(name_, namestr_, class_) \ -static const struct device_desc __dev_desc_##name_ __used \ -__section(".dev.info") =3D { \ - .name =3D namestr_, \ - .class =3D class_, \ - -#define DT_DEVICE_END \ -}; - -#endif /* __ASM_PPC_DEVICE_H__ */ --=20 2.43.0 From nobody Thu May 9 04:34:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1708087194; cv=none; d=zohomail.com; s=zohoarc; b=BA24cY23uauozhDV+fXYigrz2k455nwsnwbkYqI21iZNqDmLRWxu1AGMMJh7QdU5MNC03t0L8D8fV58nFGEEo4qAuZo8jaWnjrGfwFtEKr0i6MvjosvihVzUhZPU4OZ9G3+N1YIP7wRY/F78n/yw1eJUFtTbEc7sD6ipJaqMEZ0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1708087194; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ELu7fx1uXcKKvX0ev7mgwIEsa2oKN1zApZ0Pg4TKtMg=; b=JqDpR7Ji4iIRog7wpkjdDzL7Y3IaK/QmIsjsp8oi5zkenoi1ssNf32UslgYntfg8MlOOePqVegTJ8SUBYbCiOaatUHri1002FpOQ8aX5QWRwfMD3tzw25RmqRiJ06mDY07IqVPxCb2VITLTOHa3O0ovFfIQn6wRryxAbZe+mnnY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1708087194586540.2405824655352; Fri, 16 Feb 2024 04:39:54 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.682193.1061334 (Exim 4.92) (envelope-from ) id 1raxV9-0008Me-Ly; Fri, 16 Feb 2024 12:39:35 +0000 Received: by outflank-mailman (output) from mailman id 682193.1061334; Fri, 16 Feb 2024 12:39:35 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1raxV9-0008LA-GL; Fri, 16 Feb 2024 12:39:35 +0000 Received: by outflank-mailman (input) for mailman id 682193; Fri, 16 Feb 2024 12:39:34 +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 1raxV8-0006oJ-4G for xen-devel@lists.xenproject.org; Fri, 16 Feb 2024 12:39:34 +0000 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [2a00:1450:4864:20::630]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 6fb2ce04-ccc8-11ee-8a4f-1f161083a0e0; Fri, 16 Feb 2024 13:39:33 +0100 (CET) Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-a3de25186fbso65365166b.0 for ; Fri, 16 Feb 2024 04:39:33 -0800 (PST) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id lj8-20020a170907188800b00a3db1734b92sm1121608ejc.43.2024.02.16.04.39.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 04:39:32 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 6fb2ce04-ccc8-11ee-8a4f-1f161083a0e0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708087173; x=1708691973; 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=ELu7fx1uXcKKvX0ev7mgwIEsa2oKN1zApZ0Pg4TKtMg=; b=F4lUmyvMz8kbw4SheeKxEHi3aPn2hPDs1dxqLCGmvTbk3ZlpAx7gnLjkfZLsYGzZip oTB7SIII9/LFQrjD2XnxzuP5ndlSfCouU5VGY30lD3QCSpwhVnQOAhNKIxY4IMSzp8MH gn2AZBHWmxrQRqp+vJLupOWdzHiQbN5g3lnaDVjmYeOxGqlH9BbK4Yl/rxyyouH+qiXM /xWZp50YOFZrm0d066BhP1nJIMPpSz+yseZnLFEOQRSKYveaHtzelJEP9QILgamhhA3i YlLNFO5IM0RAYB7vRP2oTsRBJ/CktKH7KvuV7GxCVsPPH9G9AyQGgQ+BqmrRMzB5LSV/ YwlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708087173; x=1708691973; 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=ELu7fx1uXcKKvX0ev7mgwIEsa2oKN1zApZ0Pg4TKtMg=; b=ci6L/IjbJ7sslt/lekD6edSF9BNr7Yn0bODpxWMcxPFnUDCVX1zx9IbHLIDo48654R Tfn5ik2xKICNJRfXXvgLCQMiV9IH46Fts/mts0G0BWgyrus0B0ssYNV3BMnShjeAfCWt U9ugpP4ZLIKh7HtBhJGq/Z/+7YQ9Cvlxwh6JypvNNDgi2vd+YGzuY+Z7EYMQJfdqLPD7 v+a7qMoZYyLaHc/kpQ/RKI95oC5cokTGibkHmxiSGTqPChvrjj7Z/Dy6UZP92uk24WTP 04OSEkuy/jNnt1b+ctGVUYWVlhqfUH4nSgTNvbRRXAIamxWjLYHEG+YzOvkUk6W2AH5S Hwyw== X-Gm-Message-State: AOJu0YwZ9UeC8gpbwo6FTIyyDgdOHqSZlLplXxdBDtdxWZspscMVNL7w Q6pAqX7LR5kSzaOL85SAYjtAnxHny17JikhQKBcuSd0UFpUxEV3RNirjmsG5 X-Google-Smtp-Source: AGHT+IEgSArJ2RWktN+cBbDdUCZOEWFMz/h00WcEFOPs7dnjimSk0EQ6RWUaUr/nb0pDUpMPvqyhwQ== X-Received: by 2002:a17:906:451:b0:a3d:9962:f05f with SMTP id e17-20020a170906045100b00a3d9962f05fmr2952460eja.74.1708087172839; Fri, 16 Feb 2024 04:39:32 -0800 (PST) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , Julien Grall , Rahul Singh , Stefano Stabellini , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk , Andrew Cooper , George Dunlap , Jan Beulich , Wei Liu Subject: [PATCH v9 7/7] xen/asm-generic: fold struct devarch into struct dev Date: Fri, 16 Feb 2024 13:39:19 +0100 Message-ID: <3a5bf394a9d95a28cecac996f6e0decb788c19fd.1708086092.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1708087195011100001 Content-Type: text/plain; charset="utf-8" The current patch is a follow-up to the patch titled: xen/asm-generic: introduce generic device.h Also, a prerequisite for this patch is, without which a compilation error will occur: xen/arm: switch Arm to use asm-generic/device.h The 'struct dev_archdata' is exclusively used within 'struct device', so it could be merged into 'struct device.' After the merger, it is necessary to update the 'dev_archdata()' macros and the comments above 'struct arm_smmu_xen_device' in drivers/passthrough/arm/smmu.c. Additionally, it is required to update instances of "dev->archdata->iommu" to "dev->iommu". Suggested-by: Julien Grall Signed-off-by: Oleksii Kurochko Reviewed-by: Julien Grall --- This patch can be merged with patches 4 and 5 of this patch series. --- Changes in V9: - newly introduced patch. --- xen/drivers/passthrough/arm/smmu.c | 12 ++++++------ xen/include/asm-generic/device.h | 8 +------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/xen/drivers/passthrough/arm/smmu.c b/xen/drivers/passthrough/a= rm/smmu.c index 32e2ff279b..4a272c8779 100644 --- a/xen/drivers/passthrough/arm/smmu.c +++ b/xen/drivers/passthrough/arm/smmu.c @@ -227,9 +227,9 @@ struct arm_smmu_xen_domain { }; =20 /* - * Xen: Information about each device stored in dev->archdata.iommu + * Xen: Information about each device stored in dev->iommu * - * Initially dev->archdata.iommu only stores the iommu_domain (runtime + * Initially dev->iommu only stores the iommu_domain (runtime * configuration of the SMMU) but, on Xen, we also have to store the * iommu_group (list of streamIDs associated to the device). * @@ -242,7 +242,7 @@ struct arm_smmu_xen_device { struct iommu_group *group; }; =20 -#define dev_archdata(dev) ((struct arm_smmu_xen_device *)dev->archdata.iom= mu) +#define dev_archdata(dev) ((struct arm_smmu_xen_device *)dev->iommu) #define dev_iommu_domain(dev) (dev_archdata(dev)->domain) #define dev_iommu_group(dev) (dev_archdata(dev)->group) =20 @@ -2777,9 +2777,9 @@ static int arm_smmu_assign_dev(struct domain *d, u8 d= evfn, =20 xen_domain =3D dom_iommu(d)->arch.priv; =20 - if (!dev->archdata.iommu) { - dev->archdata.iommu =3D xzalloc(struct arm_smmu_xen_device); - if (!dev->archdata.iommu) + if (!dev->iommu) { + dev->iommu =3D xzalloc(struct arm_smmu_xen_device); + if (!dev->iommu) return -ENOMEM; } =20 diff --git a/xen/include/asm-generic/device.h b/xen/include/asm-generic/dev= ice.h index f91bb7f771..1acd1ba1d8 100644 --- a/xen/include/asm-generic/device.h +++ b/xen/include/asm-generic/device.h @@ -22,12 +22,6 @@ enum device_class DEVICE_UNKNOWN, }; =20 -struct dev_archdata { -#ifdef CONFIG_HAS_PASSTHROUGH - void *iommu; /* IOMMU private data */ -#endif -}; - /* struct device - The basic device structure */ struct device { @@ -35,8 +29,8 @@ struct device #ifdef CONFIG_HAS_DEVICE_TREE struct dt_device_node *of_node; /* Used by drivers imported from Linux= */ #endif - struct dev_archdata archdata; #ifdef CONFIG_HAS_PASSTHROUGH + void *iommu; /* IOMMU private data */; struct iommu_fwspec *iommu_fwspec; /* per-device IOMMU instance data */ #endif }; --=20 2.43.0