From patchwork Wed Dec 20 14:08:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksii Kurochko X-Patchwork-Id: 13500168 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 38549C3DA6E for ; Wed, 20 Dec 2023 14:08:56 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.657914.1027006 (Exim 4.92) (envelope-from ) id 1rFxFZ-0004oO-Rb; Wed, 20 Dec 2023 14:08:41 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 657914.1027006; Wed, 20 Dec 2023 14:08:41 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rFxFZ-0004oE-NQ; Wed, 20 Dec 2023 14:08:41 +0000 Received: by outflank-mailman (input) for mailman id 657914; Wed, 20 Dec 2023 14:08:40 +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 1rFxFY-0004kf-68 for xen-devel@lists.xenproject.org; Wed, 20 Dec 2023 14:08:40 +0000 Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [2a00:1450:4864:20::230]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 453cc1d3-9f41-11ee-9b0f-b553b5be7939; Wed, 20 Dec 2023 15:08:37 +0100 (CET) Received: by mail-lj1-x230.google.com with SMTP id 38308e7fff4ca-2cc6863d43aso43341881fa.1 for ; Wed, 20 Dec 2023 06:08:37 -0800 (PST) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id d19-20020a05651c089300b002cc83c337absm593892ljq.70.2023.12.20.06.08.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 06:08:36 -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: 453cc1d3-9f41-11ee-9b0f-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703081316; x=1703686116; 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=2fKu9ANs5pt5jj6Gpw7pQbCf+WI+5MwaW9ic+DTy9Fs=; b=R2TJl2NKXlDzOP4C2wo4inB4JPz1dHEiQ49tw5XGtCk+OIKXqpl4Va7r3664PhnZGw +/rfNAnRzrKjYBXk31s2xaMsWXMRzCkVzlP4k+bAZgKuHaweCMGXqQh135cVTGCG30A2 jRvXgkqIUGAI/seePjPdiv+o0y+H2wUiy6uKoQBDh1h9vLEy9e5NG4jd7bfQeJU7S3KX YFkFQfEou1aWlSL/Dk23MqGrwgOOjecVgvrNz39AcrzXTTo9ALwrlxTw29gZnpvNBeGy HGEOmGE84zdsWueM1BAfEmCJPXeDrAd9WR5rbs3Nyea0hO9tQ2cHGFc+ludZQfWLFWy9 MV4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703081316; x=1703686116; 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=2fKu9ANs5pt5jj6Gpw7pQbCf+WI+5MwaW9ic+DTy9Fs=; b=eqtQc8OIs2h03SAosu34EXVaGdYYHfV15ePsrDxEdfWMgyGdM4hHkbTNTtNoczyOkQ /ouZGzqzzb7CQ9mmwBif7MPvLwO46sTnT22xOxuYDleaV/3x8PQ8ifwsE62lL86XeDO/ Lu2wLFHAvSzT+2WXe0GuNyVr3QukBBFoT1frddem0W2Wl2pHS89ILssX/bczQT7x7294 ogFR/TDUyDA9GVSPExTlln+F1RJydBtSzyR9COrnVs8uBnnu5fWhX59MbTv9L8aAkyIJ vT/Fs0nFFYoC0VmKUDFx/A+L3wVh8MB+35bMen8psOVltWTP87ZjKNHkDqW95tnDM1u8 s2gg== X-Gm-Message-State: AOJu0YwU3DMryBa5z2oRyBmub4fJPb4Qcx4n6zWqbKQ0Nl7LkzWoeHCw aCbRQjHmqP68HMucaM/Ip/YOXk8xtnoPbg== X-Google-Smtp-Source: AGHT+IF/TDyhntyDamCgw7yzth1QdkVU3pXiAmtkMPFmpwRP98ZtkfYrHnI48rMbDg3lnvwKkMrNdw== X-Received: by 2002:a2e:8897:0:b0:2cc:7013:4b40 with SMTP id k23-20020a2e8897000000b002cc70134b40mr2276330lji.68.1703081316356; Wed, 20 Dec 2023 06:08:36 -0800 (PST) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , Doug Goldstein , Stefano Stabellini Subject: [PATCH v6 1/9] automation: ensure values in EXTRA_FIXED_RANDCONFIG are separated by new line Date: Wed, 20 Dec 2023 16:08:23 +0200 Message-ID: <9f75416adb77d03b639741e4548d041c78fd4227.1703072575.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Kconfig tool expects each configuration to be on a new line. The current version of the build script puts all of ${EXTRA_FIXED_RANDCONFIG} in a single line and configs are seperated by spaces. As a result, only the first configuration in ${EXTRA_FIXED_RANDCONFIG} will be used. Signed-off-by: Oleksii Kurochko --- Changes in V6: - The patch was introduced in this version of patch series. --- automation/scripts/build | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/automation/scripts/build b/automation/scripts/build index b3c71fb6fb..13b043923d 100755 --- a/automation/scripts/build +++ b/automation/scripts/build @@ -14,7 +14,7 @@ if [[ "${RANDCONFIG}" == "y" ]]; then # Append job-specific fixed configuration if [[ -n "${EXTRA_FIXED_RANDCONFIG}" ]]; then - echo "${EXTRA_FIXED_RANDCONFIG}" >> xen/tools/kconfig/allrandom.config + sed "s/ /\n/g" <<< "${EXTRA_FIXED_RANDCONFIG}" > xen/tools/kconfig/allrandom.config fi make -j$(nproc) -C xen KCONFIG_ALLCONFIG=tools/kconfig/allrandom.config randconfig @@ -28,9 +28,11 @@ else echo "CONFIG_DEBUG=${debug}" >> xen/.config if [[ -n "${EXTRA_XEN_CONFIG}" ]]; then - echo "${EXTRA_XEN_CONFIG}" >> xen/.config + sed "s/ /\n/g" <<< "${EXTRA_XEN_CONFIG}" >> xen/.config fi + cat xen/.config + make -j$(nproc) -C xen olddefconfig fi From patchwork Wed Dec 20 14:08:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksii Kurochko X-Patchwork-Id: 13500167 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 2B6F6C46CD2 for ; Wed, 20 Dec 2023 14:08:54 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.657915.1027014 (Exim 4.92) (envelope-from ) id 1rFxFa-0004vM-4p; Wed, 20 Dec 2023 14:08:42 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 657915.1027014; Wed, 20 Dec 2023 14:08:42 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rFxFa-0004uT-0D; Wed, 20 Dec 2023 14:08:42 +0000 Received: by outflank-mailman (input) for mailman id 657915; Wed, 20 Dec 2023 14:08:41 +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 1rFxFZ-0004kf-6P for xen-devel@lists.xenproject.org; Wed, 20 Dec 2023 14:08:41 +0000 Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [2a00:1450:4864:20::234]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 461b5e48-9f41-11ee-9b0f-b553b5be7939; Wed, 20 Dec 2023 15:08:39 +0100 (CET) Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2cc3f5e7451so68861941fa.2 for ; Wed, 20 Dec 2023 06:08:39 -0800 (PST) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id d19-20020a05651c089300b002cc83c337absm593892ljq.70.2023.12.20.06.08.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 06:08:36 -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: 461b5e48-9f41-11ee-9b0f-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703081318; x=1703686118; 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=gbOdTmbCCEcvxPnbxe8rBqPtsYTBci17wzfXbyUXaIQ=; b=QysgtT4Ae57tHcC/OiLeVvkK3W2mzzuvnPqai1lJ0y1JPVuRQwJ1XBEsXX3QiF9IVK soThG7LUSkgyI97Fxua2qzaWtSHt1EQCTuLEWH/U1EoHQJt7gDYu1zx3UEd6fbnTsyZu nHbesKWrAn1kRPFrMuFEMArWfTBnorSeQkoo0CpM8hkCkgj77BFEji+1lz4RtTJzpqT+ dooKKUYNi/QDA7jEhRf5iZ2vSOCxl1t//y/2EykTp7sHsQtL3HBWPZeUQWSdt6Ag6Zr4 NhWx4vD7Acy7iFpJ73n0t4otDkbwAT7xy+wy5cdjebWIXWFL7XSLlb9cpMma1+rkmUJt sS3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703081318; x=1703686118; 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=gbOdTmbCCEcvxPnbxe8rBqPtsYTBci17wzfXbyUXaIQ=; b=XOSRsGsUmrzkjo/G/GJ3bDVuBGUkgnuZMxPNTwV1x//e+na2KI962v2eGrBzXEvhnC tsWcU6LnG12PMxvruWzc7i/4WRr5Y5+/VPv3HB/u+3WrHq7q7g0tK6kxhmqcNZbAJduL Bg+4Ft42lC8ApdLw9d+trT87ZN/Sm0mHHi4zKARf6lQNAKq4Nxe261H58thWMcACwJBT BaWw0BXqdMOH9VJdpZuPZuGgC7DB0OdzM0NfyLA6P4azP3Itm38VEFI74T9aN03+AVYc h+0/5Pyu1IZN8OfH77pxOLyBeJaWXARog3JJQ/h30NSXqR5lv89ZIsuiFlCJ6hU+0vDL yjkw== X-Gm-Message-State: AOJu0YyQJv86DnD14kyX1rwaEm8k2wTRdXeFXBEPHGtqmjGOidfsUsa2 TexOIDRFvzV1ZXn2MyWdEc/i20zbxW7ENA== X-Google-Smtp-Source: AGHT+IE2N6rkvzCeAgJXFcDfWuLf8mZGnEZo88+ZBSSqUXhFXDmgFImm23TXiOTZuEiNyLbK8uEgKg== X-Received: by 2002:a2e:8611:0:b0:2cc:70e8:bd6a with SMTP id a17-20020a2e8611000000b002cc70e8bd6amr2781632lji.83.1703081318050; Wed, 20 Dec 2023 06:08:38 -0800 (PST) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , Doug Goldstein , Stefano Stabellini Subject: [PATCH v6 2/9] automation: introduce fixed randconfig for RISC-V Date: Wed, 20 Dec 2023 16:08:24 +0200 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 This patch introduces the file riscv-fixed-randconfig.yaml, which includes all configurations that should be disabled for randconfig builds. Suggested-by: Stefano Stabellini Signed-off-by: Oleksii Kurochko --- Changes in V6: - The patch was introduced in this version of patch series. --- automation/gitlab-ci/build.yaml | 8 ++++---- automation/gitlab-ci/riscv-fixed-randconfig.yaml | 7 +++++++ 2 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 automation/gitlab-ci/riscv-fixed-randconfig.yaml diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml index 32af30cced..38cd93c306 100644 --- a/automation/gitlab-ci/build.yaml +++ b/automation/gitlab-ci/build.yaml @@ -516,6 +516,8 @@ alpine-3.18-gcc-debug-arm64-boot-cpupools: CONFIG_BOOT_TIME_CPUPOOLS=y # RISC-V 64 cross-build +include: 'automation/gitlab-ci/riscv-fixed-randconfig.yaml' + archlinux-current-gcc-riscv64: extends: .gcc-riscv64-cross-build variables: @@ -536,8 +538,7 @@ archlinux-current-gcc-riscv64-randconfig: CONTAINER: archlinux:current-riscv64 KBUILD_DEFCONFIG: tiny64_defconfig RANDCONFIG: y - EXTRA_FIXED_RANDCONFIG: - CONFIG_COVERAGE=n + EXTRA_FIXED_RANDCONFIG: !reference [.riscv-fixed-randconfig, variables, EXTRA_FIXED_RANDCONFIG] archlinux-current-gcc-riscv64-debug-randconfig: extends: .gcc-riscv64-cross-build-debug @@ -545,8 +546,7 @@ archlinux-current-gcc-riscv64-debug-randconfig: CONTAINER: archlinux:current-riscv64 KBUILD_DEFCONFIG: tiny64_defconfig RANDCONFIG: y - EXTRA_FIXED_RANDCONFIG: - CONFIG_COVERAGE=n + EXTRA_FIXED_RANDCONFIG: !reference [.riscv-fixed-randconfig, variables, EXTRA_FIXED_RANDCONFIG] # Power cross-build debian-bullseye-gcc-ppc64le: diff --git a/automation/gitlab-ci/riscv-fixed-randconfig.yaml b/automation/gitlab-ci/riscv-fixed-randconfig.yaml new file mode 100644 index 0000000000..f1282b40c9 --- /dev/null +++ b/automation/gitlab-ci/riscv-fixed-randconfig.yaml @@ -0,0 +1,7 @@ +.riscv-fixed-randconfig: + variables: + EXTRA_FIXED_RANDCONFIG: + CONFIG_COVERAGE=n + CONFIG_EXPERT=y + CONFIG_GRANT_TABLE=n + CONFIG_MEM_ACCESS=n From patchwork Wed Dec 20 14:08: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: 13500172 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 0614FC46CD2 for ; Wed, 20 Dec 2023 14:08:57 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.657916.1027032 (Exim 4.92) (envelope-from ) id 1rFxFc-0005U8-Dw; Wed, 20 Dec 2023 14:08:44 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 657916.1027032; Wed, 20 Dec 2023 14:08:44 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rFxFc-0005U1-9q; Wed, 20 Dec 2023 14:08:44 +0000 Received: by outflank-mailman (input) for mailman id 657916; Wed, 20 Dec 2023 14:08:43 +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 1rFxFb-0004kf-Eu for xen-devel@lists.xenproject.org; Wed, 20 Dec 2023 14:08:43 +0000 Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [2a00:1450:4864:20::230]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 4788be86-9f41-11ee-9b0f-b553b5be7939; Wed, 20 Dec 2023 15:08:41 +0100 (CET) Received: by mail-lj1-x230.google.com with SMTP id 38308e7fff4ca-2cc6ea4452cso44929741fa.1 for ; Wed, 20 Dec 2023 06:08:41 -0800 (PST) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id d19-20020a05651c089300b002cc83c337absm593892ljq.70.2023.12.20.06.08.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 06:08:40 -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: 4788be86-9f41-11ee-9b0f-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703081320; x=1703686120; 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=+ADPjgD2TlWeEknrZqZvtdHgKPvs94RdmhtWG2yb/sA=; b=OfWUeCQpXu43745ZVOiX6xF75/7Qd1lUlfJws+3LlblpRx12wsfW6P0G7AXwlRw+X1 U3/0HKRxlWxjhSW58IOE356PO1b4OPP6VKnk5Vs4tJuIbn+F+4T5xeUDU34kD/kVP5Gq UsAst4VOs3a0hcsaGlkD1Kl0nAvt4uUDdQp9WbUMJkDP9Y8ECY3AEQ7bJ4Gn1OWUEHSi EdHmybjHh7gDL2l4a6ydPRWWyzkIeWJgr9nb/QjXHx1/VRuwI7AEe7VEJ7P6IzemGqEg fu07MDeX9IZDWL5kNYjnaMtacvli4svv/aOmvOGDSCxJPniZ8zsaElLIPCVniEdmS19p sU8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703081320; x=1703686120; 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=+ADPjgD2TlWeEknrZqZvtdHgKPvs94RdmhtWG2yb/sA=; b=pvjLtDJG2g3fTGBckDmVz9CyWQ+gXR7iUkTr+Ofwg4rZEZepJMxowb6ZloQMHH03qc PjR48MScRFmhFaH60VYAMXez79NwlEafbGKcBB/fl/IaAeC2LWm+Y/KqUcjBRt8NZMk+ 8UOSaDu8Ui9K2C4eNpo1f5sTVTiq5+M/6CENNui/n/zl5vAoBO97qhPT+YrES9sG9uPv Z00Fyb95FCjX/EYqfjlvHteiBEZbN+ZKVTTK70igyX5SSHLbbYD2ZNBtcLrbxDZsMZ+V VdtTBwyB9FwHk1q+uXQ4rBYIJAuqngoGuNh/7orIIyvQh4MaJjm202u4CSqjL+MJ+ktV 1sZQ== X-Gm-Message-State: AOJu0YyiQYo1e3CqptT9D60itCg+CtDWP2dLgLcKDvRzVgayQwJoVjvI hBzAhEv7naC/GTOr3l3wi/jWIuU8ImPw7w== X-Google-Smtp-Source: AGHT+IFHbIW1oV/lSWxToAyOF0zV30j4IS4eZ/hNGe47yAAqjqHtqdVwXWWAiG5dDAPAhItea9Wgqw== X-Received: by 2002:a2e:a4b3:0:b0:2cc:1d8b:5466 with SMTP id g19-20020a2ea4b3000000b002cc1d8b5466mr7391370ljm.10.1703081320445; Wed, 20 Dec 2023 06:08:40 -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 v6 3/9] xen/asm-generic: introduce generic div64.h header Date: Wed, 20 Dec 2023 16:08:25 +0200 Message-ID: X-Mailer: git-send-email 2.43.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. Arm was switched partly because Arm has different implementation for 32-bits. Signed-off-by: Oleksii Kurochko Acked-by: Jan Beulich Acked-by: Shawn Anastasio Acked-by: Julien Grall --- Changes in V6: - Rebase only. --- Changes in V5: - add Acked-by: Shawn Anastasio - Update the commit message - Partly switch Arm's div64.h to asm-generic version. Arm has different implementation for 32-bits so only 64-bit version was switched. --- Changes in V4: - Added Acked-by: Jan Beulich . - include in Arm's div64.h for 64-bit case. --- Changes in V3: - Drop x86 and PPC's div64.h. - Update the commit message. --- Changes in V2: - rename base to divisor - add "#if BITS_PER_LONG == 64" - fix code style --- xen/arch/arm/include/asm/div64.h | 8 +------- xen/arch/ppc/include/asm/Makefile | 1 + xen/arch/ppc/include/asm/div64.h | 14 -------------- xen/arch/x86/include/asm/Makefile | 1 + xen/arch/x86/include/asm/div64.h | 14 -------------- xen/include/asm-generic/div64.h | 27 +++++++++++++++++++++++++++ 6 files changed, 30 insertions(+), 35 deletions(-) delete mode 100644 xen/arch/ppc/include/asm/div64.h delete mode 100644 xen/arch/x86/include/asm/div64.h create mode 100644 xen/include/asm-generic/div64.h diff --git a/xen/arch/arm/include/asm/div64.h b/xen/arch/arm/include/asm/div64.h index fc667a80f9..0459d5cc01 100644 --- a/xen/arch/arm/include/asm/div64.h +++ b/xen/arch/arm/include/asm/div64.h @@ -24,13 +24,7 @@ #if BITS_PER_LONG == 64 -# define do_div(n,base) ({ \ - uint32_t __base = (base); \ - uint32_t __rem; \ - __rem = ((uint64_t)(n)) % __base; \ - (n) = ((uint64_t)(n)) / __base; \ - __rem; \ - }) +#include #elif BITS_PER_LONG == 32 diff --git a/xen/arch/ppc/include/asm/Makefile b/xen/arch/ppc/include/asm/Makefile index 2da995bb2f..a8e848d4d0 100644 --- a/xen/arch/ppc/include/asm/Makefile +++ b/xen/arch/ppc/include/asm/Makefile @@ -1,5 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-only generic-y += altp2m.h +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 Wed Dec 20 14:08: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: 13500171 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 11FC1C4706C for ; Wed, 20 Dec 2023 14:08:57 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.657917.1027042 (Exim 4.92) (envelope-from ) id 1rFxFf-0005ou-S7; Wed, 20 Dec 2023 14:08:47 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 657917.1027042; Wed, 20 Dec 2023 14:08:47 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rFxFf-0005oZ-OH; Wed, 20 Dec 2023 14:08:47 +0000 Received: by outflank-mailman (input) for mailman id 657917; Wed, 20 Dec 2023 14:08:46 +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 1rFxFe-0004kf-FZ for xen-devel@lists.xenproject.org; Wed, 20 Dec 2023 14:08:46 +0000 Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [2a00:1450:4864:20::233]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 494ff2da-9f41-11ee-9b0f-b553b5be7939; Wed, 20 Dec 2023 15:08:44 +0100 (CET) Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-2cc6b5a8364so41467161fa.2 for ; Wed, 20 Dec 2023 06:08:44 -0800 (PST) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id d19-20020a05651c089300b002cc83c337absm593892ljq.70.2023.12.20.06.08.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 06:08: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: 494ff2da-9f41-11ee-9b0f-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703081323; x=1703686123; 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=7jf70xM9Lw8ScUvVg/zsyH4o0egKTjOtTh0z+8+kQOs=; b=WLYmOZF+bgtmgru5jLjZoul7oLrwGF3czaPabDya+zQIABcBszCOtzs3fTWvhHormA dc4QkWnFWe5r4QlYEmC07iS2m/80lVVqDCOfeo+d5N3ZCwg8Tgz+GVtb+UKt7+whIdRw Iqn/GgakVOUhljBiwkibiAA/9sbM4mflRp6tvyJs4ffyf91oeh7M61SpZyDBGY51Y1MZ D7GsoKmzpNYC50anQC/6ZanBASh7vGLdra2AEuuOmVKbRJNlB4A27vZVVM6JOyaygxOy CcX16L47MQiFXyjzN2tE+UhWUTAUwrbNbY9QlmvfxTJUkZcbCy7EbdojhMCftjs02ISn burA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703081323; x=1703686123; 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=7jf70xM9Lw8ScUvVg/zsyH4o0egKTjOtTh0z+8+kQOs=; b=S5p5kKsLtEksLvBcuDQxZZZiEFc9nF1O8cHdW+ItH1Tm/LNkvtfR0JsG4okJifMIhc vgMGA/RIY13DCHvqHxPWmiebBXnKKly8+zs/pABUMfFuE5qtdOIv5RxcRl9p1wfV8YgD eBNQDn5yrtR58I0oObeM8QcZ567rrAlzu4MflLeWnkrQ2zV/BmtrIxLdchl2J06fnDN+ V9JTxnU6PbZRsH6DPx89T2dfR3G0DqXQESv+mjirtoVPjs8rgN3y/ihxgiUEP5hNpbHv fcVrTk46Mg/x2tigEDxdnHanjr2lvuV7pvCSJlqgHjz8M/xXIaSQ6mBB4fiR+y91q6kr IR+Q== X-Gm-Message-State: AOJu0YyijJgFfh7HCccIBkAyC3n5HVlmophkUxu548OpaqkLE5M1gdFh XKFEDnl1MOW4gu4R70RzJs10iqRvzqqtiA== X-Google-Smtp-Source: AGHT+IHOeHconq3jj9jtskaQDnnkjl+YGg7Nsbq5vTJMwQ4eQJ48UkLy98EJKfCvf2wnrMAFd8nAoA== X-Received: by 2002:a2e:be9d:0:b0:2cc:6fb6:703 with SMTP id a29-20020a2ebe9d000000b002cc6fb60703mr3155533ljr.43.1703081323567; Wed, 20 Dec 2023 06:08:43 -0800 (PST) From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , Tamas K Lengyel , Alexandru Isaila , Petre Pircalabu , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk , Shawn Anastasio , Jan Beulich Subject: [PATCH v6 4/9] xen/asm-generic: introduce stub header monitor.h Date: Wed, 20 Dec 2023 16:08:26 +0200 Message-ID: <49c8e0f5997063ed65c3b135c0003ca9570c0bc6.1703072575.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 The header is shared between several archs so it is moved to asm-generic. Switch partly Arm and PPC to asm-generic/monitor.h and only arch_monitor_get_capabilities() left in arch-specific/monitor.h. Signed-off-by: Oleksii Kurochko Acked-by: Jan Beulich --- Changes in 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 | 28 +-------------- xen/arch/ppc/include/asm/monitor.h | 28 +-------------- xen/include/asm-generic/monitor.h | 57 ++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 54 deletions(-) create mode 100644 xen/include/asm-generic/monitor.h diff --git a/xen/arch/arm/include/asm/monitor.h b/xen/arch/arm/include/asm/monitor.h index 7567be66bd..045217c310 100644 --- a/xen/arch/arm/include/asm/monitor.h +++ b/xen/arch/arm/include/asm/monitor.h @@ -25,33 +25,7 @@ #include #include -static inline -void arch_monitor_allow_userspace(struct domain *d, bool allow_userspace) -{ -} - -static inline -int arch_monitor_domctl_op(struct domain *d, struct xen_domctl_monitor_op *mop) -{ - /* No arch-specific monitor ops on ARM. */ - return -EOPNOTSUPP; -} - -int arch_monitor_domctl_event(struct domain *d, - struct xen_domctl_monitor_op *mop); - -static inline -int arch_monitor_init_domain(struct domain *d) -{ - /* No arch-specific domain initialization on ARM. */ - return 0; -} - -static inline -void arch_monitor_cleanup_domain(struct domain *d) -{ - /* No arch-specific domain cleanup on ARM. */ -} +#include static inline uint32_t arch_monitor_get_capabilities(struct domain *d) { diff --git a/xen/arch/ppc/include/asm/monitor.h b/xen/arch/ppc/include/asm/monitor.h index e5b0282bf1..89000dacc6 100644 --- a/xen/arch/ppc/include/asm/monitor.h +++ b/xen/arch/ppc/include/asm/monitor.h @@ -6,33 +6,7 @@ #include #include -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 static inline uint32_t arch_monitor_get_capabilities(struct domain *d) { diff --git a/xen/include/asm-generic/monitor.h b/xen/include/asm-generic/monitor.h new file mode 100644 index 0000000000..74e4870cd7 --- /dev/null +++ b/xen/include/asm-generic/monitor.h @@ -0,0 +1,57 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * include/asm-generic/monitor.h + * + * Arch-specific monitor_op domctl handler. + * + * Copyright (c) 2015 Tamas K Lengyel (tamas@tklengyel.com) + * Copyright (c) 2016, Bitdefender S.R.L. + * + */ + +#ifndef __ASM_GENERIC_MONITOR_H__ +#define __ASM_GENERIC_MONITOR_H__ + +#include + +struct domain; +struct xen_domctl_monitor_op; + +static inline +void arch_monitor_allow_userspace(struct domain *d, bool allow_userspace) +{ +} + +static inline +int arch_monitor_domctl_op(struct domain *d, struct xen_domctl_monitor_op *mop) +{ + /* No arch-specific monitor ops on GENERIC. */ + return -EOPNOTSUPP; +} + +int arch_monitor_domctl_event(struct domain *d, + struct xen_domctl_monitor_op *mop); + +static inline +int arch_monitor_init_domain(struct domain *d) +{ + /* No arch-specific domain initialization on GENERIC. */ + return 0; +} + +static inline +void arch_monitor_cleanup_domain(struct domain *d) +{ + /* No arch-specific domain cleanup on GENERIC. */ +} + +#endif /* __ASM_GENERIC_MONITOR_H__ */ + +/* + * Local variables: + * mode: C + * c-file-style: BSD + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ From patchwork Wed Dec 20 14:08: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: 13500170 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 77BBDC4706E for ; Wed, 20 Dec 2023 14:08:57 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.657918.1027047 (Exim 4.92) (envelope-from ) id 1rFxFg-0005sY-6Y; Wed, 20 Dec 2023 14:08:48 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 657918.1027047; Wed, 20 Dec 2023 14:08:48 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rFxFg-0005sE-23; Wed, 20 Dec 2023 14:08:48 +0000 Received: by outflank-mailman (input) for mailman id 657918; Wed, 20 Dec 2023 14:08:47 +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 1rFxFf-0004kf-Fo for xen-devel@lists.xenproject.org; Wed, 20 Dec 2023 14:08:47 +0000 Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [2a00:1450:4864:20::22d]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 49db9176-9f41-11ee-9b0f-b553b5be7939; Wed, 20 Dec 2023 15:08:45 +0100 (CET) Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2ca0715f0faso69704361fa.0 for ; Wed, 20 Dec 2023 06:08:45 -0800 (PST) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id d19-20020a05651c089300b002cc83c337absm593892ljq.70.2023.12.20.06.08.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 06:08:44 -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: 49db9176-9f41-11ee-9b0f-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703081325; x=1703686125; 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=ILg80GpPtrLjK/GDu/egRBjnqwnshJth8WFMEojdQNQ=; b=XFj53WTxA4bLsdxuw67Uyj8ug6W65c5+KwxJUq+v/lkFNscrUl7omvf3mWJ/eS1/85 O+Q3mc0vbFgMKIoLmOamjw8DnT70Li+XBfYwERX70hhMaHZheSWKD91+c54b8OSY5JhJ fCg3Fm1LrGA48jAWFfqsvu+p+C7AcQLXTLRiQU803QcWZDs/+4Om/oxZimCVHilySFRo BuuxHTEYlGM8YS30SFH7fay3toxtGTUKVEBDcf1UpZb0IMj1dnH70lJt+qrufmgFScli XIYXTt4GdN/3RFsmGfJSJKJ6iC+qTO/6KANuD9Ruy6cvRbFzUxi1dUzoy8SvrIiYATON iPEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703081325; x=1703686125; 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=ILg80GpPtrLjK/GDu/egRBjnqwnshJth8WFMEojdQNQ=; b=PL9yzVLe8kAuWIZ+3Prf/xwDYRtNxQ3jeDqdmjWkBNw6un2ZU9FmnOGgphlroW2fma SoXSlcTlho13vB5OAxtyxcAIJPN6qrIIH2IHk2PBn9XsHMxboGh7ymCRFZcoZ/O0V6x0 sYO+e01K08qoezjxKUEMux06WvAq8uxbfrBx+6aLJbtKYobmRT+nH86Ye1VYu4oF0JJG UT5KpMAdsRtH55yuA3aLChyh9GyIVjgkURcKbPMnTxvwimNHax98NekdJ5+KkKOdAqYc jqFotItmg6ehTvYzxrYIt75KRnslFNwmG4gNo6EI5yP1h8FGJ3A6uPx22m+22ICT7diq N9rw== X-Gm-Message-State: AOJu0YxFFPasEDIoZOj9lBuo27uoy5wmQU9OpVbMsYvlpjyyWS+PLEN1 H+xS9p+GnJOyXYB47XrIcgjtOwb+tbdu4A== X-Google-Smtp-Source: AGHT+IGcPv0azV6t4fDEFPg/d6JC+i7zv+P7H6/F+52hBHMP1YYTuLgIID6wBj6LJhjMgZuA3AW1Kw== X-Received: by 2002:a05:651c:2207:b0:2cc:21eb:f14b with SMTP id y7-20020a05651c220700b002cc21ebf14bmr7960037ljq.64.1703081324863; Wed, 20 Dec 2023 06:08: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 v6 5/9] xen/asm-generic: introduce stub header numa.h Date: Wed, 20 Dec 2023 16:08:27 +0200 Message-ID: <08bca9a4158a190a0a953e5bc071a512cfe5f0f8.1703072575.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.43.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 Acked-by: Jan Beulich Acked-by: Shawn Anastasio Signed-off-by: Jan Beulich --- Changes in V6: - Rebase only. --- Changes in V5: - Added Acked-by: Jan Beulich - Updated the comment around first_valid_mfn. ( Arm -> GENERIC ) - Added Acked-by: Shawn Anastasio --- Changes in V4: - Updated guards name: *ARCH_GENERIC* -> *ASM_GENERIC*. - Moved inclusion of xen/mm-frame.h under "#ifndef CONFIG_NUMA". - Added Reviewed-by: Michal Orzel . --- Changes in V3: - Remove old header inclusion in asm-generic numa.h and include and - Drop Arm and PPC's numa.h and use asm-generic version instead. --- Changes in V2: - update the commit message. - change u8 to uint8_t. - add ifnded CONFIG_NUMA. --- xen/arch/arm/include/asm/Makefile | 1 + xen/arch/ppc/include/asm/Makefile | 1 + xen/arch/ppc/include/asm/numa.h | 26 ------------------- .../asm => include/asm-generic}/numa.h | 16 +++++++----- 4 files changed, 12 insertions(+), 32 deletions(-) delete mode 100644 xen/arch/ppc/include/asm/numa.h rename xen/{arch/arm/include/asm => include/asm-generic}/numa.h (67%) 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 a8e848d4d0..f09c5ea8a1 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 += 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 67% rename from xen/arch/arm/include/asm/numa.h rename to xen/include/asm-generic/numa.h index e2bee2bd82..7f95a77e89 100644 --- a/xen/arch/arm/include/asm/numa.h +++ b/xen/include/asm-generic/numa.h @@ -1,18 +1,21 @@ -#ifndef __ARCH_ARM_NUMA_H -#define __ARCH_ARM_NUMA_H +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ASM_GENERIC_NUMA_H +#define __ASM_GENERIC_NUMA_H -#include +#include -typedef u8 nodeid_t; +typedef uint8_t nodeid_t; #ifndef CONFIG_NUMA +#include + /* Fake one node for now. See also node_online_map. */ #define cpu_to_node(cpu) 0 #define node_to_cpumask(node) (cpu_online_map) /* - * TODO: make first_valid_mfn static when NUMA is supported on Arm, this + * TODO: make first_valid_mfn static when NUMA is supported on GENERIC, this * is required because the dummy helpers are using it. */ extern mfn_t first_valid_mfn; @@ -26,7 +29,8 @@ extern mfn_t first_valid_mfn; #define arch_want_default_dmazone() (false) -#endif /* __ARCH_ARM_NUMA_H */ +#endif /* __ASM_GENERIC_NUMA_H */ + /* * Local variables: * mode: C From patchwork Wed Dec 20 14:08: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: 13500173 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 0342AC46CD8 for ; Wed, 20 Dec 2023 14:08:59 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.657919.1027061 (Exim 4.92) (envelope-from ) id 1rFxFh-0006L5-Jf; Wed, 20 Dec 2023 14:08:49 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 657919.1027061; Wed, 20 Dec 2023 14:08: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 1rFxFh-0006JC-FI; Wed, 20 Dec 2023 14:08:49 +0000 Received: by outflank-mailman (input) for mailman id 657919; Wed, 20 Dec 2023 14:08:48 +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 1rFxFg-0005qp-9i for xen-devel@lists.xenproject.org; Wed, 20 Dec 2023 14:08:48 +0000 Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [2a00:1450:4864:20::236]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 4ae4d8ef-9f41-11ee-98eb-6d05b1d4d9a1; Wed, 20 Dec 2023 15:08:47 +0100 (CET) Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2cc2238f597so65396841fa.3 for ; Wed, 20 Dec 2023 06:08:47 -0800 (PST) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id d19-20020a05651c089300b002cc83c337absm593892ljq.70.2023.12.20.06.08.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 06:08: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: 4ae4d8ef-9f41-11ee-98eb-6d05b1d4d9a1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703081326; x=1703686126; 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=CMUlgSBxCWCXkSsj9cINsTG5a1nZhYKU/HqbJseXVoU=; b=HlY+wdF16q0/4KiSlhYRsZ9NGO+fwOej9B8huqLhTTZkTRGeGqQpSHxlt7bSHqy6Os zuYFHPLdSo7FXhhTZMtlo7AmmHyvZfemImuZ7nY/vavR+aSmoT5BILxEGT1n7nayYBeN 21bMxQGKfmPgpHbGOG1yqbYOZRECpzIr34SgZiXPhu74xsm/vkw892tv7IScBWAcloBr Co72ugZ5rG7FZs2xdyGCpgRF19WHsyuaRkwPdFuBREb7iVDpjgS++fA3dq3ON/jknUFO +7JUpt4FG44IkA1zYemu4+ofNKpe85BQAUCLG9Ka8IuHL1eSya7ms+Uzg1IYwiYz7z8n oumQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703081326; x=1703686126; 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=CMUlgSBxCWCXkSsj9cINsTG5a1nZhYKU/HqbJseXVoU=; b=wUKSlN0Tul5QEuGR7mnuxJnZjOaH6uhnX4mlCe0iUREN34jYttffFYil2N1nbEcDN0 ZgyzbB8fgxBk/QGWXPC+VjONpK1vCg/0yVWf09+sBYbR5UTRuV1IE085H9yyVtRKEqiT ZlU6R6dOptX9jmaLDnAjXT453eT5NOhZq9SCJeyY/YEbEX1Ko8hasatQyNKiFSDbpgBs bxLIUonIvCxVcSt7Eg5DeqTvS73fN1So6D0zb2YoD4VZCRcww5d2rDyVKEfb//Eh78x5 ABaZN04yq4UHg18GqJyLiRVI017Jkbh/bBKKKIph/66Zf5DIrJ5ORoRMN49g1SmgmASo 4nUA== X-Gm-Message-State: AOJu0YxENJ1XgIuGatnIFz3INXiqpaBljd0aBgPrFYT725LVUVp0IPhG 1xZUHm/TRpvN4ClPbJ+yyjAdjYbGjWHTPA== X-Google-Smtp-Source: AGHT+IEfChI0P3tcjFVddHZMLISQh9YGv7E6OyCh9OqV7Oklb/elJObhGyvKyf4RQpnLGvKmjgRfYg== X-Received: by 2002:a2e:781a:0:b0:2cc:7104:210c with SMTP id t26-20020a2e781a000000b002cc7104210cmr1396245ljc.146.1703081326044; Wed, 20 Dec 2023 06:08:46 -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 v6 6/9] xen/asm-generic: introduce stub header softirq.h Date: Wed, 20 Dec 2023 16:08:28 +0200 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 is common between Arm, PPC and RISC-V so it is moved to asm-generic. Drop Arm and PPC's softirq.h and use asm-generic version instead. Signed-off-by: Oleksii Kurochko Reviewed-by: Michal Orzel Acked-by: Jan Beulich Acked-by: Shawn Anastasio Acked-by: Julien Grall --- Changes in V6: - Rebase only. --- Changes in V5: - Strayed "Added" in commit message - Added Acked-by: Shawn Anastasio --- Changes in V4: - Added Reviewed-by: Michal Orzel - Added Acked-by: Jan Beulich --- Changes in V3: - Drop Arm and PPC's softirq.h - Update the commit message. --- Changes in V2: - update the commit message. --- xen/arch/arm/include/asm/Makefile | 1 + xen/arch/ppc/include/asm/Makefile | 1 + xen/arch/ppc/include/asm/softirq.h | 8 -------- .../arm/include/asm => 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 f09c5ea8a1..efd72862c8 100644 --- a/xen/arch/ppc/include/asm/Makefile +++ b/xen/arch/ppc/include/asm/Makefile @@ -8,4 +8,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 Wed Dec 20 14:08: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: 13500174 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 E46EDC3DA6E for ; Wed, 20 Dec 2023 14:08:59 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.657920.1027072 (Exim 4.92) (envelope-from ) id 1rFxFj-0006eZ-0R; Wed, 20 Dec 2023 14:08:51 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 657920.1027072; Wed, 20 Dec 2023 14:08: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 1rFxFi-0006d5-Qo; Wed, 20 Dec 2023 14:08:50 +0000 Received: by outflank-mailman (input) for mailman id 657920; Wed, 20 Dec 2023 14:08:49 +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 1rFxFh-0005qp-8c for xen-devel@lists.xenproject.org; Wed, 20 Dec 2023 14:08:49 +0000 Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [2a00:1450:4864:20::22b]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 4bb7eba4-9f41-11ee-98eb-6d05b1d4d9a1; Wed, 20 Dec 2023 15:08:48 +0100 (CET) Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2cc6121c113so50310991fa.0 for ; Wed, 20 Dec 2023 06:08:48 -0800 (PST) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id d19-20020a05651c089300b002cc83c337absm593892ljq.70.2023.12.20.06.08.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 06:08: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: 4bb7eba4-9f41-11ee-98eb-6d05b1d4d9a1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703081327; x=1703686127; 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=LbK8RQwLkr5f4USBRDmd1xzxpVRjYgivBsP0FHFB0fg=; b=nWbY9DkvwqpG5l7wXsuSQsrBotdH5Yar+qafXcFzCrxF26zPR39fN8Bqwxdcn8qXwa hyELEEXI6U7OU7vJ2UoZDgtwjmmsicMmdCYpXc/iJSD+AtF0h6GeaI1Lq2KjcNX2vTHR azfjYlWWgNhQpndW8CkNDNcWE9lf1SfPCra70rNhEociz5fZV/sp9pt/iBZWZMs+KGwW BDyIuKGJrFvWUaVks0nSIrhpx5PaTkEFeaY7jaBQCa2tLKZnsXdL39U24GqQko2FVK8L 1ZCmYpBxxn6l8R8ePnSLFJhWIA9/n5jBGzJpymg76ZpFhjsu7Y1dHPCiv14NIqnU2TFI uHrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703081327; x=1703686127; 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=LbK8RQwLkr5f4USBRDmd1xzxpVRjYgivBsP0FHFB0fg=; b=ck0CjXdt2gWnJInud+5tzLdhRrSdp5q/sjROpfC4LCIydM6OyiXMC1V2MNzNslqBeI ahBbsdriwkylaaXG0O2vliLyl/+FJ+7a8I4xvrSSykXWiolKE0aiTHC24aLpLJO8ds1R biiq7JpgyVeizv6OpuFixKEwSF594EksT8LI75hfNLd1ML6mGZr1cUCwNWNIk+zG4sdo H3B5RPSJ/7hQIgbmPUY1T4ahtFqxB6vPtMkl9YIflm1aOwMK5HlNuXoh1Np+T0j1EW/P ZE4c/tWKFtWGQkR0W8FQghPYvKzLBhQxcc7GbifqraeWUea4nNnNq+hi1U02xFDVswTQ pZEg== X-Gm-Message-State: AOJu0YzmYTiV3j/3gr04mrmV6ZHBymU69/PKDgDuHTv+McOllt39wZvF jfYZ/2e5+aVqGgAVe+iP9uK0iYi0ylU1HQ== X-Google-Smtp-Source: AGHT+IHn1sfQ+dcmY3UMrZ9dsWrwzOLfkaxkBYOm7UbBVwyle+g/qca4wQn1PTi/h6E6hrMBm0WmfA== X-Received: by 2002:a2e:90cd:0:b0:2cc:8b70:9082 with SMTP id o13-20020a2e90cd000000b002cc8b709082mr396636ljg.136.1703081327521; Wed, 20 Dec 2023 06:08:47 -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 v6 7/9] xen: ifdef inclusion of in Date: Wed, 20 Dec 2023 16:08:29 +0200 Message-ID: X-Mailer: git-send-email 2.43.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 Acked-by: Julien Grall Acked-by: Shawn Anastasio --- Changes in V6: - Remove the way how CONFIG_GRANT_TABLE is disabled for PPC and RISC-V. --- Changes in V5: - Added dependencies for "Config GRANT_TABLE" to be sure that randconfig will not turn on the config. --- Changes in V4: - Nothing changed. Only rebase. --- Changes in V3: - Remove unnecessary comment. --- xen/arch/arm/domain_build.c | 1 + xen/arch/ppc/include/asm/grant_table.h | 5 ----- xen/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 6945b9755d..46161848dc 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -36,6 +36,7 @@ #include #include +#include #include static unsigned int __initdata opt_dom0_max_vcpus; 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 Wed Dec 20 14:08: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: 13500175 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 A026EC3DA6E for ; Wed, 20 Dec 2023 14:09:02 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.657921.1027082 (Exim 4.92) (envelope-from ) id 1rFxFk-0006yQ-Hk; Wed, 20 Dec 2023 14:08:52 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 657921.1027082; Wed, 20 Dec 2023 14:08: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 1rFxFk-0006xY-Di; Wed, 20 Dec 2023 14:08:52 +0000 Received: by outflank-mailman (input) for mailman id 657921; Wed, 20 Dec 2023 14:08:51 +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 1rFxFj-0004kf-8t for xen-devel@lists.xenproject.org; Wed, 20 Dec 2023 14:08:51 +0000 Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [2a00:1450:4864:20::236]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 4c352719-9f41-11ee-9b0f-b553b5be7939; Wed, 20 Dec 2023 15:08:49 +0100 (CET) Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2ca02def690so67130441fa.3 for ; Wed, 20 Dec 2023 06:08:49 -0800 (PST) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id d19-20020a05651c089300b002cc83c337absm593892ljq.70.2023.12.20.06.08.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 06:08:48 -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: 4c352719-9f41-11ee-9b0f-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703081329; x=1703686129; 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=59F7K5RNi8wsdT3N0XNqdjgmsgxFVNgSxjJCoU/Uuzw=; b=VZBNY9zGE5bd3hlZYkcXOKF9gYvsyo/jeOBhOWYhNtKRJgJTw5EU6UeW4maIUMsdxJ o/biEA0Ec5eEmewOglx9q/NLQsERcYePUoRsEyDMoHJ4/Vmo0C9C5LLC04AeKg9U6gSV q6B803wu1VjJ3DDJbbIJTqs/1maOWYB0pawFDK5Azl8zFE1PgK+J/6Gwhulo96878qwd Yr/m3bw74NlT43ch6M98avLY4owHqxyoPGpLiV1RgvwelMnnkN4FbUm4mH0jDlVrGVRj PwZWSE7KjqN6aI+zpQtOiHRwV9rCyFK56tupp1nfEY5FzU9Y1/z4zJzaPm08ffXTdFPY TpmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703081329; x=1703686129; 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=59F7K5RNi8wsdT3N0XNqdjgmsgxFVNgSxjJCoU/Uuzw=; b=kGeFNYes4YxQmk2sE9MYJmuB9pNjK3sqZjOuMlyVYoI8dlLfNeLjcp7MzycPo/SooX KT8buAFRLFbpbsLHsn+lqcL8A9eL33dk3zVxDfaW+vxlVV/Z88QW7bdPSBKd7vIFkn3J iRzyy/HF3YC3WZmA1Qhk3qf8kMbHymoCdQ/D+2mzBh0Mn+Celf8XJtGBIkWtd/FgrfCz 9HORD63t/lTjcEYWeoIb6SfMC1DMk8JwT1B8Y7eyXJj/idJAl/t+vp2LuTzhnEH6bo/R JsM30Rx0BMl7vYjmZb4KodX7AMZiyvjfFUnUIqWWpyi8DzB/cLotLsEP/VCqBfPyZPCd zkug== X-Gm-Message-State: AOJu0YyZ053wgw8bASt/LWDbT6m6r1hj9PDFHJHieIP0U2D7PS1Uqpir hjEApBLP/Geyf3uiRlEs0GYogJFeN2e2jQ== X-Google-Smtp-Source: AGHT+IGCP8WMWEHDSvexERJdAvmNWIbOs1nV9wgHM3v5bA664gKzx0U2bnh8LKnfPqAb2V/IT34nqg== X-Received: by 2002:a2e:a705:0:b0:2cc:3793:5575 with SMTP id s5-20020a2ea705000000b002cc37935575mr4954186lje.93.1703081328943; Wed, 20 Dec 2023 06:08: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 , Shawn Anastasio , Tamas K Lengyel , Alexandru Isaila , Petre Pircalabu , Alistair Francis , Bob Eshleman , Connor Davis , Jan Beulich Subject: [PATCH v6 8/9] xen/asm-generic: ifdef inclusion of Date: Wed, 20 Dec 2023 16:08:30 +0200 Message-ID: X-Mailer: git-send-email 2.43.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 Acked-by: Shawn Anastasio --- 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 will 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 diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c index 3784e8276e..37a457f4b1 100644 --- a/xen/arch/arm/traps.c +++ b/xen/arch/arm/traps.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include diff --git a/xen/arch/ppc/configs/ppc64_defconfig b/xen/arch/ppc/configs/ppc64_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 CONFIG_PPC64=y CONFIG_DEBUG=y 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/arch/riscv/configs/tiny64_defconfig b/xen/arch/riscv/configs/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 CONFIG_RISCV_64=y CONFIG_DEBUG=y 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 From patchwork Wed Dec 20 14:08: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: 13500176 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 3463BC3DA6E for ; Wed, 20 Dec 2023 14:09:05 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.657922.1027092 (Exim 4.92) (envelope-from ) id 1rFxFn-0007Ne-2s; Wed, 20 Dec 2023 14:08:55 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 657922.1027092; Wed, 20 Dec 2023 14:08: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 1rFxFm-0007NF-TY; Wed, 20 Dec 2023 14:08:54 +0000 Received: by outflank-mailman (input) for mailman id 657922; Wed, 20 Dec 2023 14:08:53 +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 1rFxFl-0004kf-It for xen-devel@lists.xenproject.org; Wed, 20 Dec 2023 14:08:53 +0000 Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [2a00:1450:4864:20::231]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 4d5a4a11-9f41-11ee-9b0f-b553b5be7939; Wed, 20 Dec 2023 15:08:51 +0100 (CET) Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2cc88818ff0so7978951fa.0 for ; Wed, 20 Dec 2023 06:08:51 -0800 (PST) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id d19-20020a05651c089300b002cc83c337absm593892ljq.70.2023.12.20.06.08.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 06:08: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: 4d5a4a11-9f41-11ee-9b0f-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703081330; x=1703686130; 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=l5hZac8T3jtrrOdrwYepDlnvnIB7as+Cequ/jYw4TJQ=; b=HDl0koUi7HoSeFsD3CCpXaoqQYBXvCWW2zEHXg0eywG+N+NcbC4IfDWsUHtjKegHk8 t8wn5HlsvjYR2sKWR6+6WrynrUVGf52Ew+J/gdr5D208c50xIiS8HXrPDWBev/LC9aYy d1KzR2TbhOH0ZQ8sWulbQuKe+kcFHXxwlHV1vNJSlyKzTjFdvCSfyEdhEqAIKGPq1hKO Cdx2JA9I5V+RFvOluwvbteXnW8E7btpmNSbcG4iNBAUyHGDggS09t2k84S8USm5K+Aqx XZelxpCqz10uLxXqQy4deEucjqdJt10rC3aIQ82n3oTePHaTtDyVmXgmR/lkxcnVDrEs VB9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703081330; x=1703686130; 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=l5hZac8T3jtrrOdrwYepDlnvnIB7as+Cequ/jYw4TJQ=; b=J4mmvJE+7PcEZSXXRGBwEigA4iTbOradsNCq1YOPoe/pwVPmVwl7Kmh9Wzq7cWTdIK Z/OyT7JBa9Q+Rd0Yjwz9ncHfrvy24f8WslBLO5iL3fEuRPq5+7Y89L8W1QsTiCcFI6sZ 1XRMD7Pi+ztllWH8/oe8v8g2kFjN8knoAyzsnYgIbs9A0fX6eziWhHNmqI9hNHXvwg23 ZNhgAkcyeP5k2/tSs7LiKWt4TyDtMWqUbueoL3zNrCRLdqhuMBicorcK1uQO2pl2Ekqt Cn0yZYenLW+EZag7MYIVvJGBj3jMsFN2QkgkLjUNUjwzm/UaAlOCpZKuyWxJdy/XJM50 t/Wg== X-Gm-Message-State: AOJu0YzcP7zKAhP78klfCtA87eIamjQ1Og/rb6UQvO9s1rc3pxfphuym 2bhgspdnqaiJdYT7wzGisFFsR5IaSItXJQ== X-Google-Smtp-Source: AGHT+IHeZWoaNplXjFJwqDGfAWMCs59YzB4vAzO6nirkM+j526FuX3lgGxa0m7RVeqSvthqMkW0r6Q== X-Received: by 2002:a05:651c:201d:b0:2cc:9320:bccb with SMTP id s29-20020a05651c201d00b002cc9320bccbmr505992ljo.2.1703081330318; Wed, 20 Dec 2023 06:08:50 -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 v6 9/9] xen/asm-generic: introduce generic device.h Date: Wed, 20 Dec 2023 16:08:31 +0200 Message-ID: <55d6810e2f8b0f54261c504354bf879c5b887c40.1703072575.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.43.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. - #ifdef-ing iommu related things with CONFIG_HAS_PASSTHROUGH. Also Arm and PPC are switched to asm-generic version of device.h Signed-off-by: Oleksii Kurochko --- Jan wrote the following: Overall I think there are too many changes done all in one go here. But it's mostly Arm which is affected, so I'll leave judging about that to the Arm maintainers. Arm maintainers, will it be fine for you to not split the patch? --- 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/arch/arm/device.c | 15 ++- xen/arch/arm/domain_build.c | 2 +- xen/arch/arm/gic-v2.c | 4 +- xen/arch/arm/gic-v3.c | 6 +- xen/arch/arm/gic.c | 4 +- xen/arch/arm/include/asm/Makefile | 1 + xen/arch/ppc/include/asm/Makefile | 1 + xen/arch/ppc/include/asm/device.h | 53 -------- .../asm => include/asm-generic}/device.h | 125 +++++++++++------- 9 files changed, 102 insertions(+), 109 deletions(-) delete mode 100644 xen/arch/ppc/include/asm/device.h rename xen/{arch/arm/include/asm => include/asm-generic}/device.h (79%) diff --git a/xen/arch/arm/device.c b/xen/arch/arm/device.c index 1f631d3274..affbe79f9a 100644 --- a/xen/arch/arm/device.c +++ b/xen/arch/arm/device.c @@ -16,7 +16,10 @@ #include extern const struct device_desc _sdevice[], _edevice[]; + +#ifdef CONFIG_ACPI extern const struct acpi_device_desc _asdevice[], _aedevice[]; +#endif 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 device_class class, return -EBADF; } +#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, const void *data, int class return -EBADF; } +#endif enum device_class device_get_class(const struct dt_device_node *dev) { @@ -329,9 +334,13 @@ int handle_device(struct domain *d, struct dt_device_node *dev, p2m_type_t p2mt, struct map_range_data mr_data = { .d = d, .p2mt = p2mt, - .skip_mapping = !own_device || - (is_pci_passthrough_enabled() && - (device_get_class(dev) == DEVICE_PCI_HOSTBRIDGE)), + .skip_mapping = + !own_device +#ifdef CONFIG_HAS_PCI + || (is_pci_passthrough_enabled() && + (device_get_class(dev) == DEVICE_PCI_HOSTBRIDGE)) +#endif + , .iomem_ranges = iomem_ranges, .irq_ranges = irq_ranges }; 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, struct 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) == DEVICE_GIC ) + if ( device_get_class(node) == 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 = { /* sentinel */ }, }; -DT_DEVICE_START(gicv2, "GICv2", DEVICE_GIC) +DT_DEVICE_START(gicv2, "GICv2", DEVICE_INTERRUPT_CONTROLLER) .dt_match = gicv2_dt_match, .init = gicv2_dt_preinit, DT_DEVICE_END @@ -1381,7 +1381,7 @@ static int __init gicv2_acpi_preinit(const void *data) return 0; } -ACPI_DEVICE_START(agicv2, "GICv2", DEVICE_GIC) +ACPI_DEVICE_START(agicv2, "GICv2", DEVICE_INTERRUPT_CONTROLLER) .class_type = ACPI_MADT_GIC_VERSION_V2, .init = gicv2_acpi_preinit, ACPI_DEVICE_END diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c index 18289cd645..9e135aeb3d 100644 --- a/xen/arch/arm/gic-v3.c +++ b/xen/arch/arm/gic-v3.c @@ -1879,7 +1879,7 @@ static const struct dt_device_match gicv3_dt_match[] __initconst = { /* sentinel */ }, }; -DT_DEVICE_START(gicv3, "GICv3", DEVICE_GIC) +DT_DEVICE_START(gicv3, "GICv3", DEVICE_INTERRUPT_CONTROLLER) .dt_match = gicv3_dt_match, .init = gicv3_dt_preinit, DT_DEVICE_END @@ -1894,12 +1894,12 @@ static int __init gicv3_acpi_preinit(const void *data) return 0; } -ACPI_DEVICE_START(agicv3, "GICv3", DEVICE_GIC) +ACPI_DEVICE_START(agicv3, "GICv3", DEVICE_INTERRUPT_CONTROLLER) .class_type = ACPI_MADT_GIC_VERSION_V3, .init = gicv3_acpi_preinit, ACPI_DEVICE_END -ACPI_DEVICE_START(agicv4, "GICv4", DEVICE_GIC) +ACPI_DEVICE_START(agicv4, "GICv4", DEVICE_INTERRUPT_CONTROLLER) .class_type = ACPI_MADT_GIC_VERSION_V4, .init = 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; - rc = device_init(node, DEVICE_GIC, NULL); + rc = 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) dist = container_of(header, struct acpi_madt_generic_distributor, header); - 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/Makefile index a28cc5d1b1..c3f4291ee2 100644 --- a/xen/arch/arm/include/asm/Makefile +++ b/xen/arch/arm/include/asm/Makefile @@ -1,5 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-only generic-y += altp2m.h +generic-y += device.h generic-y += hardirq.h generic-y += iocap.h generic-y += numa.h diff --git a/xen/arch/ppc/include/asm/Makefile b/xen/arch/ppc/include/asm/Makefile index efd72862c8..adb752b804 100644 --- a/xen/arch/ppc/include/asm/Makefile +++ b/xen/arch/ppc/include/asm/Makefile @@ -1,5 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-only generic-y += altp2m.h +generic-y += device.h generic-y += div64.h generic-y += hardirq.h generic-y += hypercall.h diff --git a/xen/arch/ppc/include/asm/device.h b/xen/arch/ppc/include/asm/device.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") = { \ - .name = namestr_, \ - .class = class_, \ - -#define DT_DEVICE_END \ -}; - -#endif /* __ASM_PPC_DEVICE_H__ */ diff --git a/xen/arch/arm/include/asm/device.h b/xen/include/asm-generic/device.h similarity index 79% rename from xen/arch/arm/include/asm/device.h rename to xen/include/asm-generic/device.h index b5d451e087..063c448c4e 100644 --- a/xen/arch/arm/include/asm/device.h +++ b/xen/include/asm-generic/device.h @@ -1,14 +1,37 @@ -#ifndef __ASM_ARM_DEVICE_H -#define __ASM_ARM_DEVICE_H +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ASM_GENERIC_DEVICE_H__ +#define __ASM_GENERIC_DEVICE_H__ + +#include enum device_type { +#ifdef CONFIG_HAS_DEVICE_TREE DEV_DT, +#endif + +#ifdef CONFIG_HAS_PCI DEV_PCI, +#endif + DEV_TYPE_MAX, +}; + +enum device_class +{ + DEVICE_SERIAL, + DEVICE_IOMMU, + DEVICE_INTERRUPT_CONTROLLER, +#ifdef CONFIG_HAS_PCI + DEVICE_PCI_HOSTBRIDGE, +#endif + /* Use for error */ + DEVICE_UNKNOWN, }; struct dev_archdata { +#ifdef CONFIG_HAS_PASSTHROUGH void *iommu; /* IOMMU private data */ +#endif }; /* struct device - The basic device structure */ @@ -19,31 +42,65 @@ struct device struct dt_device_node *of_node; /* Used by drivers imported from Linux */ #endif struct dev_archdata archdata; +#ifdef CONFIG_HAS_PASSTHROUGH struct iommu_fwspec *iommu_fwspec; /* per-device IOMMU instance data */ +#endif }; typedef struct device device_t; +#ifdef CONFIG_HAS_DEVICE_TREE + #include -#define dev_is_pci(dev) ((dev)->type == DEV_PCI) #define dev_is_dt(dev) ((dev)->type == DEV_DT) -enum device_class -{ - DEVICE_SERIAL, - DEVICE_IOMMU, - DEVICE_GIC, - DEVICE_PCI_HOSTBRIDGE, - /* Use for error */ - DEVICE_UNKNOWN, +/** + * device_init - Initialize a device + * @dev: device to initialize + * @class: class of the device (serial, network...) + * @data: specific data for initializing the device + * + * Return 0 on success. + */ +int device_init(struct dt_device_node *dev, enum device_class class, + const void *data); + +/** + * device_get_type - Get the type of the device + * @dev: device to match + * + * Return the device type on success or DEVICE_ANY on failure + */ +enum device_class device_get_class(const struct dt_device_node *dev); + +#define DT_DEVICE_START(_name, _namestr, _class) \ +static const struct device_desc __dev_desc_##_name __used \ +__section(".dev.info") = { \ + .name = _namestr, \ + .class = _class, \ + +#define DT_DEVICE_END \ }; +#else /* !CONFIG_HAS_DEVICE_TREE */ +#define dev_is_dt(dev) ((void)(dev), false) +#endif /* CONFIG_HAS_DEVICE_TREE */ + +#ifdef CONFIG_HAS_PCI +#define dev_is_pci(dev) ((dev)->type == DEV_PCI) +#else +#define dev_is_pci(dev) ((void)(dev), false) +#endif + struct device_desc { /* Device name */ const char *name; /* Device class */ enum device_class class; + +#ifdef CONFIG_HAS_DEVICE_TREE + /* List of devices supported by this driver */ const struct dt_device_match *dt_match; /* @@ -52,8 +109,12 @@ struct device_desc { * -EAGAIN is used to indicate that device probing is deferred. */ int (*init)(struct dt_device_node *dev, const void *data); + +#endif }; +#ifdef CONFIG_ACPI + struct acpi_device_desc { /* Device name */ const char *name; @@ -75,44 +136,18 @@ struct acpi_device_desc { int acpi_device_init(enum device_class class, const void *data, int class_type); -/** - * device_init - Initialize a device - * @dev: device to initialize - * @class: class of the device (serial, network...) - * @data: specific data for initializing the device - * - * Return 0 on success. - */ -int device_init(struct dt_device_node *dev, enum device_class class, - const void *data); - -/** - * device_get_type - Get the type of the device - * @dev: device to match - * - * Return the device type on success or DEVICE_ANY on failure - */ -enum device_class device_get_class(const struct dt_device_node *dev); +#define ACPI_DEVICE_START(_name, _namestr, _class) \ +static const struct acpi_device_desc __dev_desc_##_name __used \ +__section(".adev.info") = { \ + .name = _namestr, \ + .class = _class, \ -#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 \ +#define ACPI_DEVICE_END \ }; -#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_ARM_DEVICE_H */ +#endif /* __ASM_GENERIC_DEVICE_H__ */ /* * Local variables: