From patchwork Fri Feb 9 18:00:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksii Kurochko X-Patchwork-Id: 13551676 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 19681C4829E for ; Fri, 9 Feb 2024 18:01:09 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.678781.1056301 (Exim 4.92) (envelope-from ) id 1rYVBK-0007Dd-CN; Fri, 09 Feb 2024 18:00:58 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 678781.1056301; Fri, 09 Feb 2024 18:00:58 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rYVBK-0007CX-5R; Fri, 09 Feb 2024 18:00:58 +0000 Received: by outflank-mailman (input) for mailman id 678781; Fri, 09 Feb 2024 18:00:57 +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 1rYVBJ-0007AX-06 for xen-devel@lists.xenproject.org; Fri, 09 Feb 2024 18:00:57 +0000 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [2a00:1450:4864:20::530]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 2b4587ba-c775-11ee-98f5-efadbce2ee36; Fri, 09 Feb 2024 19:00:54 +0100 (CET) Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-56001d49cc5so1574177a12.2 for ; Fri, 09 Feb 2024 10:00:54 -0800 (PST) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id fd1-20020a056402388100b00561103f29fbsm984503edb.75.2024.02.09.10.00.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 10:00:52 -0800 (PST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 2b4587ba-c775-11ee-98f5-efadbce2ee36 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707501653; x=1708106453; 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=8B0Pj3x9NNKyskGfWUDgYAd1f6cJ4ZaavTN0FBUQZB0=; b=hVJR1BqBFs+33LuACE+BtHluv4asgv0Ii/hfFeuXPieavH8xQ90r4/p7jQyitCAj6j 03CXLm5zD7s89cCV0UmwNP9XAtfx8ufnXnFC52nSBR30mFGn8m81whnEia/KVJiKduL8 f5rfYy4KSYx+G0m2bORWWEB8Y4uBgXv5LGt5FRvks+uKztwoKkt13nDoI3OyLBvqtFXQ yFAsFWVmouLEXwvIwTciPHBBVnAi5vIouo+bQ090GSzaU6QaNsO5TyLX90h2guN+65ym evHVe2C1N9wgVjknBhoQlHEHsbW2hRdHclGx7PKGLI79gJWEl3zYLMbq3/UBjTwi58kN +YNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707501653; x=1708106453; 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=8B0Pj3x9NNKyskGfWUDgYAd1f6cJ4ZaavTN0FBUQZB0=; b=nOu+JehDBDcdanz65c4oRk3obYkkzGhGTbf87JEfjjRO3nTPWNz4ftRe2R/QVtNNly MMDFoxhi8BnBx5Lb9XTek1ujAuEJe0H7gwxx08iW7O8m8fkN9IqKyQxhq+xrytjSUa78 eAXKkErcVxWrOxdIj+d8jpN1yBwaixhw2UmOhCo4vzezIiuVp7luORAmRDuZHmQRerrJ UryMZGRIEhCsTuvTyKKJpVNU04FKSDb1zIkfW5J4pS6ELruCPq0w3Jk8EjNe6sQLUFEB 1uI846sP4dbPxGR/xmKFYRdrFHW6FE5BohsyAskPDuYM8fizdbw4GWUyZCRKgrUfoVRD lBjw== X-Gm-Message-State: AOJu0YyD15moGf6cFDTKKjvXS2WAKpevQsSqRFrGXgXvOXOggeJJTdV0 dRE1MS2qzHEPpnI3sHe4e4Y/9hrDK7beNycWPcFfjwR5P9pjPCAWdlvxuVOy X-Google-Smtp-Source: AGHT+IG7YVXB7f4PptTAFpGa8e2Ebe1L2b/BYhzaG1OzjD3gFAhpsghcd0eV447A5hEkZZ+cTgF6yw== X-Received: by 2002:a05:6402:148a:b0:561:c35:dad7 with SMTP id e10-20020a056402148a00b005610c35dad7mr2005215edv.32.1707501653167; Fri, 09 Feb 2024 10:00:53 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVJq/ORgYEshu0agU36A7K2vaCtwYElOyG89uaAaZbIGprzWaCHQZSxuiaWXmvYNC53dDnvYqCoRA5D/DMmtg47GnJuanhYSEj3pySLOrY3r6CTI82SQ6TwgQ== From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , Doug Goldstein , Stefano Stabellini Subject: [PATCH v8 1/7] automation: ensure values in EXTRA_FIXED_RANDCONFIG are separated by new line Date: Fri, 9 Feb 2024 19:00:43 +0100 Message-ID: <8b6f208f0b4327392cfddbfa6809117cc7686750.1707499278.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 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/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 Fri Feb 9 18:00:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksii Kurochko X-Patchwork-Id: 13551673 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 0DD03C48297 for ; Fri, 9 Feb 2024 18:01:06 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.678782.1056314 (Exim 4.92) (envelope-from ) id 1rYVBL-0007eL-Hp; Fri, 09 Feb 2024 18:00:59 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 678782.1056314; Fri, 09 Feb 2024 18:00:59 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rYVBL-0007eE-DJ; Fri, 09 Feb 2024 18:00:59 +0000 Received: by outflank-mailman (input) for mailman id 678782; Fri, 09 Feb 2024 18:00:57 +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 1rYVBJ-0007AX-Nd for xen-devel@lists.xenproject.org; Fri, 09 Feb 2024 18:00:57 +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 2c0f6149-c775-11ee-98f5-efadbce2ee36; Fri, 09 Feb 2024 19:00:56 +0100 (CET) Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-2d066b82658so17478961fa.3 for ; Fri, 09 Feb 2024 10:00:56 -0800 (PST) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id fd1-20020a056402388100b00561103f29fbsm984503edb.75.2024.02.09.10.00.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 10:00:53 -0800 (PST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 2c0f6149-c775-11ee-98f5-efadbce2ee36 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707501655; x=1708106455; 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=2FAxJg0gmB5DWDjQyTT6C98jISHS9vZdHw6mxETNKmo=; b=E27mnS4bZ1BDoOq5d3Dg2Dc+ocZRlrmtvuoMKCToE/lbvm9r8W6BOGfH0UfZ49kbP5 sl1/h+hGtvdc6CDaDKaqDbaZ7NdPS3eb2w/LAZLERLgS8QSHceUV7XEAno39EbwWAz/Y oI4R9NWNQ28FsDVZpOP/8mda5dUzM3DY+IZ+8g3RyYQHOWSncXAJSWIQoF4C8XgShI1h sQNrf+QP83I7Od+xiwsJtBkQg1TCTX1Hxm/29Ut7C+kOCf7BRh4ea7EOUDwhtin9UW+N yjcMwvkD5R5VIj7ukMlA5fMQqzBGvQZw4ua5tq7jQdqAL3AYwUKNIBeWVykP9K87IYTd kaRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707501655; x=1708106455; 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=2FAxJg0gmB5DWDjQyTT6C98jISHS9vZdHw6mxETNKmo=; b=lZyKt/p0BxpuEU5RbmGQiFunTFlbUqlmOcm5xTxRbh9MTqAiWv0DS+luj4XzZC2tf3 EdgI3PZkG41olls/66mR5RAsCEZkvWKB3qhRFesogHRulX9pbM/uD3EqR+nFVXD6ak7C azJTTZUD8BsVNBeFLntZ/gOCphlpaIGecY0vpN4Uico9skKnaw3gw5mSZGJkOwkOQLk/ nZ+vHVKGQcKGViFiixWHtS3aokY7eaEMgyjHHlmxKBgDolNe4ccTyvt77UlKvGHfIhIy JAYzzU6IIZPoSBU+7E7V2ZyTWowFITkAKtIXGQvW9HpM5rXSGQH1/mxDVoHLpfrwhNqw z3LQ== X-Gm-Message-State: AOJu0Yxs9r2AlDunwz+Qoejf2pYADzzyc8+5DctKUFdoM7ibYzc2xJU/ 5Oc2UKfJQg38hLLQHF6E2A2pagT9oFeyuc6/RzCkMBZeiBmuzUsQzmLYObX5 X-Google-Smtp-Source: AGHT+IFbSuQHrFD+pCaWosSAT51WKM2wswg64lILWQSiNhb+QTAe+Zz7P5j3ad0mIicMH3BJdo6Qeg== X-Received: by 2002:a2e:9888:0:b0:2d0:a2ad:bb5 with SMTP id b8-20020a2e9888000000b002d0a2ad0bb5mr1691612ljj.44.1707501654857; Fri, 09 Feb 2024 10:00:54 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCU2UNPXe/bQPGqfYVR+SWxZqR7Zi8dQvlVA1YR82f6V8MlZ84d6/8d410wm+zJH0xq9zzODG8LCTm+bzx6fbU7UQQRCXjVZ0tDE/77AZUqwDTDa5nH/MhdxWA== From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , Doug Goldstein , Stefano Stabellini Subject: [PATCH v8 2/7] automation: introduce fixed randconfig for RISC-V Date: Fri, 9 Feb 2024 19:00:44 +0100 Message-ID: <3f662e3b4ded36d982ff04ed5cdfdd8e36f83594.1707499278.git.oleksii.kurochko@gmail.com> 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 --- The patch were introduced after discussion in a topic: https://lore.kernel.org/xen-devel/cover.1701966261.git.oleksii.kurochko@gmail.com/ --- 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 | 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 6d2cb18b88..376eb17f9c 100644 --- a/automation/gitlab-ci/build.yaml +++ b/automation/gitlab-ci/build.yaml @@ -512,6 +512,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: @@ -532,8 +534,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 @@ -541,8 +542,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 Fri Feb 9 18:00:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksii Kurochko X-Patchwork-Id: 13551674 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 96B93C4829C for ; Fri, 9 Feb 2024 18:01:07 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.678783.1056318 (Exim 4.92) (envelope-from ) id 1rYVBL-0007hx-SI; Fri, 09 Feb 2024 18:00:59 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 678783.1056318; Fri, 09 Feb 2024 18:00:59 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rYVBL-0007h7-Mf; Fri, 09 Feb 2024 18:00:59 +0000 Received: by outflank-mailman (input) for mailman id 678783; Fri, 09 Feb 2024 18:00:58 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rYVBK-0007AX-Nw for xen-devel@lists.xenproject.org; Fri, 09 Feb 2024 18:00:58 +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 2c7e2771-c775-11ee-98f5-efadbce2ee36; Fri, 09 Feb 2024 19:00:56 +0100 (CET) Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2d0e20b7375so5703001fa.2 for ; Fri, 09 Feb 2024 10:00:56 -0800 (PST) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id fd1-20020a056402388100b00561103f29fbsm984503edb.75.2024.02.09.10.00.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 10:00:55 -0800 (PST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 2c7e2771-c775-11ee-98f5-efadbce2ee36 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707501656; x=1708106456; 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=dDTJW+iXXU/pmzqRlWGMRI2OkRV6YQ3UWt7y5c2dJ2o=; b=EIUakyFiLdSVq/sWfKoNBlnT7tFZchSqvfm2C7aEkZm3ki4EpOOlphHBBriNoXU9xq vUeQY21nqMsPeW3ZCSBR+ioBPMaD8jtati7RO1SX98q8DHH3F3nbmBZ43JXgUSHqTdPS A4Js4UHI4BLi0a72hMIze8jPxkFpLbgw3V4Zt+L+phOQKTjO8FE+RH8AiE18sSW061de 3y2UPa43y7dWK8LbNvzsJVeDq4Ye+GCVyRr+UXZO+DwslV3v0qIUhyNPz/ClnN2HXth7 /E2OaspXRfyriZ9O9WKzY3+ga8lfaUvO0ncOFC8CTIY2BENqRSQHQxSWtME9C4f0LJ54 wJ6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707501656; x=1708106456; 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=dDTJW+iXXU/pmzqRlWGMRI2OkRV6YQ3UWt7y5c2dJ2o=; b=YQMKYpEbLoPMTIB803B0X88CuAQsj6YRCxa0H6iiJ3kXo+Yzx8eISaBwZZi5qOUk3N EY/ecIuK3EYEe5xqJ+83wJRG569ykrqXfjfIklnGBp8VXgF8dPL0/JotA/48YWMu4fCY eprEPt2B8Mal78O6oA6bKAWHqF+KXEv4MbQ7gWijaT6j+QcCbtWh9VVhzfcdol3DRK0t Xi0Aw0sDO7kwaFX0XRi0gSRNBaBNtGcCF4xiqZUoBZCGwTcaRs9qD6835o8hGtVEWbHN 60TN7xhShRhzYd8PRWXWf5Bi0op4UGjb9xbK9YzD880ddTJImzRB9SknyhuE5cygoaIz hN3Q== X-Gm-Message-State: AOJu0YxfHzcGDflwiyXPDefhMDDudITX0agaXmsCVLu0PCqzjaeJkXKM 78thgR7jqiHTQFzQMfvYcjqTYUsi+DH/fPy+QspeBsZtAE5Wf3PPokhi1iBo X-Google-Smtp-Source: AGHT+IGFHZ+cyVVb2L4PXW3RObTBtjdUa76Y9tfpmFyQ15SpxFnJRcY7kMAciBx9g1Gmhpoh26N8PQ== X-Received: by 2002:a2e:9b58:0:b0:2d0:9fac:bdff with SMTP id o24-20020a2e9b58000000b002d09facbdffmr1844374ljj.38.1707501655965; Fri, 09 Feb 2024 10:00:55 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUUH3gne00j+NV48jUiaBFjkD6wtBIFi6UDcL+hC2C9BHR0akOBxRpJk06JaF27iQgDmJYSoKiw271l71n38cPcehtHkDw4GZeN4/o0UZoZgiwYUkuGOc1SUnN3Stf2IaofQtbDzaPYd7Y6ZxGgICYhuMNzD3aaqZunBY9mfvY5oAliHqO16bNb1OPdX+e7TGhlvcPybwopcD4QWABy7Bhpib587TZh5KdDOdHo7SdTczil7JdsBtxzu58zcRsIzI2g5DZ4wsIUkg9MEwRiyRPbMDbRp/gKsuRTF0EMutMoCI6PGIoytQXrveu/NZc+Fle8nnXLnZbXbVJb+8GauwM48vLahZ/f5CmoNpnodJ2mPnnzlgziBc9jr0hYXijxMvOi 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 v8 3/7] xen/asm-generic: introduce stub header monitor.h Date: Fri, 9 Feb 2024 19:00:45 +0100 Message-ID: <84568b0c24a5ec96244f3f34537e9a148367facf.1707499278.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 Acked-by: Tamas K Lengyel Acked-by: Julien Grall --- 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 has 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 -static inline -void arch_monitor_allow_userspace(struct domain *d, bool allow_userspace) -{ -} +#define HAS_ARCH_MONITOR_DOMCTL_EVENT -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 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. */ -} - static inline uint32_t arch_monitor_get_capabilities(struct domain *d) { uint32_t capabilities = 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 -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/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"); } -/* monitor.c */ - -int arch_monitor_domctl_event(struct domain *d, - struct xen_domctl_monitor_op *mop) -{ - BUG_ON("unimplemented"); -} - /* smp.c */ void arch_flush_tlb_mask(const cpumask_t *mask) diff --git a/xen/include/asm-generic/monitor.h b/xen/include/asm-generic/monitor.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: + */ From patchwork Fri Feb 9 18:00:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksii Kurochko X-Patchwork-Id: 13551675 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 56E49C4828F for ; Fri, 9 Feb 2024 18:01:08 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.678784.1056326 (Exim 4.92) (envelope-from ) id 1rYVBM-0007rJ-Cj; Fri, 09 Feb 2024 18:01:00 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 678784.1056326; Fri, 09 Feb 2024 18:01:00 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rYVBM-0007mT-32; Fri, 09 Feb 2024 18:01:00 +0000 Received: by outflank-mailman (input) for mailman id 678784; Fri, 09 Feb 2024 18:00:59 +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 1rYVBL-0007U9-6Q for xen-devel@lists.xenproject.org; Fri, 09 Feb 2024 18:00:59 +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 2d6343f5-c775-11ee-8a4b-1f161083a0e0; Fri, 09 Feb 2024 19:00:58 +0100 (CET) Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-561519f8698so603693a12.0 for ; Fri, 09 Feb 2024 10:00:58 -0800 (PST) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id fd1-20020a056402388100b00561103f29fbsm984503edb.75.2024.02.09.10.00.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 10:00:56 -0800 (PST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 2d6343f5-c775-11ee-8a4b-1f161083a0e0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707501657; x=1708106457; 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=enFGeu4zcdTjkPATANnCevJL8MNitOguXGYXr6w8aDE=; b=lWzkJE1/eBHbrk0JVrrYzlB1xrw/XxdQapp+y5EQvqxEd0mAf8LG3A8FS2kgfG5Cgl bnL+Dsetmn+1YXbRYTbDAQWaSYGryAkS16pNiTi8tihKp3pdAwFI+B6x5GW5Ohk+k5AD roOZqBJJJ/CcGs+P2BcT8A1Wz+wm2Gb6bdQfOd9Mkk9NHAufGmEsMwxp6x9cm187haQ3 Oqpi9Xw+M+mDdTsIAxgVAPUQZSPs6M/D0z0XeV7MpeDk2+1f9dSbDd0WRhAXsffUUFaA r1UBZzirKlpQ3ASTZW8P2f7Z4aTvpFDsPcvi67P2hOesghVDfavvfe83n7rp1txlFdDD cPcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707501657; x=1708106457; 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=enFGeu4zcdTjkPATANnCevJL8MNitOguXGYXr6w8aDE=; b=OOE7/phfUcHi4HBqoS5K4AePa7q2ndB/1Bkv5M3RLP0OsRP/NcJcFw6lRFuMiaztY8 ZuTs64A5NuqJNl7AoSBj+S1Ce4aEK2+UuvMVmmw0o7t6EdmIJrwXBDKVoq14azlHM6g0 mjmgMeia+gWwYpYVht8k4FifJKz4VakdWkGwKfKk4F15kE+Kuy04pdqwsSiBisw6mNWe dVITSgohStnCxA3XYYbORbg2GOTIal7tY9NchKZc06ETSg8q8ZhbziJwdzI/N/Fq+R1w G1g1PlvuT4rUe82vVBXZkniz1ZZdttTFwwwDu/xUn08RoRBJ4bZChKnWAqEN2WKO4BPe IQ4w== X-Gm-Message-State: AOJu0Ywfj0md9IaZeQEN5DJIrLArrYqo++/KRgCgi2YdqCU2tqBef2oo RG+SKKKWWnvixQOYh8ZvH9IhSMlAkDcRkx+JeghWm/lY/FhHUus/WKp6p6fY X-Google-Smtp-Source: AGHT+IFYFhz9toHU1yUGZQf/W/6R7wMN3qe/PwM2zpmugwrVd6BkNnTFjWyNy6TK0+lm/sJAdQDYyw== X-Received: by 2002:aa7:d4d5:0:b0:560:269c:214f with SMTP id t21-20020aa7d4d5000000b00560269c214fmr2020823edr.19.1707501657084; Fri, 09 Feb 2024 10:00:57 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCW020EtyrHen7sM4ysquTcqWN2lu/YXqgBtqrhn12PZMbnUApXKGPJoyceKy8+JP5xggN32sxpKIJEa2WEjmkXghB8tQrmvNfk97NjuvDlc9sUsFrW5TqpIekjRRltkgJANojZC+d/M8AFo7eCqEP5CwWt9BJSswaDSGtiy7ZxV6eHW8XMYJzlw5Y+K29XngggJQlay437ulOOnMxbnPqZt7N6NgIWwAq7MJqo7tBZBy7VjXwYOlB0h8pepc391WS6ErYNyBZkaDkquAGt6bYOm21mabVakYwSLfGsrz+2/z/8K776zOaf2+BZPDZvwlHGr+uyyVcGC83tTnSxGxPVKHCp3mphuyUm1Ikiu8OQyQG//CtSndxmzts1LTJUJh1lcpCvATu4zNFESpWU/d54AB99fnRbwPZk/1Dhc68hDUChAvrKotRg4xBzyjmEm0tzNZHarxgMGXm7tz6BIur6wxNng4O+2Qv8JMpY= 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 v8 4/7] xen/asm-generic: ifdef inclusion of Date: Fri, 9 Feb 2024 19:00:46 +0100 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: Tamas K Lengyel 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 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 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/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 Fri Feb 9 18:00:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksii Kurochko X-Patchwork-Id: 13551677 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 803F2C4828F for ; Fri, 9 Feb 2024 18:01:10 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.678785.1056343 (Exim 4.92) (envelope-from ) id 1rYVBN-0008O3-U8; Fri, 09 Feb 2024 18:01:01 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 678785.1056343; Fri, 09 Feb 2024 18:01:01 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rYVBN-0008Nq-QM; Fri, 09 Feb 2024 18:01:01 +0000 Received: by outflank-mailman (input) for mailman id 678785; Fri, 09 Feb 2024 18:01:00 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rYVBM-0007AX-Nh for xen-devel@lists.xenproject.org; Fri, 09 Feb 2024 18:01:00 +0000 Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [2a00:1450:4864:20::531]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 2ddff2de-c775-11ee-98f5-efadbce2ee36; Fri, 09 Feb 2024 19:00:59 +0100 (CET) Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-55a5e7fa471so1616253a12.1 for ; Fri, 09 Feb 2024 10:00:59 -0800 (PST) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id fd1-20020a056402388100b00561103f29fbsm984503edb.75.2024.02.09.10.00.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 10:00:57 -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: 2ddff2de-c775-11ee-98f5-efadbce2ee36 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707501658; x=1708106458; 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=vOVmqMl/hPpGvSwcX+N7nK/RY+xiJRv2+tQc7IlhjtY=; b=Idrm/AYIkfpGgJW6TYYHdiw/pDE3ZYx0GrWFGdULZyEfk9nLF5hhkl9EAK/prfXFQm hMcB1X/GPV7CqTmIpndbaPL5qRcyISWW0UaxaAUcHh63drVZpf4yd312kGnY2iZM7v8x sw4CpKNl4cH2f6iEQ4m54AdMEbx4KD5QmmYjVw8qGTllQFHzivUtk6L7BSofHP3atlzX tzc8Tz0Zmj8OUtrm/jEFR8vF60N4hZ/XWenS2yKET5N19P826V6jVlg6QfM6GcC3rZUp AJ+dZGpPT7803us1XDg3jRTsu0jkaLllxt8C6/hsS02Wr9Vr2inJx+XEr8mjrbZn3ftR DpOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707501658; x=1708106458; 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=vOVmqMl/hPpGvSwcX+N7nK/RY+xiJRv2+tQc7IlhjtY=; b=W6g5Jv3ysciWJEAvNxq3SMYW0zgsDuDq3Q8VwDk65yCUtp7ZWetQhItx0+pqDGhGhm VR4zWFFePWAx5YPX4TGMgppjYh5Z3UGMI5ERg7LBXcz2T+DsHleGgzZWVjoXOPMJqYgW ZqXtBw+IPo5Qke56At6ynIsUbYGE7lE/7KctuNFp6rDjwe3FndfT7NHt+6b0A2ehOkax /R5ETEq6gRnj7PZcd9ElAVnAzIPku3DGASSrtZRQXABFrtJdc3kLFhL/Z65lp3dM1rOV /gopH4hNcNH/ToIoqoG0PGBrVFU4tTmxyqFQ5iCSRYxdEnYf7YOH84wK3MABj2exQGAa bRJQ== X-Gm-Message-State: AOJu0YyEymcsMQ+zsqv85zEj1PeycLBOoY7h6t+rfM8O/BvT6tU4m+2n FQ+oU4FN7AQ/B8z2hcuLNy40VZf+ui37wNKyKtiC6ZHn/kzPM0hIhRp32WG7 X-Google-Smtp-Source: AGHT+IGZNhtlYMhLN+J3mwCuT+VlPUB2Wjdy1BQurwwsaXJBlp4ljXSYf5RPXU8CDNNMBxOHwgV+6g== X-Received: by 2002:a05:6402:784:b0:55f:ec52:73c4 with SMTP id d4-20020a056402078400b0055fec5273c4mr1966265edy.34.1707501658375; Fri, 09 Feb 2024 10:00:58 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCXNBSTd3EyIu7gvwXGI3lavhZQHbrnmmpBNhyJw51rTjTslLUNeFbc8AGpni/IrW6EYgoT3AAP/JdD4/bZDkBci240carThCRmd4TrdB3kel+XrUwUAf/XI1l8uqTU4zV18I2qh1txcoAMFDHm2t5I0xn5+OTdXOLtgqDKa4GgaHgAXm4XNlegFjZeIbDGUJT+VL4TNHGt7Cm+kGKlsSK3q/RQ183fHfNMcFw== 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 v8 5/7] xen/asm-generic: introduce generic device.h Date: Fri, 9 Feb 2024 19:00:47 +0100 Message-ID: <4ecb5e5f4a1dbf585ac7a9ebe40b5fd8e4709182.1707499278.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 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 --- 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 present 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 = class in defines ACPI_DEVICE_START() and DT_DEVICE_START() - update the commit message --- Changes in V7: - keeping DEVICE_PCI_HOSTBRIDGE available for every build based on the reply: 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. - separate patch "[PATCH v6 9/9] xen/asm-generic: introduce generic device.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 | 149 +++++++++++++++++++++++++++++++ 1 file changed, 149 insertions(+) create mode 100644 xen/include/asm-generic/device.h diff --git a/xen/include/asm-generic/device.h b/xen/include/asm-generic/device.h new file mode 100644 index 0000000000..6e56658271 --- /dev/null +++ b/xen/include/asm-generic/device.h @@ -0,0 +1,149 @@ +/* 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 == 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(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 */ + +#define dev_is_pci(dev) ((dev)->type == DEV_PCI) + +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; + /* + * Device initialization. + * + * -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; + /* 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(name_, namestr_, class_) \ +static const struct acpi_device_desc __dev_desc_##name_ __used \ +__section(".adev.info") = { \ + .name = namestr_, \ + .class = class_, + +#define ACPI_DEVICE_END \ +}; + +#endif /* CONFIG_ACPI */ + +#endif /* __ASM_GENERIC_DEVICE_H__ */ + +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ From patchwork Fri Feb 9 18:00:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksii Kurochko X-Patchwork-Id: 13551679 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 145FAC4829C for ; Fri, 9 Feb 2024 18:01:11 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.678786.1056350 (Exim 4.92) (envelope-from ) id 1rYVBO-0008UO-Fa; Fri, 09 Feb 2024 18:01:02 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 678786.1056350; Fri, 09 Feb 2024 18:01:02 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rYVBO-0008Sa-7q; Fri, 09 Feb 2024 18:01:02 +0000 Received: by outflank-mailman (input) for mailman id 678786; Fri, 09 Feb 2024 18:01:01 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rYVBN-0007U9-6o for xen-devel@lists.xenproject.org; Fri, 09 Feb 2024 18:01:01 +0000 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [2a00:1450:4864:20::535]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 2eb5f52c-c775-11ee-8a4b-1f161083a0e0; Fri, 09 Feb 2024 19:01:00 +0100 (CET) Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-560c696ccffso4008420a12.1 for ; Fri, 09 Feb 2024 10:01:00 -0800 (PST) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id fd1-20020a056402388100b00561103f29fbsm984503edb.75.2024.02.09.10.00.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 10:00:58 -0800 (PST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 2eb5f52c-c775-11ee-8a4b-1f161083a0e0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707501659; x=1708106459; 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=JZxnCL12H+ZDFR5vLYR2Fa8H1VelnALrYXWhEz3aNg4=; b=N6FuLSU318UjDePVp4JLJu6GT/2hhh2apCe9NgTUVd0UjSSudeJCfua2CmdNr6i1ch KbXvwj1AQgetQUCZkDAG0klJPSLbe8VMkQ6PyRSLsOKXaETFsSWwyqWud3cfWwlyLZuA yZRlpScPN+VG7oFyycYizcKA91Tu3Jk5BJPMt2vgbitE7DStTNOMYDcvHUZgUjh26z18 GwNoPG7f+G3oswwoDeCv82z2/3ldrNLRN1XddFc3BjYMQ8BcfcuQnt4DJO9MWVTN7CFk yNf5C+jlXAoxu5BWvTiCDpM9hJvv3ltpUPhwrdmd4xEvWfGtGxg1AKCjTYymAxX5miX9 DKVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707501659; x=1708106459; 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=JZxnCL12H+ZDFR5vLYR2Fa8H1VelnALrYXWhEz3aNg4=; b=qr09f4NVEjrYHmIqZvZ2iN+1MVhK4Lo5avln1cMJHYEWxJjcSWLBWQ+pQnEdAaB0bm zYZGEAF4Ac8EBP9T2P28Gr6v1ZBnnqNDGkxDWoFGCRAxLCTYVbVGvc5ZvU2c1hmAcddp JeI9IoSx663gtNV4qZx1zHUopGR+7ipq2CD/8NsVNzkpinkd+mkWYfiy6hU6M/k1TwxE x4UtznmAYZexqxLIsVwVDCifc+6MWgzWTYWKITjmltsh36KqVdXE7M/DwdqKnKUuiE4u FMWYlP64UmUUexR/kwohMvHRwf4RiJEY/51ZNjH2y9V//jFtSZyy76Ug6e8tcKpaH5Dx V5CQ== X-Gm-Message-State: AOJu0YzZ7dMbn/YW4bSZY2D6NBTvFSvNKJvnAwaBZCM2frRLB+wG9L0J Aq95o79W/fuqcz/LGXD/mnyznr9GYBsUoohg4+3EJ3BR9UKUK+1HMwLJyRQS X-Google-Smtp-Source: AGHT+IGW1gnVN8wsBtZuIzYKExcTmqqfEH1F9xffamnzp5f18zkBRyLMCfeGTgTtHd+FxfHWMDTdSg== X-Received: by 2002:a05:6402:3410:b0:55f:5197:6314 with SMTP id k16-20020a056402341000b0055f51976314mr1764168edc.18.1707501659252; Fri, 09 Feb 2024 10:00:59 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVfF3SdaH0Hp4Jo9YeYcEvD7pVnwVeVJuG1jZmmx8lgUsmz+i3i1ZTu0HGjlH/cg2uiXiCeCn5o8z6wNqAIlnnvoIdXt0nyvj7wESsm3GQClePV3re9qKFxWtHwZuMhpSFtFSf2ebV1F13JWfqHQA/qVS0hjVqCIwG2F5fGkqp4G82gzINpKtK1CK38FVsHl7cC5JyO6TtvUrnqgD1xj4wfiiE= From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk Subject: [PATCH v8 6/7] xen/arm: switch Arm to use asm-generic/device.h Date: Fri, 9 Feb 2024 19:00:48 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 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. Signed-off-by: Oleksii Kurochko 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 patch: [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 ------------------------------ 7 files changed, 14 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 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) { 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 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 = { /* 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 @@ -1924,12 +1924,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 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 += altp2m.h +generic-y += device.h generic-y += hardirq.h generic-y += iocap.h generic-y += paging.h diff --git a/xen/arch/arm/include/asm/device.h b/xen/arch/arm/include/asm/device.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 == 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, -}; - -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") = { \ - .name = _namestr, \ - .class = _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") = { \ - .name = _namestr, \ - .class = _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: - */ From patchwork Fri Feb 9 18:00:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksii Kurochko X-Patchwork-Id: 13551678 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 57ACEC48297 for ; Fri, 9 Feb 2024 18:01:11 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.678787.1056364 (Exim 4.92) (envelope-from ) id 1rYVBQ-0000XG-6L; Fri, 09 Feb 2024 18:01:04 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 678787.1056364; Fri, 09 Feb 2024 18:01:04 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rYVBQ-0000W1-1a; Fri, 09 Feb 2024 18:01:04 +0000 Received: by outflank-mailman (input) for mailman id 678787; Fri, 09 Feb 2024 18:01:03 +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 1rYVBO-0007AX-Rd for xen-devel@lists.xenproject.org; Fri, 09 Feb 2024 18:01:02 +0000 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [2a00:1450:4864:20::533]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 2f2a28ce-c775-11ee-98f5-efadbce2ee36; Fri, 09 Feb 2024 19:01:01 +0100 (CET) Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-55a5e7fa471so1616287a12.1 for ; Fri, 09 Feb 2024 10:01:01 -0800 (PST) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id fd1-20020a056402388100b00561103f29fbsm984503edb.75.2024.02.09.10.00.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 10:00:59 -0800 (PST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 2f2a28ce-c775-11ee-98f5-efadbce2ee36 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707501660; x=1708106460; 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=7zSKxQR6kP5WdiwzAdOSjjJwHaQkMg7XYEJePcorDtE=; b=e7fpMLN5yYexyw2OYS91p/mZWEZbijXxpJP0vfpegj1CfsDG6mp6yBkmtU7YewqIdU xdstB7qVzx/qVzsUcLsp+I0q5NqkooccHXdkq/1X9hPKUh9vdkr9/IlbMRdZ3gQaV6qV olB1eNLLK0cXvTG7855zKxJDCuN3so4ImHE7+N97g/e+ovKrZ0bpbV5urPn+1ME03f6y bhEfW9R4QWEiSBUwcs/7v1nbo2cR+OKXq5NnUq4+/10L4pC3h4PWQxjBgT+zUytaGJBB nnbefpdzhFaLeU3AHIT0aochgPWAI2AAP9CwdQFxjvhhhAFK4fd0SKz9+3qKwcR15zQU gKTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707501660; x=1708106460; 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=7zSKxQR6kP5WdiwzAdOSjjJwHaQkMg7XYEJePcorDtE=; b=pI/KPXRGVvakDWIXIdH40bI8Ny9uGps9mH8nvtf4FMUjjb3eRlsg/yqX1SUC2RdTDZ YuWl/ZkfKhSVi2HrSbGMRbb2X53liIGklXVgGy3gZlDiY+QQGSQBSZ2Z5U/XB9d5E4Ku RHVKz0FqU5WYATZXcWfPG+KWQOhyyrZlPko3iucbeXJtYNB6eG0nER9Q5TM+hGjxrgm0 q6cb/A+reMxtVKV12OFxmAvkseGXP0y1QVnKI/KV/0fXb1gwcQUVqZ+BPoPqcUR77MRc JRgM3TeJfS2F5wlEUA4Wd+kRt+8elFje4XCweico93K0BPW3EGoJ5iV7+xYytekFUpNu OZcg== X-Gm-Message-State: AOJu0YxoL5G/Z64mSMAGSyj1zSVzy15BWzBOjo4jh6qs5uHbErbRfItZ aNfbXdH1pE7VTnmD83+b2a2w1DMvvJ3OJHPoF/e97PUQEyPc/fpugsEROabU X-Google-Smtp-Source: AGHT+IFc6L4aoReIcUQhz63N8frIOcSmyo05U0y2uM2pvWezG7stFnF+wJT2FYx1hW0trc4A8v2d5g== X-Received: by 2002:aa7:c653:0:b0:560:1652:e7cb with SMTP id z19-20020aa7c653000000b005601652e7cbmr1823428edr.16.1707501660563; Fri, 09 Feb 2024 10:01:00 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCV2XfEhF2CITrZWAeUUDnRihfsVEoFhTeQGycPMEtkmXn9i7lvJyqFe8+PpuUYDgOTj1Tl9SGQGh72urX/KEKYbgmPzIYhb76sjP94Z7FALQg== From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , Shawn Anastasio Subject: [PATCH v8 7/7] xen/ppc: switch PPC to use asm-generic/device.h Date: Fri, 9 Feb 2024 19:00:49 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Signed-off-by: Oleksii Kurochko --- Changes in V7: - newly introduced patch which is based on the previous version of the patch: [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/Makefile 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 += 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__ */