From patchwork Wed Apr 16 11:58:46 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 14053759 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 B5E88C369C9 for ; Wed, 16 Apr 2025 11:59:20 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.955716.1349324 (Exim 4.92) (envelope-from ) id 1u51Q4-0006Hk-I2; Wed, 16 Apr 2025 11:59:08 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 955716.1349324; Wed, 16 Apr 2025 11:59:08 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1u51Q4-0006HK-DO; Wed, 16 Apr 2025 11:59:08 +0000 Received: by outflank-mailman (input) for mailman id 955716; Wed, 16 Apr 2025 11:59:07 +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 1u51Q3-0006Ay-AA for xen-devel@lists.xenproject.org; Wed, 16 Apr 2025 11:59:07 +0000 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [2a00:1450:4864:20::32d]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 3195a0a3-1aba-11f0-9ffb-bf95429c2676; Wed, 16 Apr 2025 13:59:04 +0200 (CEST) Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-43ed8d32a95so56373815e9.3 for ; Wed, 16 Apr 2025 04:59:04 -0700 (PDT) Received: from localhost.localdomain (host-92-26-98-202.as13285.net. [92.26.98.202]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4405b5a9846sm18761905e9.35.2025.04.16.04.59.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Apr 2025 04:59:03 -0700 (PDT) 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: 3195a0a3-1aba-11f0-9ffb-bf95429c2676 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1744804744; x=1745409544; 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=LrR2qFw2RhoT1ioWjoOtSsI3tc2/ebxvB/CbMCw2zPk=; b=lY19Pb/QkMau1TtctWTGLyJuH0OpsIxrf5XbahmkBta3oNOzELCGVNJN2dO3CIZFNl h7PSzkGAuefcN0iWthKb59jgYdqatahk8zxpf8kGemK4EVYDP9qtIXqmE1og3Iyh6z+s 87+0zrW3PEYZ0LHmiwhCy7nUIuSVC3X8wSUws= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744804744; x=1745409544; 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=LrR2qFw2RhoT1ioWjoOtSsI3tc2/ebxvB/CbMCw2zPk=; b=Dgz6bfWmgeFLqujwndD8oCDAoi0uDZIyPzQCDXrjIJ372DGMrLKwA2ku+jX3IWNPXD iR3yZQ2llwMZPhFrhg2a8C4fjB3/ZLw/cMAfVd3WNKarWjPvQmJeLIIdyR0UfrpoPivZ 3HJRBuHoE6Q3+fWPVqlMFZDZuo2X5E4/h88BwFTfEDcBPHzZHIzrUbLDNg6KqFo/3fjK 7RdaswK2lNblG/EvVMHWsS1GRwZeu1y5+KloX2s49IxWP8SQsPpr4k7M8bFxwz/ZaJzN lPW34Rl/TlVY7Xk54h4wqhEdudbteQSTdqhoMs1pScuUUb64TbooIvSqe7fsvRLrvx3Q ybLg== X-Gm-Message-State: AOJu0YyGRZAbBca7aPV+MazhYquDFwGSJMPBt2I+42kKo0MlfbDMQzKf kwApO+sHpvwjrO/KqsoPNVd4qUKUa3xkUtGthriDxBsmiATc3u2K6wTw/4o0o/KVJ55+QaSHqzG pF54= X-Gm-Gg: ASbGnctiDhi2gXyE4jyIdfSItG9Jh7ssyAlwhhcEKRoHzHpMyfK0+6CN5ZQLEfmGfoj 54MHmRX3/6d37dO7H0FOcKNxv4E650LYOXK7V5U0US+mjimRw0kJf9o1pUA2NQJDT1gDimuKRRg +w4Ftiy3Q11UlNbIniVhEgNaoluE+Wjj9dtK7khdkOnfELI1BFKAi6Bklqm04+MYQQu7DITVsDV DM0xErcZPlS21aw7ay+lIgPzsy6Rmyqwnxb2WgIDakDySTwFkhBmzHeN8AeGYxxBl28CVVT3Sep Ww/yx2MTw9+GPesT6ibBRhR23uzXrLwunTJ6UQiBgqvYQJ8yrV/w7vQcHgx0WaQvJ2pPuxO/A3D wVvQxjz5Z3ZkOVg== X-Google-Smtp-Source: AGHT+IEgmpj4c+9t4rzrKeUZP9r3Zsv7CNOYMl3PyaY7qkbB+/Oe06vxRPeZ7j85uQVqCPnFx5sCBw== X-Received: by 2002:a05:600c:811b:b0:43d:ed:ad07 with SMTP id 5b1f17b1804b1-4405d6cc339mr13999945e9.29.1744804743959; Wed, 16 Apr 2025 04:59:03 -0700 (PDT) From: Andrew Cooper To: Xen-devel Cc: Lin Liu , Andrew Cooper , Jan Beulich , Anthony PERARD , Michal Orzel , Julien Grall , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Stefano Stabellini , Volodymyr Babchuk , Bertrand Marquis , Shawn Anastasio , Oleksii Kurochko , "Daniel P . Smith" Subject: [PATCH v6 01/15] xen: Implement common byte{order,swap}.h Date: Wed, 16 Apr 2025 12:58:46 +0100 Message-Id: <20250416115900.2491661-2-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250416115900.2491661-1-andrew.cooper3@citrix.com> References: <20250416115900.2491661-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 From: Lin Liu The current swab??() infrastructure is unecesserily complicated, and can be replaced entirely with compiler builtins. All supported compilers provide __BYTE_ORDER__ and __builtin_bswap??(). Nothing in Xen cares about the values of __{BIG,LITTLE}_ENDIAN; just that one of them is defined. Therefore, centralise their definitions in xen/config.h Signed-off-by: Lin Liu Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- CC: Anthony PERARD CC: Michal Orzel CC: Jan Beulich CC: Julien Grall CC: Roger Pau Monné CC: Stefano Stabellini CC: Volodymyr Babchuk CC: Bertrand Marquis CC: Shawn Anastasio CC: Oleksii Kurochko CC: Daniel P. Smith CC: Lin Liu v6: * Fix typos * Retain __{BIG,LITTLE}_ENDIAN_BITFIELDS and set them in common logic. * Extra brackets for the non-transformed case. v5: * Rebase substantially * Drop PASTE(). It doesn't work when BITS_PER_LONG isn't a plain integer * Simplify in light of new toolchain baseline --- xen/include/xen/byteorder.h | 44 +++++++++++++++++++++++ xen/include/xen/byteorder/big_endian.h | 7 ---- xen/include/xen/byteorder/little_endian.h | 7 ---- xen/include/xen/byteswap.h | 15 ++++++++ xen/include/xen/config.h | 8 +++++ 5 files changed, 67 insertions(+), 14 deletions(-) create mode 100644 xen/include/xen/byteorder.h create mode 100644 xen/include/xen/byteswap.h base-commit: 7f8c2dd829358406dc9e50d5e386e4d2b20b4303 diff --git a/xen/include/xen/byteorder.h b/xen/include/xen/byteorder.h new file mode 100644 index 000000000000..2b9b97044478 --- /dev/null +++ b/xen/include/xen/byteorder.h @@ -0,0 +1,44 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +#ifndef XEN_BYTEORDER_H +#define XEN_BYTEORDER_H + +#include +#include + +#if defined(__LITTLE_ENDIAN) + +# define cpu_to_le64(x) ((uint64_t)(x)) +# define le64_to_cpu(x) ((uint64_t)(x)) +# define cpu_to_le32(x) ((uint32_t)(x)) +# define le32_to_cpu(x) ((uint32_t)(x)) +# define cpu_to_le16(x) ((uint16_t)(x)) +# define le16_to_cpu(x) ((uint16_t)(x)) + +# define cpu_to_be64(x) bswap64(x) +# define be64_to_cpu(x) bswap64(x) +# define cpu_to_be32(x) bswap32(x) +# define be32_to_cpu(x) bswap32(x) +# define cpu_to_be16(x) bswap16(x) +# define be16_to_cpu(x) bswap16(x) + +#elif defined(__BIG_ENDIAN) + +# define cpu_to_le64(x) bswap64(x) +# define le64_to_cpu(x) bswap64(x) +# define cpu_to_le32(x) bswap32(x) +# define le32_to_cpu(x) bswap32(x) +# define cpu_to_le16(x) bswap16(x) +# define le16_to_cpu(x) bswap16(x) + +# define cpu_to_be64(x) ((uint64_t)(x)) +# define be64_to_cpu(x) ((uint64_t)(x)) +# define cpu_to_be32(x) ((uint32_t)(x)) +# define be32_to_cpu(x) ((uint32_t)(x)) +# define cpu_to_be16(x) ((uint16_t)(x)) +# define be16_to_cpu(x) ((uint16_t)(x)) + +#else +# error Unknown Endianness +#endif /* __*_ENDIAN */ + +#endif /* XEN_BYTEORDER_H */ diff --git a/xen/include/xen/byteorder/big_endian.h b/xen/include/xen/byteorder/big_endian.h index ce395a17f64b..512291c76f1b 100644 --- a/xen/include/xen/byteorder/big_endian.h +++ b/xen/include/xen/byteorder/big_endian.h @@ -1,13 +1,6 @@ #ifndef __XEN_BYTEORDER_BIG_ENDIAN_H__ #define __XEN_BYTEORDER_BIG_ENDIAN_H__ -#ifndef __BIG_ENDIAN -#define __BIG_ENDIAN 4321 -#endif -#ifndef __BIG_ENDIAN_BITFIELD -#define __BIG_ENDIAN_BITFIELD -#endif - #include #include diff --git a/xen/include/xen/byteorder/little_endian.h b/xen/include/xen/byteorder/little_endian.h index 8b118afba5e3..bd1afc6a67c3 100644 --- a/xen/include/xen/byteorder/little_endian.h +++ b/xen/include/xen/byteorder/little_endian.h @@ -1,13 +1,6 @@ #ifndef __XEN_BYTEORDER_LITTLE_ENDIAN_H__ #define __XEN_BYTEORDER_LITTLE_ENDIAN_H__ -#ifndef __LITTLE_ENDIAN -#define __LITTLE_ENDIAN 1234 -#endif -#ifndef __LITTLE_ENDIAN_BITFIELD -#define __LITTLE_ENDIAN_BITFIELD -#endif - #include #include diff --git a/xen/include/xen/byteswap.h b/xen/include/xen/byteswap.h new file mode 100644 index 000000000000..46d93f88eac9 --- /dev/null +++ b/xen/include/xen/byteswap.h @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +#ifndef XEN_BYTESWAP_H +#define XEN_BYTESWAP_H + +#define bswap16(x) __builtin_bswap16(x) +#define bswap32(x) __builtin_bswap32(x) +#define bswap64(x) __builtin_bswap64(x) + +#if BITS_PER_LONG == 64 +# define bswapl(x) bswap64(x) +#elif BITS_PER_LONG == 32 +# define bswapl(x) bswap32(x) +#endif + +#endif /* XEN_BYTESWAP_H */ diff --git a/xen/include/xen/config.h b/xen/include/xen/config.h index 7d43159efb56..1d7195066c08 100644 --- a/xen/include/xen/config.h +++ b/xen/include/xen/config.h @@ -108,4 +108,12 @@ /* It is assumed that sizeof(void *) == __alignof(void *) */ #define POINTER_ALIGN __SIZEOF_POINTER__ +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ +# define __LITTLE_ENDIAN +# define __LITTLE_ENDIAN_BITFIELD +#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ +# define __BIG_ENDIAN +# define __BIG_ENDIAN_BITFIELD +#endif + #endif /* __XEN_CONFIG_H__ */ From patchwork Wed Apr 16 11:58:47 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 14053763 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 7AD4AC369CA for ; Wed, 16 Apr 2025 11:59:21 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.955718.1349339 (Exim 4.92) (envelope-from ) id 1u51Q5-0006W1-AY; Wed, 16 Apr 2025 11:59:09 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 955718.1349339; Wed, 16 Apr 2025 11:59:09 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1u51Q5-0006VY-18; Wed, 16 Apr 2025 11:59:09 +0000 Received: by outflank-mailman (input) for mailman id 955718; Wed, 16 Apr 2025 11:59:08 +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 1u51Q3-0006Ay-Vx for xen-devel@lists.xenproject.org; Wed, 16 Apr 2025 11:59:07 +0000 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [2a00:1450:4864:20::433]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 32184829-1aba-11f0-9ffb-bf95429c2676; Wed, 16 Apr 2025 13:59:05 +0200 (CEST) Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-39ac8e7688aso4026123f8f.2 for ; Wed, 16 Apr 2025 04:59:05 -0700 (PDT) Received: from localhost.localdomain (host-92-26-98-202.as13285.net. [92.26.98.202]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4405b5a9846sm18761905e9.35.2025.04.16.04.59.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Apr 2025 04:59:04 -0700 (PDT) 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: 32184829-1aba-11f0-9ffb-bf95429c2676 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1744804745; x=1745409545; 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=fmL/ZnaF9EKDwjrLJuzd3+BdV4GeJNNzHF8jTkdgEEU=; b=YfrSm1QUIkYZzliUTjTuDYVhVYe8aohQJXpYJyDf+iz1SH6F7Il0VFXMPZk7rYd4GM fNh+kuHSR6QydgrSgNdg1YmTiUgoRgpSQyYbbKYgNbl53JyZWNLB2XMsMhcpj2Yt6ayx W258UamQ1NnHEPX9bsnhV320tgpZLQ41NR3TY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744804745; x=1745409545; 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=fmL/ZnaF9EKDwjrLJuzd3+BdV4GeJNNzHF8jTkdgEEU=; b=MSZaXhcFVM5+RLTX3T85DsuLlBnoSFLrlQt1IyrX4XpeFUledl7nlmuD+n4RXIEvPd RNM8iy5HwPRb7l5tNgj7UqmpBNQCAl9F51isuV+FHKiBzuIiV1DJ32sVxIN7/Mq/if4S 9afUFaFzrUzP4RP13GZr4VUIwFXMszZGWTroAvzY/DFos/QR4TFgP11ig5Hx/q8go6AV YXUZ74agKA80DsMZtXd5C1zxb9I+5eneA4jL1T4UwK8qF6lRXcn5dDjZpweGh8JENYTU 9DMlsyXbRJD1cFjtFsL0U/26ve6v6aoIi5dd0Vkk1cjuYVxRye/q89z4K0AZ8J1JZxgx jpdA== X-Gm-Message-State: AOJu0Yz6ISW+Y2klXRT9Fh5h95B4vY2Ko9+vBvSLhwX6nzu9wRdvbqb/ OskWj0MoyZk1cW+TtupG0eeJhGMMAw6+1E6Sn5k3plNln+75pK8+x0OJTuIANIcNeml2MCOn4/l O5NY= X-Gm-Gg: ASbGncvRKlrDlGLeKCJAjyEyfo59e8mS4dCs9MBctGwOQmkNspQ7rnAf0AJrkYUIuaX M9iOvyFxkfyNmKZtovfG53Es9tIeUpQyBSvQlv2d2ynB5QES50ZSTtzhs7R+422zM9kDxoGxwrj sXiO8OaGOkUftVxjLxVNVsQ70+/6UuQsN4Hf3og7Tqz3+czzpxwQjZP5eM5u6BmYGdsytQKmVSz oLr0FKz8w9ASQXpaN4CmkfBCtSKam45ZCx1vb4kZSV1hukLyN3RLdRLCuDhIa9q/hf9zOqu63pU 5QbPvfuLNzqDwNZ/Wo+VRqlGAFUcynK80KHq94lm4SyPWrHWpokMtT9WlvK7oaUqAB7bCVFgVMp 4Hv4Abqk1cmTvlw== X-Google-Smtp-Source: AGHT+IGoC35KrZip6fCDcL/oUGzi+YtFZJnDE7FrGERYhKy4EnzKfqCJeF21k2rDsfPw8nhjHTWBow== X-Received: by 2002:a05:6000:240c:b0:399:71d4:b8 with SMTP id ffacd0b85a97d-39ee5b1682emr1420910f8f.23.1744804744884; Wed, 16 Apr 2025 04:59:04 -0700 (PDT) From: Andrew Cooper To: Xen-devel Cc: Andrew Cooper , Anthony PERARD , Michal Orzel , Jan Beulich , Julien Grall , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Stefano Stabellini , Volodymyr Babchuk , Bertrand Marquis , Shawn Anastasio , Oleksii Kurochko , "Daniel P . Smith" , Lin Liu Subject: [PATCH v6 02/15] drivers/smmu-v3: Fix impending MISRA R20.6 violation Date: Wed, 16 Apr 2025 12:58:47 +0100 Message-Id: <20250416115900.2491661-3-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250416115900.2491661-1-andrew.cooper3@citrix.com> References: <20250416115900.2491661-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 cpu_to_le64() is about to become a macro, at which point the #ifdef in the middle of it becomes undefined behaviour. Use a logcal variable to prepare strtab, where the #ifdef is fine to use. No functional change. Signed-off-by: Andrew Cooper Reviewed-by: Nicola Vetrini Reviewed-by: Bertrand Marquis --- CC: Anthony PERARD CC: Michal Orzel CC: Jan Beulich CC: Julien Grall CC: Roger Pau Monné CC: Stefano Stabellini CC: Volodymyr Babchuk CC: Bertrand Marquis CC: Shawn Anastasio CC: Oleksii Kurochko CC: Daniel P. Smith CC: Lin Liu v6: * New Eclair log from v5: https://saas.eclairit.com:3787/fs/var/local/eclair/xen-project.ecdf/xen-project/people/andyhhp/xen/ECLAIR_normal/xen-bswap/ARM64/9556392204/PROJECT.ecd;/by_service/MC3A2.R20.6.html --- xen/drivers/passthrough/arm/smmu-v3.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/xen/drivers/passthrough/arm/smmu-v3.c b/xen/drivers/passthrough/arm/smmu-v3.c index cee572402203..df162350578c 100644 --- a/xen/drivers/passthrough/arm/smmu-v3.c +++ b/xen/drivers/passthrough/arm/smmu-v3.c @@ -722,15 +722,17 @@ static void arm_smmu_write_strtab_ent(struct arm_smmu_master *master, u32 sid, } if (s2_cfg) { - BUG_ON(ste_live); - dst[2] = cpu_to_le64( + u64 strtab = FIELD_PREP(STRTAB_STE_2_S2VMID, s2_cfg->vmid) | FIELD_PREP(STRTAB_STE_2_VTCR, s2_cfg->vtcr) | #ifdef __BIG_ENDIAN STRTAB_STE_2_S2ENDI | #endif STRTAB_STE_2_S2PTW | STRTAB_STE_2_S2AA64 | - STRTAB_STE_2_S2R); + STRTAB_STE_2_S2R; + + BUG_ON(ste_live); + dst[2] = cpu_to_le64(strtab); dst[3] = cpu_to_le64(s2_cfg->vttbr & STRTAB_STE_3_S2TTB_MASK); From patchwork Wed Apr 16 11:58:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 14053757 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 7E114C369BD for ; Wed, 16 Apr 2025 11:59:20 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.955717.1349328 (Exim 4.92) (envelope-from ) id 1u51Q4-0006NM-QD; Wed, 16 Apr 2025 11:59:08 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 955717.1349328; Wed, 16 Apr 2025 11:59:08 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1u51Q4-0006MV-LN; Wed, 16 Apr 2025 11:59:08 +0000 Received: by outflank-mailman (input) for mailman id 955717; Wed, 16 Apr 2025 11:59:07 +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 1u51Q3-0006At-F3 for xen-devel@lists.xenproject.org; Wed, 16 Apr 2025 11:59:07 +0000 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [2a00:1450:4864:20::42a]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 32adc87c-1aba-11f0-9eaf-5ba50f476ded; Wed, 16 Apr 2025 13:59:06 +0200 (CEST) Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-3912d2c89ecso6295337f8f.2 for ; Wed, 16 Apr 2025 04:59:06 -0700 (PDT) Received: from localhost.localdomain (host-92-26-98-202.as13285.net. [92.26.98.202]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4405b5a9846sm18761905e9.35.2025.04.16.04.59.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Apr 2025 04:59:05 -0700 (PDT) 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: 32adc87c-1aba-11f0-9eaf-5ba50f476ded DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1744804746; x=1745409546; 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=zUNa1Dyx+tMseYVZXh4eCgKt5Xt2Q/iT4S+G6caeN+A=; b=gdjnL1HFIg5WY7479hrdIbrnnrnFKekCcADcRVo/ygkMCPHbbmXAqmJVgB7cpjULdx U8mpo+++22JFuzIWa0zfGxQ4JK066SpnnaJwv6PRt8+Zx5DC/NII9/zL2jliWII+Q0Rq xh+MfVKakwQ7oBSW+zVBAdStYFZoQJKULDrZQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744804746; x=1745409546; 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=zUNa1Dyx+tMseYVZXh4eCgKt5Xt2Q/iT4S+G6caeN+A=; b=cPzWfFQtu7OeVi4OtT6hR5MR+v0L33uAQtOgCP8dHnGMdtPvwUYs/pcayqZI6fXPDW T0twjxGjT0F1+aKqppZ+jX6hIyoDy2mKcn2l4sbtcu0+fF6gA13BkqXHc0uXcL2jkUZl nAqXXEh0I3b6nj7eMcwYa49A0p5vqTM3Mp2AEIfSle1ELCZsmHc7sJ7udjHiYGnlZgg6 K1xNO0ZC9KhA6j6LvdKHPBmR0vCa9FBRmjD1ZKnh/3KVgvR4Rba/2c1CGV2nu5er9wWI kxqnGBlxVc5O+eoPueOsOJCiItF23awB7brKjxpgwiPWJxg9T4p0obPK68+8309yMxeL TquA== X-Gm-Message-State: AOJu0YybF82WqppUUOxbJwuHMaFzy04dU82lWrMYrFOuo9LBxUuLjk4F ENIApU6HRDBqBx1PnFWjaashM6PaLS8dXr9hzdq+yWxrqQV1dTg6IqHHauA8MUdsJNCt0ZQGXz3 Qwz4= X-Gm-Gg: ASbGncsZp86c1nGFGtARE0FqR7MsmliAOqc9irlBcH9nJ26dHcchPsQ5YG3iheIxvag hR7R4jbEdoHnPiiILGvOguW4Fas81CUGcpxhs1yRiIjhX6NvxCa1+5rjiuOt+Ie9/ZoCtdwbAdP 5rbHHugakUFjkcz0LvO1dp6mf4yptGaPcFO+uGJyqA2rWmxMDovDDefqPqvDlGPNLrzjqsoMLZc nurllwfggs/n2WJFqD/5NZCGE368PtksS9VU5OL/bDKW4Zg3IGbMybvOJjLPxFx4buTDUANzfD+ P5QCwWj7DI/jXuWDb/J0wJcsMn+XtRw+bwrWt2ax8vrNYC8oQM0w9Gox2XJYN05r4pRA33px7df 1PI+A2LwjnuJFBw== X-Google-Smtp-Source: AGHT+IFC4KxZoundul9p9QvnfODv9XvUcsDB9qkah3he6c9DvXWbth2Ekotn4vNSN2k4PfjCVyFRhw== X-Received: by 2002:a5d:584d:0:b0:391:41c9:7a87 with SMTP id ffacd0b85a97d-39ee5baf64bmr1447365f8f.51.1744804745744; Wed, 16 Apr 2025 04:59:05 -0700 (PDT) From: Andrew Cooper To: Xen-devel Cc: Lin Liu , Andrew Cooper , Jan Beulich , Anthony PERARD , Michal Orzel , Julien Grall , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Stefano Stabellini , Volodymyr Babchuk , Bertrand Marquis , Shawn Anastasio , Oleksii Kurochko , "Daniel P . Smith" Subject: [PATCH v6 03/15] xen/lib: Switch to xen/byteorder.h Date: Wed, 16 Apr 2025 12:58:48 +0100 Message-Id: <20250416115900.2491661-4-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250416115900.2491661-1-andrew.cooper3@citrix.com> References: <20250416115900.2491661-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 From: Lin Liu In divmod.c, additionally swap xen/lib.h for xen/macros.h as only ABS() is needed. In find-next-bit.c, ext2 has nothing to do with this logic. It was a local modification when the logic was imported from Linux, because Xen didn't have a suitable helper. The new infrastructure does have a suitable primitive, so use it. No functional change. Signed-off-by: Lin Liu Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- CC: Anthony PERARD CC: Michal Orzel CC: Jan Beulich CC: Julien Grall CC: Roger Pau Monné CC: Stefano Stabellini CC: Volodymyr Babchuk CC: Bertrand Marquis CC: Shawn Anastasio CC: Oleksii Kurochko CC: Daniel P. Smith CC: Lin Liu The find-next-bit.c changes, being inside __BIG_ENDIAN aren't even compiled in any build of Xen. I manually checked that they compiled. v5: * Rebase * Include a fixto divmod.c * Explain why even Linux has never had anything by the name ext2_swab() --- xen/lib/divmod.c | 4 ++-- xen/lib/find-next-bit.c | 39 +++++++-------------------------------- 2 files changed, 9 insertions(+), 34 deletions(-) diff --git a/xen/lib/divmod.c b/xen/lib/divmod.c index 0377d62130ae..063e867a81ed 100644 --- a/xen/lib/divmod.c +++ b/xen/lib/divmod.c @@ -1,6 +1,6 @@ -#include +#include +#include #include -#include /* * A couple of 64 bit operations ported from FreeBSD. diff --git a/xen/lib/find-next-bit.c b/xen/lib/find-next-bit.c index 761b02739841..9b8d7814f20c 100644 --- a/xen/lib/find-next-bit.c +++ b/xen/lib/find-next-bit.c @@ -9,8 +9,7 @@ * 2 of the License, or (at your option) any later version. */ #include - -#include +#include #define __ffs(x) (ffsl(x) - 1) #define ffz(x) __ffs(~(x)) @@ -164,30 +163,6 @@ EXPORT_SYMBOL(find_first_zero_bit); #ifdef __BIG_ENDIAN -/* include/linux/byteorder does not support "unsigned long" type */ -static inline unsigned long ext2_swabp(const unsigned long * x) -{ -#if BITS_PER_LONG == 64 - return (unsigned long) __swab64p((u64 *) x); -#elif BITS_PER_LONG == 32 - return (unsigned long) __swab32p((u32 *) x); -#else -#error BITS_PER_LONG not defined -#endif -} - -/* include/linux/byteorder doesn't support "unsigned long" type */ -static inline unsigned long ext2_swab(const unsigned long y) -{ -#if BITS_PER_LONG == 64 - return (unsigned long) __swab64((u64) y); -#elif BITS_PER_LONG == 32 - return (unsigned long) __swab32((u32) y); -#else -#error BITS_PER_LONG not defined -#endif -} - #ifndef find_next_zero_bit_le unsigned long find_next_zero_bit_le(const void *addr, unsigned long size, unsigned long offset) @@ -202,7 +177,7 @@ unsigned long find_next_zero_bit_le(const void *addr, unsigned size -= result; offset &= (BITS_PER_LONG - 1UL); if (offset) { - tmp = ext2_swabp(p++); + tmp = bswapl(*p++); tmp |= (~0UL >> (BITS_PER_LONG - offset)); if (size < BITS_PER_LONG) goto found_first; @@ -220,7 +195,7 @@ unsigned long find_next_zero_bit_le(const void *addr, unsigned } if (!size) return result; - tmp = ext2_swabp(p); + tmp = bswapl(*p); found_first: tmp |= ~0UL << size; if (tmp == ~0UL) /* Are any bits zero? */ @@ -229,7 +204,7 @@ unsigned long find_next_zero_bit_le(const void *addr, unsigned return result + ffz(tmp); found_middle_swap: - return result + ffz(ext2_swab(tmp)); + return result + ffz(bswapl(tmp)); } EXPORT_SYMBOL(find_next_zero_bit_le); #endif @@ -248,7 +223,7 @@ unsigned long find_next_bit_le(const void *addr, unsigned size -= result; offset &= (BITS_PER_LONG - 1UL); if (offset) { - tmp = ext2_swabp(p++); + tmp = bswapl(*p++); tmp &= (~0UL << offset); if (size < BITS_PER_LONG) goto found_first; @@ -267,7 +242,7 @@ unsigned long find_next_bit_le(const void *addr, unsigned } if (!size) return result; - tmp = ext2_swabp(p); + tmp = bswapl(*p); found_first: tmp &= (~0UL >> (BITS_PER_LONG - size)); if (tmp == 0UL) /* Are any bits set? */ @@ -276,7 +251,7 @@ unsigned long find_next_bit_le(const void *addr, unsigned return result + __ffs(tmp); found_middle_swap: - return result + __ffs(ext2_swab(tmp)); + return result + __ffs(bswapl(tmp)); } EXPORT_SYMBOL(find_next_bit_le); #endif From patchwork Wed Apr 16 11:58:49 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 14053764 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 0EF1BC369CB for ; Wed, 16 Apr 2025 11:59:23 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.955719.1349356 (Exim 4.92) (envelope-from ) id 1u51Q7-00077B-DG; Wed, 16 Apr 2025 11:59:11 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 955719.1349356; Wed, 16 Apr 2025 11:59:11 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1u51Q7-000771-9d; Wed, 16 Apr 2025 11:59:11 +0000 Received: by outflank-mailman (input) for mailman id 955719; Wed, 16 Apr 2025 11:59:09 +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 1u51Q5-0006Ay-3l for xen-devel@lists.xenproject.org; Wed, 16 Apr 2025 11:59:09 +0000 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [2a00:1450:4864:20::42f]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 3324370f-1aba-11f0-9ffb-bf95429c2676; Wed, 16 Apr 2025 13:59:07 +0200 (CEST) Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-3914bc3e01aso3836436f8f.2 for ; Wed, 16 Apr 2025 04:59:07 -0700 (PDT) Received: from localhost.localdomain (host-92-26-98-202.as13285.net. [92.26.98.202]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4405b5a9846sm18761905e9.35.2025.04.16.04.59.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Apr 2025 04:59:06 -0700 (PDT) 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: 3324370f-1aba-11f0-9ffb-bf95429c2676 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1744804747; x=1745409547; 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=YLn8srVkw3Yg8gfwsGTdOECt81wVzaI0OabRG++w1eI=; b=UNJ1NIq8Ec+ppcis4/ds/ezi+MqduU5CbZANVhhcfT2u2JZWyDjWDIIOeDNTEA5ACd R97cZyQwzd5zI+lbcfYwqWzHVI7RyWW9tCk7SMu3XVSoiZIvvgSoj631HscM8tThFPQs Ar5OyaBGwhLl4zVmAYBc3iNwCWRiylBmP3gMU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744804747; x=1745409547; 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=YLn8srVkw3Yg8gfwsGTdOECt81wVzaI0OabRG++w1eI=; b=nnP9xAUVqZwOtuLTWXJmw61bdSvk6KMgC1pLCkfTPMG4AYWScxhsBzspS6T9rSFGlR tx0Oqbcs1ypRofuZHyEkosIS+V4JbA/Ibx2Z2W4BCzvpINZjDnJuL6Sxx7j0oSDKPL5T 587mRdQRMCZiLGbFWmp3KB/H1sHW9gOgvcjXTvmUHzMpEJo+o8Etd4dbFqAXhRkekfX6 YePlCja19Z4/5rKNpFyJMrGVqRI9E1wkdbRteW+ziYnf7s6CSff+xy5PQU59p+GaaTzv a8N5wKClwJUp33z5rUn0+y6pZckxOtshaBs2LO7yus8pPufumoKu8aOkGgXc+KI82q7T XMqw== X-Gm-Message-State: AOJu0Yw1ZTlWqpgzoNOlYCBaLflmd+lsdjacUSnruzFRmKxzmmuO4NYc lhwwcmxGsMNldxS6GKqWtJKqZwSAH8XnpSkxcvC6vUcBkI8fhAcK/ofke8/7akDLoq0mE0CYCBy GePs= X-Gm-Gg: ASbGncvfD413BuDKHEqtgSTZ2xcb8luAWYqSbIOWDKAYW2xppkoM+HRFp2HzzbiYYQk cwCAiHfjanWGQ4llBC0rITeLYXbeUbykU3wHHct11rynkLxvNr09uFiYZRgMCFI7kqTr4UsSgKY eianeN42AH0CsSVVAERtztAYEQL9/ntI6xaQn1vNxKEF6Zl4iufhuWjUav6N3jWF+ST9tCX2VZs hUSXAr4UvhYbIghljbn16CWi6Vu4Rf/Xt8uu7L0s46/Xf9xLIfNQCTe7uROo6YjrEZGsqx/oGE2 sofhekyWimoAcpCsIWoyQNPzNDWOkZ/h45A2+tOBD9qUyh7YVsDv61nLB+wSHCgzCAZZQXx0bdA cdDlKMoFEbtKrsQ== X-Google-Smtp-Source: AGHT+IG0BvFDUI7ZzPBhP4pD1vvX0tHr0NmvdjD83GQcGluEoM9jjCiL45j2ttNYkLT3LMB5hjuygw== X-Received: by 2002:a5d:64ae:0:b0:39c:1efb:ec9a with SMTP id ffacd0b85a97d-39ee5b13b3emr1483641f8f.6.1744804746627; Wed, 16 Apr 2025 04:59:06 -0700 (PDT) From: Andrew Cooper To: Xen-devel Cc: Lin Liu , Andrew Cooper , Anthony PERARD , Michal Orzel , Jan Beulich , Julien Grall , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Stefano Stabellini , Volodymyr Babchuk , Bertrand Marquis , Shawn Anastasio , Oleksii Kurochko , "Daniel P . Smith" Subject: [PATCH v6 04/15] xen/device-tree: Remove use of *_to_cpup() helpers Date: Wed, 16 Apr 2025 12:58:49 +0100 Message-Id: <20250416115900.2491661-5-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250416115900.2491661-1-andrew.cooper3@citrix.com> References: <20250416115900.2491661-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 From: Lin Liu These wrappers simply hide a deference, which adds to the cognitive complexity of reading the code. As such, they're not going to be included in the new byteswap infrastructure. No functional change. Signed-off-by: Lin Liu Signed-off-by: Andrew Cooper Acked-by: Bertrand Marquis --- CC: Anthony PERARD CC: Michal Orzel CC: Jan Beulich CC: Julien Grall CC: Roger Pau Monné CC: Stefano Stabellini CC: Volodymyr Babchuk CC: Bertrand Marquis CC: Shawn Anastasio CC: Oleksii Kurochko CC: Daniel P. Smith CC: Lin Liu v5: * Rebase * Split out of later patch --- xen/common/device-tree/device-tree.c | 44 ++++++++++++++-------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/xen/common/device-tree/device-tree.c b/xen/common/device-tree/device-tree.c index e8f810b2fe10..90fee2ba0315 100644 --- a/xen/common/device-tree/device-tree.c +++ b/xen/common/device-tree/device-tree.c @@ -173,7 +173,7 @@ bool dt_property_read_u32(const struct dt_device_node *np, if ( !val || len < sizeof(*out_value) ) return 0; - *out_value = be32_to_cpup(val); + *out_value = be32_to_cpu(*val); return 1; } @@ -266,7 +266,7 @@ int dt_property_read_variable_u32_array(const struct dt_device_node *np, count = sz; while ( count-- ) - *out_values++ = be32_to_cpup(val++); + *out_values++ = be32_to_cpu(*val++); return sz; } @@ -493,7 +493,7 @@ static int __dt_n_addr_cells(const struct dt_device_node *np, bool parent) ip = dt_get_property(np, "#address-cells", NULL); if ( ip ) - return be32_to_cpup(ip); + return be32_to_cpu(*ip); } while ( np->parent ); /* No #address-cells property for the root node */ return DT_ROOT_NODE_ADDR_CELLS_DEFAULT; @@ -510,7 +510,7 @@ static int __dt_n_size_cells(const struct dt_device_node *np, bool parent) ip = dt_get_property(np, "#size-cells", NULL); if ( ip ) - return be32_to_cpup(ip); + return be32_to_cpu(*ip); } while ( np->parent ); /* No #address-cells property for the root node */ return DT_ROOT_NODE_SIZE_CELLS_DEFAULT; @@ -643,7 +643,7 @@ static void dt_bus_pci_count_cells(const struct dt_device_node *np, static unsigned int dt_bus_pci_get_flags(const __be32 *addr) { unsigned int flags = 0; - u32 w = be32_to_cpup(addr); + u32 w = be32_to_cpu(*addr); switch((w >> 24) & 0x03) { case 0x01: @@ -1096,7 +1096,7 @@ dt_irq_find_parent(const struct dt_device_node *child) if ( parp == NULL ) p = dt_get_parent(child); else - p = dt_find_node_by_phandle(be32_to_cpup(parp)); + p = dt_find_node_by_phandle(be32_to_cpu(*parp)); child = p; } while ( p && dt_get_property(p, "#interrupt-cells", NULL) == NULL ); @@ -1129,7 +1129,7 @@ unsigned int dt_number_of_irq(const struct dt_device_node *device) intlen /= sizeof(*intspec); dt_dprintk(" using 'interrupts' property\n"); - dt_dprintk(" intspec=%d intlen=%d\n", be32_to_cpup(intspec), intlen); + dt_dprintk(" intspec=%d intlen=%d\n", be32_to_cpu(*intspec), intlen); /* Look for the interrupt parent. */ p = dt_irq_find_parent(device); @@ -1260,7 +1260,7 @@ int dt_for_each_irq_map(const struct dt_device_node *dev, imaplen -= addrsize + intsize; /* Get the interrupt parent */ - ipar = dt_find_node_by_phandle(be32_to_cpup(imap)); + ipar = dt_find_node_by_phandle(be32_to_cpu(*imap)); imap++; --imaplen; @@ -1377,8 +1377,8 @@ static int dt_irq_map_raw(const struct dt_device_node *parent, int match, i; dt_dprintk("dt_irq_map_raw: par=%s,intspec=[0x%08x 0x%08x...],ointsize=%d\n", - parent->full_name, be32_to_cpup(intspec), - be32_to_cpup(intspec + 1), ointsize); + parent->full_name, be32_to_cpu(*intspec), + be32_to_cpu(*(intspec+1)), ointsize); ipar = parent; @@ -1490,7 +1490,7 @@ static int dt_irq_map_raw(const struct dt_device_node *parent, dt_dprintk(" -> match=%d (imaplen=%d)\n", match, imaplen); /* Get the interrupt parent */ - newpar = dt_find_node_by_phandle(be32_to_cpup(imap)); + newpar = dt_find_node_by_phandle(be32_to_cpu(*imap)); imap++; --imaplen; @@ -1584,7 +1584,7 @@ int dt_device_get_raw_irq(const struct dt_device_node *device, intlen /= sizeof(*intspec); dt_dprintk(" using 'interrupts' property\n"); - dt_dprintk(" intspec=%d intlen=%d\n", be32_to_cpup(intspec), intlen); + dt_dprintk(" intspec=%d intlen=%d\n", be32_to_cpu(*intspec), intlen); /* Look for the interrupt parent. */ p = dt_irq_find_parent(device); @@ -1695,7 +1695,7 @@ static int __dt_parse_phandle_with_args(const struct dt_device_node *np, * If phandle is 0, then it is an empty entry with no * arguments. Skip forward to the next entry. * */ - phandle = be32_to_cpup(list++); + phandle = be32_to_cpu(*list++); if ( phandle ) { /* @@ -1764,7 +1764,7 @@ static int __dt_parse_phandle_with_args(const struct dt_device_node *np, out_args->np = node; out_args->args_count = count; for ( i = 0; i < count; i++ ) - out_args->args[i] = be32_to_cpup(list++); + out_args->args[i] = be32_to_cpu(*list++); } /* Found it! return success */ @@ -1845,7 +1845,7 @@ static unsigned long unflatten_dt_node(const void *fdt, int has_name = 0; int new_format = 0; - tag = be32_to_cpup((__be32 *)(*p)); + tag = be32_to_cpu(*(__be32 *)(*p)); if ( tag != FDT_BEGIN_NODE ) { printk(XENLOG_WARNING "Weird tag at start of node: %x\n", tag); @@ -1938,7 +1938,7 @@ static unsigned long unflatten_dt_node(const void *fdt, u32 sz, noff; const char *pname; - tag = be32_to_cpup((__be32 *)(*p)); + tag = be32_to_cpu(*(__be32 *)(*p)); if ( tag == FDT_NOP ) { *p += 4; @@ -1947,8 +1947,8 @@ static unsigned long unflatten_dt_node(const void *fdt, if ( tag != FDT_PROP ) break; *p += 4; - sz = be32_to_cpup((__be32 *)(*p)); - noff = be32_to_cpup((__be32 *)((*p) + 4)); + sz = be32_to_cpu(*(__be32 *)(*p)); + noff = be32_to_cpu(*(__be32 *)((*p) + 4)); *p += 8; if ( fdt_version(fdt) < 0x10 ) *p = ROUNDUP(*p, sz >= 8 ? 8 : 4); @@ -1975,13 +1975,13 @@ static unsigned long unflatten_dt_node(const void *fdt, (strcmp(pname, "linux,phandle") == 0) ) { if ( np->phandle == 0 ) - np->phandle = be32_to_cpup((__be32*)*p); + np->phandle = be32_to_cpu(*(__be32*)*p); } /* And we process the "ibm,phandle" property * used in pSeries dynamic device tree * stuff */ if ( strcmp(pname, "ibm,phandle") == 0 ) - np->phandle = be32_to_cpup((__be32 *)*p); + np->phandle = be32_to_cpu(*(__be32 *)*p); pp->name = pname; pp->length = sz; pp->value = (void *)*p; @@ -2053,7 +2053,7 @@ static unsigned long unflatten_dt_node(const void *fdt, *p += 4; else mem = unflatten_dt_node(fdt, mem, p, np, allnextpp, fpsize); - tag = be32_to_cpup((__be32 *)(*p)); + tag = be32_to_cpu(*(__be32 *)(*p)); } if ( tag != FDT_END_NODE ) { @@ -2099,7 +2099,7 @@ int unflatten_device_tree(const void *fdt, struct dt_device_node **mynodes) /* Second pass, do actual unflattening */ start = ((unsigned long)fdt) + fdt_off_dt_struct(fdt); unflatten_dt_node(fdt, mem, &start, NULL, &allnextp, 0); - if ( be32_to_cpup((__be32 *)start) != FDT_END ) + if ( be32_to_cpu(*(__be32 *)start) != FDT_END ) { printk(XENLOG_ERR "Weird tag at end of tree: %08x\n", *((u32 *)start)); From patchwork Wed Apr 16 11:58:50 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 14053758 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 4B069C369C2 for ; Wed, 16 Apr 2025 11:59:20 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.955721.1349367 (Exim 4.92) (envelope-from ) id 1u51Q8-0007HB-Ec; Wed, 16 Apr 2025 11:59:12 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 955721.1349367; Wed, 16 Apr 2025 11:59:12 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1u51Q8-0007Ck-0m; Wed, 16 Apr 2025 11:59:12 +0000 Received: by outflank-mailman (input) for mailman id 955721; Wed, 16 Apr 2025 11:59:10 +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 1u51Q6-0006Ay-03 for xen-devel@lists.xenproject.org; Wed, 16 Apr 2025 11:59:10 +0000 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [2a00:1450:4864:20::433]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 33a33b81-1aba-11f0-9ffb-bf95429c2676; Wed, 16 Apr 2025 13:59:08 +0200 (CEST) Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-39149bccb69so6546101f8f.2 for ; Wed, 16 Apr 2025 04:59:08 -0700 (PDT) Received: from localhost.localdomain (host-92-26-98-202.as13285.net. [92.26.98.202]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4405b5a9846sm18761905e9.35.2025.04.16.04.59.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Apr 2025 04:59:07 -0700 (PDT) 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: 33a33b81-1aba-11f0-9ffb-bf95429c2676 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1744804747; x=1745409547; 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=o2XegFQnInsmfNXqMeBFji/7yyCuSkRmN52heLn+Rqs=; b=JrXB50+lYqhBGxBSw36JiDoj8nz4W5rSB2pk90QC3raJYHrQS7dV630oWhfm77tZNl zVCsrG40okgTXDcXZxouo/NQKZi7RZbsHfMsSVh18qyRkvXW50vo+xSzt95UI00qrx6f hXKdQDs9q2tS/LWIhDTXZiyaOBxB432N0Fhv8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744804747; x=1745409547; 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=o2XegFQnInsmfNXqMeBFji/7yyCuSkRmN52heLn+Rqs=; b=vLejQO8TC7HMESzgLHdnOt1tOsd0BpzIxBkmG1VsfmU/aR4ukKRj8SYU0gZJuqSoJh PsaS5tbALvDB7LxQnthkw/CtN6jg1OAWVx5xl5gnUXErv4/HuPTrjhZkr3KpD09G8jz+ OZDPTJfeo2tIRG7pMANr/VNp8MjKYsNb2xvtTjrC2mZeXc4EjGaKGGEKY4BPK/3Ugu8p qHEXze0LzTgnqTU1MtJ6ot5ixF9kbkpoNrWa9+54HkriWPsn5I3xjimQrzv9tA4rLCL4 ikxdGc6UUs8N2jlcxvMYEENBYJ4wHuet7g6aEFvqpuzvYkc2GE7k2E5o+EQw7bQTc2iF YaRA== X-Gm-Message-State: AOJu0YyhHqWUQyDl4unjodrmstmmGXPGqw2wvrlBSirEZ6f3nvGE78+I b2VTM7th9yrJnW2NZOPg6cnwctZRnEUBYu8y939B4ayFokbBPffnUXjT3VPpQTDBZCnfgmFaLue OL7Y= X-Gm-Gg: ASbGncsjpoOAJ55D/qDg9Suv42Fp3NRJ8B9km0BHReoFBD+OltwCgJ2j7UO5Hq4gAtS aB0T1ae4+r1yvOkvz+bOZs39ONaNNUxsquTQwfXfQh7oD/Ut6WdxYXA3lbAQnAV/IawdFE8iHml 4Qzg86tAqm9bI28bnUMMuU7SNnRkQ28KDhaHUDBKuVj3yxGvZjcUdcY3Mcw0eSH7FoziDLSBRvV SeaTlbn7vtf+YhhKrypuIfW68P0x5Q0FE8Uh44WNHxXhfxw8KNvZgP5u3WFny/bH5S3390oNolc y5Ci4lMcqYsE2ovctOhuvD1Skxc205XQbzPnb3yc5WcleSILe1V3Sp8/utlzGqTlCoicCa5Biu7 kNs8v6AkRGLDvqUalld4FLuaF X-Google-Smtp-Source: AGHT+IFnpWMeUKpKAYDo8WHZK3az+S0rAtQDGZTNX+eCfLoukZHNePftojb/WNxXpv12ovIM+CpgSA== X-Received: by 2002:a5d:64ef:0:b0:39c:12ce:67d with SMTP id ffacd0b85a97d-39ee5b0fee4mr1485921f8f.9.1744804747473; Wed, 16 Apr 2025 04:59:07 -0700 (PDT) From: Andrew Cooper To: Xen-devel Cc: Lin Liu , Andrew Cooper , Anthony PERARD , Michal Orzel , Jan Beulich , Julien Grall , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Stefano Stabellini , Volodymyr Babchuk , Bertrand Marquis , Shawn Anastasio , Oleksii Kurochko , "Daniel P . Smith" Subject: [PATCH v6 05/15] xen/decompressors: Remove use of *_to_cpup() helpers Date: Wed, 16 Apr 2025 12:58:50 +0100 Message-Id: <20250416115900.2491661-6-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250416115900.2491661-1-andrew.cooper3@citrix.com> References: <20250416115900.2491661-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 From: Lin Liu These wrappers simply hide a deference, which adds to the cognitive complexity of reading the code. As such, they're not going to be included in the new byteswap infrastructure. No functional change. Signed-off-by: Lin Liu Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich # hypervisor --- CC: Anthony PERARD CC: Michal Orzel CC: Jan Beulich CC: Julien Grall CC: Roger Pau Monné CC: Stefano Stabellini CC: Volodymyr Babchuk CC: Bertrand Marquis CC: Shawn Anastasio CC: Oleksii Kurochko CC: Daniel P. Smith CC: Lin Liu v6: * Fix lz4 and lzo1x too. v5: * Rebase * Rearranged from other patches --- tools/libs/guest/xg_dom_decompress_lz4.c | 10 ++++++++-- tools/libs/guest/xg_dom_decompress_unsafe_lzo1x.c | 14 ++++---------- tools/libs/guest/xg_dom_decompress_unsafe_xz.c | 13 +++++++------ xen/common/lz4/defs.h | 6 +++++- xen/common/unlzo.c | 12 ++++++++++-- xen/common/xz/private.h | 12 +++++++++--- 6 files changed, 43 insertions(+), 24 deletions(-) diff --git a/tools/libs/guest/xg_dom_decompress_lz4.c b/tools/libs/guest/xg_dom_decompress_lz4.c index b26cce3ec532..53ef0bf328ed 100644 --- a/tools/libs/guest/xg_dom_decompress_lz4.c +++ b/tools/libs/guest/xg_dom_decompress_lz4.c @@ -3,6 +3,8 @@ #include #include +#include INCLUDE_ENDIAN_H + #define XG_NEED_UNALIGNED #include "xg_private.h" #include "xg_dom_decompress.h" @@ -17,9 +19,13 @@ typedef uint64_t u64; #define likely(a) a #define unlikely(a) a -static inline uint_fast16_t le16_to_cpup(const unsigned char *buf) +static inline uint16_t le16_to_cpu(uint16_t v) { - return buf[0] | (buf[1] << 8); +#if BYTE_ORDER == BIG_ENDIAN + return __builtin_bswap16(v); +#else + return v; +#endif } #include "../../xen/include/xen/lz4.h" diff --git a/tools/libs/guest/xg_dom_decompress_unsafe_lzo1x.c b/tools/libs/guest/xg_dom_decompress_unsafe_lzo1x.c index e58c1b95ed17..3f6b133ccf9d 100644 --- a/tools/libs/guest/xg_dom_decompress_unsafe_lzo1x.c +++ b/tools/libs/guest/xg_dom_decompress_unsafe_lzo1x.c @@ -16,25 +16,19 @@ typedef uint64_t u64; #define noinline #define unlikely(a) a -static inline u16 be16_to_cpup(const u16 *p) +static inline u16 be16_to_cpu(const u16 v) { - u16 v = *p; #if BYTE_ORDER == LITTLE_ENDIAN - return (((v & 0x00ffU) << 8) | - ((v & 0xff00U) >> 8)); + return __builtin_bswap16(v); #else return v; #endif } -static inline u32 be32_to_cpup(const u32 *p) +static inline u32 be32_to_cpup(const u32 v) { - u32 v = *p; #if BYTE_ORDER == LITTLE_ENDIAN - return (((v & 0x000000ffUL) << 24) | - ((v & 0x0000ff00UL) << 8) | - ((v & 0x00ff0000UL) >> 8) | - ((v & 0xff000000UL) >> 24)); + return __builtin_bswap32(v); #else return v; #endif diff --git a/tools/libs/guest/xg_dom_decompress_unsafe_xz.c b/tools/libs/guest/xg_dom_decompress_unsafe_xz.c index 80eed912dd68..7dbd2622c3b8 100644 --- a/tools/libs/guest/xg_dom_decompress_unsafe_xz.c +++ b/tools/libs/guest/xg_dom_decompress_unsafe_xz.c @@ -19,18 +19,19 @@ typedef uint32_t __le32; static inline u32 cpu_to_le32(const u32 v) { #if BYTE_ORDER == BIG_ENDIAN - return (((v & 0x000000ffUL) << 24) | - ((v & 0x0000ff00UL) << 8) | - ((v & 0x00ff0000UL) >> 8) | - ((v & 0xff000000UL) >> 24)); + return __builtin_bswap32(v); #else return v; #endif } -static inline u32 le32_to_cpup(const u32 *p) +static inline u32 le32_to_cpu(const u32 p) { - return cpu_to_le32(*p); +#if BYTE_ORDER == BIG_ENDIAN + return __builtin_bswap32(v); +#else + return v; +#endif } #define __force diff --git a/xen/common/lz4/defs.h b/xen/common/lz4/defs.h index ecfbf07f8323..e477806634c1 100644 --- a/xen/common/lz4/defs.h +++ b/xen/common/lz4/defs.h @@ -18,7 +18,11 @@ static inline u16 get_unaligned_le16(const void *p) { - return le16_to_cpup(p); + u16 v; + + memcpy(&v, p, sizeof(v)); + + return le16_to_cpu(v); } #endif diff --git a/xen/common/unlzo.c b/xen/common/unlzo.c index acb8dff600fc..17efb1cc8f1d 100644 --- a/xen/common/unlzo.c +++ b/xen/common/unlzo.c @@ -39,12 +39,20 @@ static inline u16 get_unaligned_be16(const void *p) { - return be16_to_cpup(p); + u16 v; + + memcpy(&v, p, sizeof(v)); + + return be16_to_cpu(v); } static inline u32 get_unaligned_be32(const void *p) { - return be32_to_cpup(p); + u32 v; + + memcpy(&v, p, sizeof(v)); + + return be32_to_cpu(v); } #endif diff --git a/xen/common/xz/private.h b/xen/common/xz/private.h index 2299705378ac..a63379994fd6 100644 --- a/xen/common/xz/private.h +++ b/xen/common/xz/private.h @@ -18,17 +18,23 @@ static inline u32 get_unaligned_le32(const void *p) { - return le32_to_cpup(p); + u32 v; + + memcpy(&v, p, sizeof(v)); + + return le32_to_cpu(v); } static inline void put_unaligned_le32(u32 val, void *p) { - *(__force __le32*)p = cpu_to_le32(val); + u32 v = cpu_to_le32(val); + + memcpy(p, &v, sizeof(v)); } #endif -#define get_le32(p) le32_to_cpup((const uint32_t *)(p)) +#define get_le32(p) le32_to_cpu(*(const uint32_t *)(p)) #define false 0 #define true 1 From patchwork Wed Apr 16 11:58:51 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 14053760 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 B5DFAC369C5 for ; Wed, 16 Apr 2025 11:59:20 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.955720.1349360 (Exim 4.92) (envelope-from ) id 1u51Q7-0007AN-QL; Wed, 16 Apr 2025 11:59:11 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 955720.1349360; Wed, 16 Apr 2025 11:59:11 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1u51Q7-00078t-I4; Wed, 16 Apr 2025 11:59:11 +0000 Received: by outflank-mailman (input) for mailman id 955720; Wed, 16 Apr 2025 11:59:09 +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 1u51Q5-0006At-GP for xen-devel@lists.xenproject.org; Wed, 16 Apr 2025 11:59:09 +0000 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [2a00:1450:4864:20::335]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 343109fa-1aba-11f0-9eaf-5ba50f476ded; Wed, 16 Apr 2025 13:59:09 +0200 (CEST) Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-43cfe63c592so72078725e9.2 for ; Wed, 16 Apr 2025 04:59:09 -0700 (PDT) Received: from localhost.localdomain (host-92-26-98-202.as13285.net. [92.26.98.202]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4405b5a9846sm18761905e9.35.2025.04.16.04.59.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Apr 2025 04:59:07 -0700 (PDT) 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: 343109fa-1aba-11f0-9eaf-5ba50f476ded DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1744804748; x=1745409548; 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=1daQrbWI9UKwuEhY3SZBXcJke4ogYtrZfiRlr7lZLK8=; b=QB1m3j6aJ0qa30+P6+dyHHCNS8MMeJvmIRD0OzSt3C3KMjRCDmqmL4QWbPFRntR1vK XZVoihQj/yUYZT9O78kfFKeJGbkGRdYkefwKp53AOPA5StPkZS3XRy3IxPulCU0H80Jd O3lwpdykuKBD9vNs8bOP+RTxa3+V3izGK7zhE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744804748; x=1745409548; 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=1daQrbWI9UKwuEhY3SZBXcJke4ogYtrZfiRlr7lZLK8=; b=DE7v0aITNHUM9DSVdjexNnlOaScaYWDyo4vYEjuyMIQjRfRvGWCEH3gEXnPp2KN/lE /1dmWnZHrJPWr/toMdsA3nj+BK+g1jE0iH3kAsf/RTeZmFEIHO34S7FwdotBZLz51HRN /nZUjdxukcovCvOk+72UPmcgfc1cY8pn13iM0ibFscNjHRvWO8CJX5H4r+N9bQ+EVOff Qv9pAZIncK8YUKOszc4vRCo/aEfrCoyzSiLa8t9Y0BY8GsoFUHYIvwa1FYiyz62vn0+6 USRd9fFLB5ge5giOYYcRVdidLON5jLbXWUk6fX5WI8iUyjlb2dm7XBWGIkutVS1aWRzD K9uA== X-Gm-Message-State: AOJu0YwnrU9PKvkfacbBWSfBG+IOHMV1YZHaWL0STAxkLx9AWTfP4l21 ye5v7smUpIemKMo1VPQn7qO5Ywl7iM9FnTUnk6lMUdoviTr/Yhi0NPCodcGaoA4RV8TRVuh3tBm MpkA= X-Gm-Gg: ASbGncujSKvuBKa3QlU0p8cJ/hJV3JnO+dH735QafY+o7uSgDoe3PoJyEgBZLmip7FP sYvANKAU3sX3uk0UljJtaaD2055u3oaQuYyj7deS/5GjBXBL9s3tX49YShK0JyU47dyaoFtO3kV 5RtZtnLfvsPPglJ2THvNY8WrStDonTWirEufS08y6mMxyoDWT9Oey+Qfrh4tCtKz+TyyTdw7egL QGcrgNPvuEu0VGFkQJBmOPrrOFvayns8ShvTBSqi4KZHuwWR9KaiJOKjNzdG5NijjsX9PtTfOj+ ebyBd0/TL87ubjd6AGQ6PFIukTam5FAAr/5u/3WUD7y7SYD/zxzKG5PY+xD7cq/8CKuWV5REwK6 xRwtRUlADiWGttg== X-Google-Smtp-Source: AGHT+IFgpfcqBIvlugUUmrvz/YH5fAtZyyY+frKoounRJDMbxOfMjexVXjUUxjtZ+ntbvBpdiGHb+A== X-Received: by 2002:a05:600c:1c1c:b0:43d:82c:2b23 with SMTP id 5b1f17b1804b1-4405d6ad1a1mr14089215e9.23.1744804748260; Wed, 16 Apr 2025 04:59:08 -0700 (PDT) From: Andrew Cooper To: Xen-devel Cc: Lin Liu , Andrew Cooper , Jan Beulich , Anthony PERARD , Michal Orzel , Julien Grall , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Stefano Stabellini , Volodymyr Babchuk , Bertrand Marquis , Shawn Anastasio , Oleksii Kurochko , "Daniel P . Smith" Subject: [PATCH v6 06/15] xen/arch: Switch to new byteorder infrastructure Date: Wed, 16 Apr 2025 12:58:51 +0100 Message-Id: <20250416115900.2491661-7-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250416115900.2491661-1-andrew.cooper3@citrix.com> References: <20250416115900.2491661-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 From: Lin Liu This needs to be done in several steps, because of common vs arch issues. Start by using the new common infastructure inside the arch infrastructure. libelf-private.h is awkward, and the only thing in Xen using swab??() directly. It needs updating at the same time. Signed-off-by: Lin Liu Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- CC: Anthony PERARD CC: Michal Orzel CC: Jan Beulich CC: Julien Grall CC: Roger Pau Monné CC: Stefano Stabellini CC: Volodymyr Babchuk CC: Bertrand Marquis CC: Shawn Anastasio CC: Oleksii Kurochko CC: Daniel P. Smith CC: Lin Liu v5: * Rebase * Rearange from other patches to maintain bisectability --- xen/arch/arm/include/asm/byteorder.h | 4 +--- xen/arch/ppc/include/asm/byteorder.h | 8 +------- xen/arch/riscv/include/asm/byteorder.h | 4 +--- xen/arch/x86/include/asm/byteorder.h | 25 +------------------------ xen/common/libelf/libelf-private.h | 6 +++--- 5 files changed, 7 insertions(+), 40 deletions(-) diff --git a/xen/arch/arm/include/asm/byteorder.h b/xen/arch/arm/include/asm/byteorder.h index 9c712c47884a..7f1419c45a16 100644 --- a/xen/arch/arm/include/asm/byteorder.h +++ b/xen/arch/arm/include/asm/byteorder.h @@ -1,9 +1,7 @@ #ifndef __ASM_ARM_BYTEORDER_H__ #define __ASM_ARM_BYTEORDER_H__ -#define __BYTEORDER_HAS_U64__ - -#include +#include #endif /* __ASM_ARM_BYTEORDER_H__ */ /* diff --git a/xen/arch/ppc/include/asm/byteorder.h b/xen/arch/ppc/include/asm/byteorder.h index 2b5f6b9f6321..8df6adbf0d7d 100644 --- a/xen/arch/ppc/include/asm/byteorder.h +++ b/xen/arch/ppc/include/asm/byteorder.h @@ -1,12 +1,6 @@ #ifndef _ASM_PPC_BYTEORDER_H #define _ASM_PPC_BYTEORDER_H -#define __arch__swab16 __builtin_bswap16 -#define __arch__swab32 __builtin_bswap32 -#define __arch__swab64 __builtin_bswap64 - -#define __BYTEORDER_HAS_U64__ - -#include +#include #endif /* _ASM_PPC_BYTEORDER_H */ diff --git a/xen/arch/riscv/include/asm/byteorder.h b/xen/arch/riscv/include/asm/byteorder.h index 8ca65e1b330e..a32bca02df38 100644 --- a/xen/arch/riscv/include/asm/byteorder.h +++ b/xen/arch/riscv/include/asm/byteorder.h @@ -1,9 +1,7 @@ #ifndef ASM__RISCV__BYTEORDER_H #define ASM__RISCV__BYTEORDER_H -#define __BYTEORDER_HAS_U64__ - -#include +#include #endif /* ASM__RISCV__BYTEORDER_H */ /* diff --git a/xen/arch/x86/include/asm/byteorder.h b/xen/arch/x86/include/asm/byteorder.h index 44c240376d3a..3524a6cee741 100644 --- a/xen/arch/x86/include/asm/byteorder.h +++ b/xen/arch/x86/include/asm/byteorder.h @@ -1,29 +1,6 @@ #ifndef __ASM_X86_BYTEORDER_H__ #define __ASM_X86_BYTEORDER_H__ -#include -#include - -static inline attr_const uint32_t ___arch__swab32(uint32_t x) -{ - asm("bswap %0" : "=r" (x) : "0" (x)); - return x; -} - -static inline attr_const uint64_t ___arch__swab64(uint64_t x) -{ - asm ( "bswap %0" : "+r" (x) ); - return x; -} - -/* Do not define swab16. Gcc is smart enough to recognize "C" version and - convert it into rotation or exhange. */ - -#define __arch__swab64(x) ___arch__swab64(x) -#define __arch__swab32(x) ___arch__swab32(x) - -#define __BYTEORDER_HAS_U64__ - -#include +#include #endif /* __ASM_X86_BYTEORDER_H__ */ diff --git a/xen/common/libelf/libelf-private.h b/xen/common/libelf/libelf-private.h index 197d7a7623a3..65417dffc8a0 100644 --- a/xen/common/libelf/libelf-private.h +++ b/xen/common/libelf/libelf-private.h @@ -31,9 +31,9 @@ printk(fmt, ## args ) #define strtoull(str, end, base) simple_strtoull(str, end, base) -#define bswap_16(x) swab16(x) -#define bswap_32(x) swab32(x) -#define bswap_64(x) swab64(x) +#define bswap_16(x) bswap16(x) +#define bswap_32(x) bswap32(x) +#define bswap_64(x) bswap64(x) #else /* !__XEN__ */ From patchwork Wed Apr 16 11:58:52 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 14053761 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 8B9DBC369C4 for ; Wed, 16 Apr 2025 11:59:20 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.955722.1349375 (Exim 4.92) (envelope-from ) id 1u51Q9-0007VB-5h; Wed, 16 Apr 2025 11:59:13 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 955722.1349375; Wed, 16 Apr 2025 11:59:13 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1u51Q8-0007T0-Tu; Wed, 16 Apr 2025 11:59:12 +0000 Received: by outflank-mailman (input) for mailman id 955722; Wed, 16 Apr 2025 11:59:10 +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 1u51Q6-0006At-9i for xen-devel@lists.xenproject.org; Wed, 16 Apr 2025 11:59:10 +0000 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [2a00:1450:4864:20::329]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 34a39763-1aba-11f0-9eaf-5ba50f476ded; Wed, 16 Apr 2025 13:59:09 +0200 (CEST) Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-43d0c18e84eso33429075e9.3 for ; Wed, 16 Apr 2025 04:59:09 -0700 (PDT) Received: from localhost.localdomain (host-92-26-98-202.as13285.net. [92.26.98.202]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4405b5a9846sm18761905e9.35.2025.04.16.04.59.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Apr 2025 04:59:08 -0700 (PDT) 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: 34a39763-1aba-11f0-9eaf-5ba50f476ded DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1744804749; x=1745409549; 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=bAHFmZ0YTI0ch3CUZiHZjytiZehcl/1327xDDjJIcTI=; b=rpxo53rYdax78cZI5TNTV4gX2brpnBpTxVJU5Fm7PGwqexlJkExrL4X06s3wL2u9Fd Iki7HyGY4PGJ7cqNoe8EVXbSI4vgURYTp2mfGJhsKXvVR+msMc1/rL0CmhViJKsPuwMM 2kA0dZUk3230RIoq6ZSfnZU8nVjSwL8SR9jfA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744804749; x=1745409549; 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=bAHFmZ0YTI0ch3CUZiHZjytiZehcl/1327xDDjJIcTI=; b=kbopPPNnFlfmDxAcocuWj95J7Gli544RremGHJr/Ngo507Efz6H6V92w7xLB3cwuqe bDTOmGFNJWhJfFvfd6d7Vp+58Ple9+27G7NjU3ojGi5gUX+FgSbYK/veQOtLkwpKzg/y DU+bep84aCpb0xgU7bEqtOvz2LwcsoDotbjD4wV1v1pL2YWf4J8+ISW68Kd9GPELi3+/ oSJLhMeVVMaAy2xTv83YQaibZOD5SwYbTYlXNGP7grGgeldsEHBX4BRxsaEPJuEj8n2Z aVxUDKcYik1tuAI62+xavYDq7YeKBeHa+wFhalgKn3Tg3zKSuQs404tMYEOqTLYdn+SD fxxw== X-Gm-Message-State: AOJu0YxMaynAdxgBghGvEBEjGESsvnxu0fPdH5l5bKQCRcwIcPCfpnAW Wv+ua2XdOFrJHTcH4MP+tpunWKhIU/L3Dg5QC/pFdzuLLxXjqMhyvYhqPkCTwgwUA4zkphyz1GH q8wc= X-Gm-Gg: ASbGnctEEOy3mwXpPkErFZ1vmnP3a5G2TlWNsLE3Bhsqle+ieXYmHuSzJZ8EdEqSk8m 0A6hXYW2jCFCZHx9q0TUYp3tKAL5o7V4nMR4lk73WKO91V68Wr/NvgIHVNxTunqzUaQe0WKXLm5 TqWAC9kmjSVc5D1M1ksmjpPNG3sQU2Zt1n5I3zcTEogquGmVFTsaQ/tRCeceWANpoAPL73sroYk UrnnSH+mg5KrM3QlDdPoY8+0oheWFOaQrrQGOzWKUFhD4UEZgBelf0pFRkY2jPQryIW/S5/FBtw xsnjDVmAZPiC+qJrkWFB6x0b3sljMKQmfU7q1dVAzy/iqQa5L64s1dkKke5ID+7CK7z8QtP8gnS rbGnw1fim6Pda9g== X-Google-Smtp-Source: AGHT+IG3f3gIuKL6j33O8Q/WmKOufRM5b+ujOD3HzCxzUtYppN6Oy7/An7BvcbbCGoXrkokkPdTEjQ== X-Received: by 2002:a05:600c:3487:b0:43c:f70a:2af0 with SMTP id 5b1f17b1804b1-4405d62a49cmr19411175e9.16.1744804749192; Wed, 16 Apr 2025 04:59:09 -0700 (PDT) From: Andrew Cooper To: Xen-devel Cc: Lin Liu , Andrew Cooper , Jan Beulich , Anthony PERARD , Michal Orzel , Julien Grall , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Stefano Stabellini , Volodymyr Babchuk , Bertrand Marquis , Shawn Anastasio , Oleksii Kurochko , "Daniel P . Smith" Subject: [PATCH v6 07/15] xen/decompressors: Use new byteorder infrastructure Date: Wed, 16 Apr 2025 12:58:52 +0100 Message-Id: <20250416115900.2491661-8-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250416115900.2491661-1-andrew.cooper3@citrix.com> References: <20250416115900.2491661-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 From: Lin Liu unaligned.h already inlcudes byteorder.h, so most can simply be dropped. No functional change. Signed-off-by: Lin Liu Signed-off-by: Andrew Cooper Acked-by: Jan Beulich --- CC: Anthony PERARD CC: Michal Orzel CC: Jan Beulich CC: Julien Grall CC: Roger Pau Monné CC: Stefano Stabellini CC: Volodymyr Babchuk CC: Bertrand Marquis CC: Shawn Anastasio CC: Oleksii Kurochko CC: Daniel P. Smith CC: Lin Liu v5: * New --- tools/libs/guest/xg_dom_decompress_unsafe_zstd.c | 3 +-- xen/common/lz4/defs.h | 1 - xen/common/lzo.c | 1 - xen/common/unlzo.c | 1 - xen/common/xz/private.h | 1 - 5 files changed, 1 insertion(+), 6 deletions(-) diff --git a/tools/libs/guest/xg_dom_decompress_unsafe_zstd.c b/tools/libs/guest/xg_dom_decompress_unsafe_zstd.c index ff45732a3616..319816a390eb 100644 --- a/tools/libs/guest/xg_dom_decompress_unsafe_zstd.c +++ b/tools/libs/guest/xg_dom_decompress_unsafe_zstd.c @@ -30,9 +30,8 @@ typedef uint64_t __be64; #undef ERROR -#define __BYTEORDER_HAS_U64__ #define __TYPES_H__ /* xen/types.h guard */ -#include "../../xen/include/xen/byteorder/little_endian.h" +#include "../../xen/include/xen/byteorder.h" #include "../../xen/include/xen/unaligned.h" #include "../../xen/include/xen/xxhash.h" #include "../../xen/lib/xxhash64.c" diff --git a/xen/common/lz4/defs.h b/xen/common/lz4/defs.h index e477806634c1..b697a06c00d7 100644 --- a/xen/common/lz4/defs.h +++ b/xen/common/lz4/defs.h @@ -12,7 +12,6 @@ #define COMMON_LZ4_DEFS_H #ifdef __XEN__ -#include #include #else diff --git a/xen/common/lzo.c b/xen/common/lzo.c index 07b4017812dc..0393ec5c4472 100644 --- a/xen/common/lzo.c +++ b/xen/common/lzo.c @@ -68,7 +68,6 @@ #ifdef __XEN__ #include -#include #include #else #define get_unaligned_le16(_p) (*(u16 *)(_p)) diff --git a/xen/common/unlzo.c b/xen/common/unlzo.c index 17efb1cc8f1d..9a9d39c4239b 100644 --- a/xen/common/unlzo.c +++ b/xen/common/unlzo.c @@ -33,7 +33,6 @@ #include #ifdef __XEN__ -#include #include #else diff --git a/xen/common/xz/private.h b/xen/common/xz/private.h index a63379994fd6..3dce124fa743 100644 --- a/xen/common/xz/private.h +++ b/xen/common/xz/private.h @@ -12,7 +12,6 @@ #ifdef __XEN__ #include -#include #include #else From patchwork Wed Apr 16 11:58:53 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 14053766 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 476C9C369C2 for ; Wed, 16 Apr 2025 11:59:26 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.955725.1349407 (Exim 4.92) (envelope-from ) id 1u51QC-0008Ld-Gz; Wed, 16 Apr 2025 11:59:16 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 955725.1349407; Wed, 16 Apr 2025 11:59:16 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1u51QC-0008IS-4G; Wed, 16 Apr 2025 11:59:16 +0000 Received: by outflank-mailman (input) for mailman id 955725; Wed, 16 Apr 2025 11:59:13 +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 1u51Q9-0006Ay-Kw for xen-devel@lists.xenproject.org; Wed, 16 Apr 2025 11:59:13 +0000 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [2a00:1450:4864:20::431]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 353f420c-1aba-11f0-9ffb-bf95429c2676; Wed, 16 Apr 2025 13:59:11 +0200 (CEST) Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-39ee57c0b8cso458289f8f.0 for ; Wed, 16 Apr 2025 04:59:11 -0700 (PDT) Received: from localhost.localdomain (host-92-26-98-202.as13285.net. [92.26.98.202]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4405b5a9846sm18761905e9.35.2025.04.16.04.59.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Apr 2025 04:59:09 -0700 (PDT) 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: 353f420c-1aba-11f0-9ffb-bf95429c2676 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1744804750; x=1745409550; 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=wnf/Nwp4shj5EFcPhUHIkrw4QnU6FSi2i7Zr/xIuM0A=; b=N36ywz/dN0lETPcR6XsbqyXL6k1buSgv0nuUCITT56MdvDX9uHviDRYL5N1neSSys+ xjIP/ZErCB9Kl3DU/V0iOeGBMrDVBmC6WKNmwgG7ialCU8cEJ7RIIH0vd+84vxqNPt7a NtndlCR2CFWMMihIUtsR+40qZQ+usDDBkvb2c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744804750; x=1745409550; 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=wnf/Nwp4shj5EFcPhUHIkrw4QnU6FSi2i7Zr/xIuM0A=; b=FeWw9nPsOy2aAtovoPXCdyqTx8sWYqBd/AWJUjct2QtAfKpt2zrEFfKdK+1WxRyRFG lxZ1iRNZ7yTdg1gvFIitzIFo6eTl/+6GqpVZEKQvT2UUmu+F6q/yZytCs5mKdwveihEL E4IaNIc7KuqBrTRVt2QwOtpy33UPf52cNURE0GnhBrd+C/zsoDdEayO7EzTLKLWh8z8G AtgYQR5GcEeCLpkbrQ3F+XYkuqV6NJjdRItmfA/ue/GkfCGcVTV0pD0ow4WN6WseRWj8 ZllPLGteecstrI0kJXFGOoA6EsjOU/j42RzjgIVRh/mJ2Oz9iAFhC7aQXhplPKJ0mwDB xeew== X-Gm-Message-State: AOJu0Yzrbm1NMoGroMqAtb0c/Etrx57o8Ft8SMp02SxZvcWuclytAtUj fmQc6G4JcQguM4kR3hXbLvPH1hfIbWx1kXaGDThB7XGseP5V+Znkuy0URQ7+yIrK8YYM2a+SRtZ hrIo= X-Gm-Gg: ASbGnct80POLRVZ0ZSeCdhqKQ1RgSxZgZCgRUksgfA8cs+v/VuHGoXJ0vsDTo3u4W4m sDD0YLfVKbKz56OlrnQZkghdjo4S3Nrf/qPEIDi85Ugg2weh5bDBFFbIETyV7vXejlD1LVJNsYn 7XcOLIVOXcJ4CtTqSysXU3LijB/Vz1IsiqdlnF+ncxgqlLWcSDuQuIvdPJFmv+/sYxDejSNGOid JfhBUJADQp/8MsnPTreiLCYaChbVe8RMSq/B70g5rXOEFZYjlNgnA1k8jZlOcfg8+85Hd8R+dFJ e3r0Wirq8UOiN5rjFihCjuvW3MG81y2H7Iw+yRxhZoo9+HDgYwKRlY3KN8f/blj+tRkHfJ5uJU3 FDveo9XG2Ey5/pw== X-Google-Smtp-Source: AGHT+IGLE54MCxmGfLRHPR7923SMT/+f9s1dxJukFc0Trom+H/3Dch1mdOSM2YM+b+ianCTw4XlcAw== X-Received: by 2002:a05:6000:1882:b0:391:4835:d8a8 with SMTP id ffacd0b85a97d-39ee5b13e81mr1525905f8f.1.1744804750089; Wed, 16 Apr 2025 04:59:10 -0700 (PDT) From: Andrew Cooper To: Xen-devel Cc: Lin Liu , Andrew Cooper , Anthony PERARD , Michal Orzel , Jan Beulich , Julien Grall , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Stefano Stabellini , Volodymyr Babchuk , Bertrand Marquis , Shawn Anastasio , Oleksii Kurochko , "Daniel P . Smith" Subject: [PATCH v6 08/15] xen: Remove old byteorder infrastructure Date: Wed, 16 Apr 2025 12:58:53 +0100 Message-Id: <20250416115900.2491661-9-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250416115900.2491661-1-andrew.cooper3@citrix.com> References: <20250416115900.2491661-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 From: Lin Liu It is no longer used. Signed-off-by: Lin Liu Reviewed-by: Andrew Cooper --- CC: Anthony PERARD CC: Michal Orzel CC: Jan Beulich CC: Julien Grall CC: Roger Pau Monné CC: Stefano Stabellini CC: Volodymyr Babchuk CC: Bertrand Marquis CC: Shawn Anastasio CC: Oleksii Kurochko CC: Daniel P. Smith CC: Lin Liu --- xen/include/xen/byteorder/big_endian.h | 95 ------------ xen/include/xen/byteorder/generic.h | 68 -------- xen/include/xen/byteorder/little_endian.h | 95 ------------ xen/include/xen/byteorder/swab.h | 179 ---------------------- 4 files changed, 437 deletions(-) delete mode 100644 xen/include/xen/byteorder/big_endian.h delete mode 100644 xen/include/xen/byteorder/generic.h delete mode 100644 xen/include/xen/byteorder/little_endian.h delete mode 100644 xen/include/xen/byteorder/swab.h diff --git a/xen/include/xen/byteorder/big_endian.h b/xen/include/xen/byteorder/big_endian.h deleted file mode 100644 index 512291c76f1b..000000000000 --- a/xen/include/xen/byteorder/big_endian.h +++ /dev/null @@ -1,95 +0,0 @@ -#ifndef __XEN_BYTEORDER_BIG_ENDIAN_H__ -#define __XEN_BYTEORDER_BIG_ENDIAN_H__ - -#include -#include - -#define __constant_cpu_to_le64(x) ((__force __le64)___constant_swab64((x))) -#define __constant_le64_to_cpu(x) ___constant_swab64((__force uint64_t)(__le64)(x)) -#define __constant_cpu_to_le32(x) ((__force __le32)___constant_swab32((x))) -#define __constant_le32_to_cpu(x) ___constant_swab32((__force uint32_t)(__le32)(x)) -#define __constant_cpu_to_le16(x) ((__force __le16)___constant_swab16((x))) -#define __constant_le16_to_cpu(x) ___constant_swab16((__force uint16_t)(__le16)(x)) -#define __constant_cpu_to_be64(x) ((__force __be64)(uint64_t)(x)) -#define __constant_be64_to_cpu(x) ((__force uint64_t)(__be64)(x)) -#define __constant_cpu_to_be32(x) ((__force __be32)(uint32_t)(x)) -#define __constant_be32_to_cpu(x) ((__force uint32_t)(__be32)(x)) -#define __constant_cpu_to_be16(x) ((__force __be16)(uint16_t)(x)) -#define __constant_be16_to_cpu(x) ((__force uint16_t)(__be16)(x)) -#define __cpu_to_le64(x) ((__force __le64)__swab64((x))) -#define __le64_to_cpu(x) __swab64((__force uint64_t)(__le64)(x)) -#define __cpu_to_le32(x) ((__force __le32)__swab32((x))) -#define __le32_to_cpu(x) __swab32((__force uint32_t)(__le32)(x)) -#define __cpu_to_le16(x) ((__force __le16)__swab16((x))) -#define __le16_to_cpu(x) __swab16((__force uint16_t)(__le16)(x)) -#define __cpu_to_be64(x) ((__force __be64)(uint64_t)(x)) -#define __be64_to_cpu(x) ((__force uint64_t)(__be64)(x)) -#define __cpu_to_be32(x) ((__force __be32)(uint32_t)(x)) -#define __be32_to_cpu(x) ((__force uint32_t)(__be32)(x)) -#define __cpu_to_be16(x) ((__force __be16)(uint16_t)(x)) -#define __be16_to_cpu(x) ((__force uint16_t)(__be16)(x)) - -static inline __le64 __cpu_to_le64p(const uint64_t *p) -{ - return (__force __le64)__swab64p(p); -} -static inline uint64_t __le64_to_cpup(const __le64 *p) -{ - return __swab64p((const uint64_t *)p); -} -static inline __le32 __cpu_to_le32p(const uint32_t *p) -{ - return (__force __le32)__swab32p(p); -} -static inline uint32_t __le32_to_cpup(const __le32 *p) -{ - return __swab32p((const uint32_t *)p); -} -static inline __le16 __cpu_to_le16p(const uint16_t *p) -{ - return (__force __le16)__swab16p(p); -} -static inline uint16_t __le16_to_cpup(const __le16 *p) -{ - return __swab16p((const uint16_t *)p); -} -static inline __be64 __cpu_to_be64p(const uint64_t *p) -{ - return (__force __be64)*p; -} -static inline uint64_t __be64_to_cpup(const __be64 *p) -{ - return (__force uint64_t)*p; -} -static inline __be32 __cpu_to_be32p(const uint32_t *p) -{ - return (__force __be32)*p; -} -static inline uint32_t __be32_to_cpup(const __be32 *p) -{ - return (__force uint32_t)*p; -} -static inline __be16 __cpu_to_be16p(const uint16_t *p) -{ - return (__force __be16)*p; -} -static inline uint16_t __be16_to_cpup(const __be16 *p) -{ - return (__force uint16_t)*p; -} -#define __cpu_to_le64s(x) __swab64s((x)) -#define __le64_to_cpus(x) __swab64s((x)) -#define __cpu_to_le32s(x) __swab32s((x)) -#define __le32_to_cpus(x) __swab32s((x)) -#define __cpu_to_le16s(x) __swab16s((x)) -#define __le16_to_cpus(x) __swab16s((x)) -#define __cpu_to_be64s(x) do {} while (0) -#define __be64_to_cpus(x) do {} while (0) -#define __cpu_to_be32s(x) do {} while (0) -#define __be32_to_cpus(x) do {} while (0) -#define __cpu_to_be16s(x) do {} while (0) -#define __be16_to_cpus(x) do {} while (0) - -#include - -#endif /* __XEN_BYTEORDER_BIG_ENDIAN_H__ */ diff --git a/xen/include/xen/byteorder/generic.h b/xen/include/xen/byteorder/generic.h deleted file mode 100644 index 8a0006b75594..000000000000 --- a/xen/include/xen/byteorder/generic.h +++ /dev/null @@ -1,68 +0,0 @@ -#ifndef __XEN_BYTEORDER_GENERIC_H__ -#define __XEN_BYTEORDER_GENERIC_H__ - -/* - * Generic Byte-reordering support - * - * The "... p" macros, like le64_to_cpup, can be used with pointers - * to unaligned data, but there will be a performance penalty on - * some architectures. Use get_unaligned for unaligned data. - * - * The following macros are to be defined by : - * - * Conversion of XX-bit integers (16- 32- or 64-) - * between native CPU format and little/big endian format - * 64-bit stuff only defined for proper architectures - * cpu_to_[bl]eXX(__uXX x) - * [bl]eXX_to_cpu(__uXX x) - * - * The same, but takes a pointer to the value to convert - * cpu_to_[bl]eXXp(__uXX x) - * [bl]eXX_to_cpup(__uXX x) - * - * The same, but change in situ - * cpu_to_[bl]eXXs(__uXX x) - * [bl]eXX_to_cpus(__uXX x) - * - * See asm-foo/byteorder.h for examples of how to provide - * architecture-optimized versions - */ - -#define cpu_to_le64 __cpu_to_le64 -#define le64_to_cpu __le64_to_cpu -#define cpu_to_le32 __cpu_to_le32 -#define le32_to_cpu __le32_to_cpu -#define cpu_to_le16 __cpu_to_le16 -#define le16_to_cpu __le16_to_cpu -#define cpu_to_be64 __cpu_to_be64 -#define be64_to_cpu __be64_to_cpu -#define cpu_to_be32 __cpu_to_be32 -#define be32_to_cpu __be32_to_cpu -#define cpu_to_be16 __cpu_to_be16 -#define be16_to_cpu __be16_to_cpu -#define cpu_to_le64p __cpu_to_le64p -#define le64_to_cpup __le64_to_cpup -#define cpu_to_le32p __cpu_to_le32p -#define le32_to_cpup __le32_to_cpup -#define cpu_to_le16p __cpu_to_le16p -#define le16_to_cpup __le16_to_cpup -#define cpu_to_be64p __cpu_to_be64p -#define be64_to_cpup __be64_to_cpup -#define cpu_to_be32p __cpu_to_be32p -#define be32_to_cpup __be32_to_cpup -#define cpu_to_be16p __cpu_to_be16p -#define be16_to_cpup __be16_to_cpup -#define cpu_to_le64s __cpu_to_le64s -#define le64_to_cpus __le64_to_cpus -#define cpu_to_le32s __cpu_to_le32s -#define le32_to_cpus __le32_to_cpus -#define cpu_to_le16s __cpu_to_le16s -#define le16_to_cpus __le16_to_cpus -#define cpu_to_be64s __cpu_to_be64s -#define be64_to_cpus __be64_to_cpus -#define cpu_to_be32s __cpu_to_be32s -#define be32_to_cpus __be32_to_cpus -#define cpu_to_be16s __cpu_to_be16s -#define be16_to_cpus __be16_to_cpus - -#endif /* __XEN_BYTEORDER_GENERIC_H__ */ diff --git a/xen/include/xen/byteorder/little_endian.h b/xen/include/xen/byteorder/little_endian.h deleted file mode 100644 index bd1afc6a67c3..000000000000 --- a/xen/include/xen/byteorder/little_endian.h +++ /dev/null @@ -1,95 +0,0 @@ -#ifndef __XEN_BYTEORDER_LITTLE_ENDIAN_H__ -#define __XEN_BYTEORDER_LITTLE_ENDIAN_H__ - -#include -#include - -#define __constant_cpu_to_le64(x) ((__force __le64)(uint64_t)(x)) -#define __constant_le64_to_cpu(x) ((__force uint64_t)(__le64)(x)) -#define __constant_cpu_to_le32(x) ((__force __le32)(uint32_t)(x)) -#define __constant_le32_to_cpu(x) ((__force uint32_t)(__le32)(x)) -#define __constant_cpu_to_le16(x) ((__force __le16)(uint16_t)(x)) -#define __constant_le16_to_cpu(x) ((__force uint16_t)(__le16)(x)) -#define __constant_cpu_to_be64(x) ((__force __be64)___constant_swab64((x))) -#define __constant_be64_to_cpu(x) ___constant_swab64((__force uint64_t)(__be64)(x)) -#define __constant_cpu_to_be32(x) ((__force __be32)___constant_swab32((x))) -#define __constant_be32_to_cpu(x) ___constant_swab32((__force uint32_t)(__be32)(x)) -#define __constant_cpu_to_be16(x) ((__force __be16)___constant_swab16((x))) -#define __constant_be16_to_cpu(x) ___constant_swab16((__force uint16_t)(__be16)(x)) -#define __cpu_to_le64(x) ((__force __le64)(uint64_t)(x)) -#define __le64_to_cpu(x) ((__force uint64_t)(__le64)(x)) -#define __cpu_to_le32(x) ((__force __le32)(uint32_t)(x)) -#define __le32_to_cpu(x) ((__force uint32_t)(__le32)(x)) -#define __cpu_to_le16(x) ((__force __le16)(uint16_t)(x)) -#define __le16_to_cpu(x) ((__force uint16_t)(__le16)(x)) -#define __cpu_to_be64(x) ((__force __be64)__swab64((x))) -#define __be64_to_cpu(x) __swab64((__force uint64_t)(__be64)(x)) -#define __cpu_to_be32(x) ((__force __be32)__swab32((x))) -#define __be32_to_cpu(x) __swab32((__force uint32_t)(__be32)(x)) -#define __cpu_to_be16(x) ((__force __be16)__swab16((x))) -#define __be16_to_cpu(x) __swab16((__force uint16_t)(__be16)(x)) - -static inline __le64 __cpu_to_le64p(const uint64_t *p) -{ - return (__force __le64)*p; -} -static inline uint64_t __le64_to_cpup(const __le64 *p) -{ - return (__force uint64_t)*p; -} -static inline __le32 __cpu_to_le32p(const uint32_t *p) -{ - return (__force __le32)*p; -} -static inline uint32_t __le32_to_cpup(const __le32 *p) -{ - return (__force uint32_t)*p; -} -static inline __le16 __cpu_to_le16p(const uint16_t *p) -{ - return (__force __le16)*p; -} -static inline uint16_t __le16_to_cpup(const __le16 *p) -{ - return (__force uint16_t)*p; -} -static inline __be64 __cpu_to_be64p(const uint64_t *p) -{ - return (__force __be64)__swab64p(p); -} -static inline uint64_t __be64_to_cpup(const __be64 *p) -{ - return __swab64p((const uint64_t *)p); -} -static inline __be32 __cpu_to_be32p(const uint32_t *p) -{ - return (__force __be32)__swab32p(p); -} -static inline uint32_t __be32_to_cpup(const __be32 *p) -{ - return __swab32p((const uint32_t *)p); -} -static inline __be16 __cpu_to_be16p(const uint16_t *p) -{ - return (__force __be16)__swab16p(p); -} -static inline uint16_t __be16_to_cpup(const __be16 *p) -{ - return __swab16p((const uint16_t *)p); -} -#define __cpu_to_le64s(x) do {} while (0) -#define __le64_to_cpus(x) do {} while (0) -#define __cpu_to_le32s(x) do {} while (0) -#define __le32_to_cpus(x) do {} while (0) -#define __cpu_to_le16s(x) do {} while (0) -#define __le16_to_cpus(x) do {} while (0) -#define __cpu_to_be64s(x) __swab64s((x)) -#define __be64_to_cpus(x) __swab64s((x)) -#define __cpu_to_be32s(x) __swab32s((x)) -#define __be32_to_cpus(x) __swab32s((x)) -#define __cpu_to_be16s(x) __swab16s((x)) -#define __be16_to_cpus(x) __swab16s((x)) - -#include - -#endif /* __XEN_BYTEORDER_LITTLE_ENDIAN_H__ */ diff --git a/xen/include/xen/byteorder/swab.h b/xen/include/xen/byteorder/swab.h deleted file mode 100644 index ffcf1cf800b2..000000000000 --- a/xen/include/xen/byteorder/swab.h +++ /dev/null @@ -1,179 +0,0 @@ -#ifndef __XEN_BYTEORDER_SWAB_H__ -#define __XEN_BYTEORDER_SWAB_H__ - -/* - * Byte-swapping, independently from CPU endianness - * swabXX[ps]?(foo) - * - * Francois-Rene Rideau 19971205 - * separated swab functions from cpu_to_XX, - * to clean up support for bizarre-endian architectures. - */ - -#define ___swab16(x) \ -({ \ - uint16_t x_ = (x); \ - (uint16_t)( \ - (((uint16_t)(x_) & 0x00ffU) << 8) | \ - (((uint16_t)(x_) & 0xff00U) >> 8)); \ -}) - -#define ___swab32(x) \ -({ \ - uint32_t x_ = (x); \ - (uint32_t)( \ - (((uint32_t)(x_) & 0x000000ffU) << 24) | \ - (((uint32_t)(x_) & 0x0000ff00U) << 8) | \ - (((uint32_t)(x_) & 0x00ff0000U) >> 8) | \ - (((uint32_t)(x_) & 0xff000000U) >> 24)); \ -}) - -#define ___swab64(x) \ -({ \ - uint64_t x_ = (x); \ - (uint64_t)( \ - (((uint64_t)(x_) & 0x00000000000000ffULL) << 56) | \ - (((uint64_t)(x_) & 0x000000000000ff00ULL) << 40) | \ - (((uint64_t)(x_) & 0x0000000000ff0000ULL) << 24) | \ - (((uint64_t)(x_) & 0x00000000ff000000ULL) << 8) | \ - (((uint64_t)(x_) & 0x000000ff00000000ULL) >> 8) | \ - (((uint64_t)(x_) & 0x0000ff0000000000ULL) >> 24) | \ - (((uint64_t)(x_) & 0x00ff000000000000ULL) >> 40) | \ - (((uint64_t)(x_) & 0xff00000000000000ULL) >> 56)); \ -}) - -#define ___constant_swab16(x) \ - ((uint16_t)( \ - (((uint16_t)(x) & 0x00ffU) << 8) | \ - (((uint16_t)(x) & 0xff00U) >> 8))) -#define ___constant_swab32(x) \ - ((uint32_t)( \ - (((uint32_t)(x) & 0x000000ffU) << 24) | \ - (((uint32_t)(x) & 0x0000ff00U) << 8) | \ - (((uint32_t)(x) & 0x00ff0000U) >> 8) | \ - (((uint32_t)(x) & 0xff000000U) >> 24))) -#define ___constant_swab64(x) \ - ((uint64_t)( \ - (((uint64_t)(x) & 0x00000000000000ffULL) << 56) | \ - (((uint64_t)(x) & 0x000000000000ff00ULL) << 40) | \ - (((uint64_t)(x) & 0x0000000000ff0000ULL) << 24) | \ - (((uint64_t)(x) & 0x00000000ff000000ULL) << 8) | \ - (((uint64_t)(x) & 0x000000ff00000000ULL) >> 8) | \ - (((uint64_t)(x) & 0x0000ff0000000000ULL) >> 24) | \ - (((uint64_t)(x) & 0x00ff000000000000ULL) >> 40) | \ - (((uint64_t)(x) & 0xff00000000000000ULL) >> 56))) - -/* - * provide defaults when no architecture-specific optimization is detected - */ -#ifndef __arch__swab16 -# define __arch__swab16(x) ___swab16(x) -#endif -#ifndef __arch__swab32 -# define __arch__swab32(x) ___swab32(x) -#endif -#ifndef __arch__swab64 -# define __arch__swab64(x) ___swab64(x) -#endif - -#ifndef __arch__swab16p -# define __arch__swab16p(x) __arch__swab16(*(x)) -#endif -#ifndef __arch__swab32p -# define __arch__swab32p(x) __arch__swab32(*(x)) -#endif -#ifndef __arch__swab64p -# define __arch__swab64p(x) __arch__swab64(*(x)) -#endif - -#ifndef __arch__swab16s -# define __arch__swab16s(x) do { *(x) = __arch__swab16p((x)); } while (0) -#endif -#ifndef __arch__swab32s -# define __arch__swab32s(x) do { *(x) = __arch__swab32p((x)); } while (0) -#endif -#ifndef __arch__swab64s -# define __arch__swab64s(x) do { *(x) = __arch__swab64p((x)); } while (0) -#endif - - -/* - * Allow constant folding - */ -#if defined(__GNUC__) && defined(__OPTIMIZE__) -# define __swab16(x) \ -(__builtin_constant_p((uint16_t)(x)) ? \ - ___swab16((x)) : \ - __fswab16((x))) -# define __swab32(x) \ -(__builtin_constant_p((uint32_t)(x)) ? \ - ___swab32((x)) : \ - __fswab32((x))) -# define __swab64(x) \ -(__builtin_constant_p((uint64_t)(x)) ? \ - ___swab64((x)) : \ - __fswab64((x))) -#else -# define __swab16(x) __fswab16(x) -# define __swab32(x) __fswab32(x) -# define __swab64(x) __fswab64(x) -#endif /* OPTIMIZE */ - - -static inline attr_const uint16_t __fswab16(uint16_t x) -{ - return __arch__swab16(x); -} -static inline uint16_t __swab16p(const uint16_t *x) -{ - return __arch__swab16p(x); -} -static inline void __swab16s(uint16_t *addr) -{ - __arch__swab16s(addr); -} - -static inline attr_const uint32_t __fswab32(uint32_t x) -{ - return __arch__swab32(x); -} -static inline uint32_t __swab32p(const uint32_t *x) -{ - return __arch__swab32p(x); -} -static inline void __swab32s(uint32_t *addr) -{ - __arch__swab32s(addr); -} - -#ifdef __BYTEORDER_HAS_U64__ -static inline attr_const uint64_t __fswab64(uint64_t x) -{ -# ifdef __SWAB_64_THRU_32__ - uint32_t h = x >> 32, l = x; - return ((uint64_t)__swab32(l) << 32) | __swab32(h); -# else - return __arch__swab64(x); -# endif -} -static inline uint64_t __swab64p(const uint64_t *x) -{ - return __arch__swab64p(x); -} -static inline void __swab64s(uint64_t *addr) -{ - __arch__swab64s(addr); -} -#endif /* __BYTEORDER_HAS_U64__ */ - -#define swab16 __swab16 -#define swab32 __swab32 -#define swab64 __swab64 -#define swab16p __swab16p -#define swab32p __swab32p -#define swab64p __swab64p -#define swab16s __swab16s -#define swab32s __swab32s -#define swab64s __swab64s - -#endif /* __XEN_BYTEORDER_SWAB_H__ */ From patchwork Wed Apr 16 11:58:54 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 14053765 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 644C6C369BD for ; Wed, 16 Apr 2025 11:59:24 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.955723.1349392 (Exim 4.92) (envelope-from ) id 1u51QA-0007xp-MB; Wed, 16 Apr 2025 11:59:14 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 955723.1349392; Wed, 16 Apr 2025 11:59:14 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1u51QA-0007vP-EC; Wed, 16 Apr 2025 11:59:14 +0000 Received: by outflank-mailman (input) for mailman id 955723; Wed, 16 Apr 2025 11:59:12 +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 1u51Q8-0006At-2e for xen-devel@lists.xenproject.org; Wed, 16 Apr 2025 11:59:12 +0000 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [2a00:1450:4864:20::335]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 35b8e1c9-1aba-11f0-9eaf-5ba50f476ded; Wed, 16 Apr 2025 13:59:11 +0200 (CEST) Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-43cfdc2c8c9so36615465e9.2 for ; Wed, 16 Apr 2025 04:59:11 -0700 (PDT) Received: from localhost.localdomain (host-92-26-98-202.as13285.net. [92.26.98.202]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4405b5a9846sm18761905e9.35.2025.04.16.04.59.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Apr 2025 04:59:10 -0700 (PDT) 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: 35b8e1c9-1aba-11f0-9eaf-5ba50f476ded DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1744804751; x=1745409551; 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=3cQlbXBh+jcctTBYJ/pIz+f4SLnRiEo7nbWjXEuys/8=; b=lXXD77ZcIERhAsGh5hG8mK44eQn1UmhgNaNWXEcW/33X5b606jSGwD2LmAZy9ujspc O4ZepxM8M0qwliCToB97bpaHWPFSWCFgSUgw5ows5s+L3g5BclYyEIdeS6jQgGkErHti ZBa6ok9TQ8E0IdsO40oYMNp/WC7yWspUrSRMQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744804751; x=1745409551; 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=3cQlbXBh+jcctTBYJ/pIz+f4SLnRiEo7nbWjXEuys/8=; b=nP7nhembtEy9z6KVg31ncutJREKcZ77NLrggPye2+Ho7UFwGRKmfGrZIMPYlSEXnwg 0LSvpeVkt3cAD6/sk9aD7ozMla3NQd/6jSQ30kwIwDT4tpXkOVDHnzxM6iVUcXdEXGou sRQSGEN7xGGQzJNLviI0UA69MVUtDHEP83IbC6UAAMM7X1DVgGVNEbTvfNcBSEBeGNz1 Q5xnc2VqHBGGZd+OJ+XPwOkAaQelPit3jaGQRdlBTdigntpKcOXzTtNtgGw2RGIhwD/f 2i/dptsai/qE/kQZcFruso26oaMhFBGYHtUnXU8CB0rxOP1LdppBiQpyoszIlHUT/2eP R21Q== X-Gm-Message-State: AOJu0YxRLgu9kacbu0X/9kf1uWhKqj0ItfntJjajV1vM8j4HtjiA59Ce Nc097ccjeuV2fZVku3FgLqGKL/4iBF9IhHnCCHLAJqHDALCwOf2+h7M++HoaYIcdllgs6pKejtp iAYw= X-Gm-Gg: ASbGncuFMLTzH7B6wrBWSwgIrUhD6NrKTvdN88YoffS1uyXbCLG0ct3B06CjTvzl1UH nXTGR9u1F/+dYxf/iKrI0Pd4Knh2jxV2Dlbm9k0PMPI7o7Zi9VP1GmvQLpx3P3GJCBvGWaRI80N A3VeOwhdaUj65mdtK6DmDxGOFrWx53qcc8RmAkbD67bIPocwDHqOWDsYmzDJf0zt090FTKEhF+9 cHcNs7gUydthTvy2OkNlUBQ1h/n26SOFtYNXei69fTrboN2HPNOnCEkRUvk2IMolJLQYuyxFvPF LPtf9d/MSLXd5mDpBd0Ud5hOvK3DDijr29+NytF4jFxGbX0VXbjwv6zvEvB003VP1TdxT94Dpj5 N4voUj31XvMFSPQ== X-Google-Smtp-Source: AGHT+IEQr/bFhOlIxFrn6N+gU79fSmgCSfPoLHNQh2npqot1KwxFoJoszSP6kTUcs2rVUNWncmcX0Q== X-Received: by 2002:a05:600c:5102:b0:43c:fab3:4fad with SMTP id 5b1f17b1804b1-4405d6276cfmr17791185e9.16.1744804750974; Wed, 16 Apr 2025 04:59:10 -0700 (PDT) From: Andrew Cooper To: Xen-devel Cc: Lin Liu , Jan Beulich , Andrew Cooper , Anthony PERARD , Michal Orzel , Julien Grall , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Stefano Stabellini , Volodymyr Babchuk , Bertrand Marquis , Shawn Anastasio , Oleksii Kurochko , "Daniel P . Smith" Subject: [PATCH v6 09/15] crypto/vmac: Switch to xen/byteswap.h Date: Wed, 16 Apr 2025 12:58:54 +0100 Message-Id: <20250416115900.2491661-10-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250416115900.2491661-1-andrew.cooper3@citrix.com> References: <20250416115900.2491661-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 From: Lin Liu This file has its own implementation of swap bytes. Clean up the code with xen/byteswap.h. No functional change. Signed-off-by: Lin Liu Acked-by: Jan Beulich Reviewed-by: Andrew Cooper --- CC: Anthony PERARD CC: Michal Orzel CC: Jan Beulich CC: Julien Grall CC: Roger Pau Monné CC: Stefano Stabellini CC: Volodymyr Babchuk CC: Bertrand Marquis CC: Shawn Anastasio CC: Oleksii Kurochko CC: Daniel P. Smith CC: Lin Liu --- xen/crypto/vmac.c | 76 ++--------------------------------------------- 1 file changed, 3 insertions(+), 73 deletions(-) diff --git a/xen/crypto/vmac.c b/xen/crypto/vmac.c index 294dd16a52cb..acb4e015f511 100644 --- a/xen/crypto/vmac.c +++ b/xen/crypto/vmac.c @@ -8,6 +8,7 @@ /* start for Xen */ #include +#include #include #include #include @@ -50,7 +51,6 @@ const uint64_t mpoly = UINT64_C(0x1fffffff1fffffff); /* Poly key mask */ * MUL64: 64x64->128-bit multiplication * PMUL64: assumes top bits cleared on inputs * ADD128: 128x128->128-bit addition - * GET_REVERSED_64: load and byte-reverse 64-bit word * ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */ @@ -68,22 +68,6 @@ const uint64_t mpoly = UINT64_C(0x1fffffff1fffffff); /* Poly key mask */ #define PMUL64 MUL64 -#define GET_REVERSED_64(p) \ - ({uint64_t x; \ - asm ("bswapq %0" : "=r" (x) : "0"(*(uint64_t *)(p))); x;}) - -/* ----------------------------------------------------------------------- */ -#elif (__GNUC__ && __i386__) -/* ----------------------------------------------------------------------- */ - -#define GET_REVERSED_64(p) \ - ({ uint64_t x; \ - uint32_t *tp = (uint32_t *)(p); \ - asm ("bswap %%edx\n\t" \ - "bswap %%eax" \ - : "=A"(x) \ - : "a"(tp[1]), "d"(tp[0])); \ - x; }) /* ----------------------------------------------------------------------- */ #elif (__GNUC__ && __ppc64__) @@ -103,37 +87,6 @@ const uint64_t mpoly = UINT64_C(0x1fffffff1fffffff); /* Poly key mask */ #define PMUL64 MUL64 -#define GET_REVERSED_64(p) \ - ({ uint32_t hi, lo, *_p = (uint32_t *)(p); \ - asm volatile ("lwbrx %0, %1, %2" : "=r"(lo) : "b%"(0), "r"(_p) ); \ - asm volatile ("lwbrx %0, %1, %2" : "=r"(hi) : "b%"(4), "r"(_p) ); \ - ((uint64_t)hi << 32) | (uint64_t)lo; } ) - -/* ----------------------------------------------------------------------- */ -#elif (__GNUC__ && (__ppc__ || __PPC__)) -/* ----------------------------------------------------------------------- */ - -#define GET_REVERSED_64(p) \ - ({ uint32_t hi, lo, *_p = (uint32_t *)(p); \ - asm volatile ("lwbrx %0, %1, %2" : "=r"(lo) : "b%"(0), "r"(_p) ); \ - asm volatile ("lwbrx %0, %1, %2" : "=r"(hi) : "b%"(4), "r"(_p) ); \ - ((uint64_t)hi << 32) | (uint64_t)lo; } ) - -/* ----------------------------------------------------------------------- */ -#elif (__GNUC__ && (__ARMEL__ || __ARM__)) -/* ----------------------------------------------------------------------- */ - -#define bswap32(v) \ -({ uint32_t tmp,out; \ - asm volatile( \ - "eor %1, %2, %2, ror #16\n" \ - "bic %1, %1, #0x00ff0000\n" \ - "mov %0, %2, ror #8\n" \ - "eor %0, %0, %1, lsr #8" \ - : "=r" (out), "=&r" (tmp) \ - : "r" (v)); \ - out;}) - /* ----------------------------------------------------------------------- */ #elif _MSC_VER /* ----------------------------------------------------------------------- */ @@ -154,11 +107,6 @@ const uint64_t mpoly = UINT64_C(0x1fffffff1fffffff); /* Poly key mask */ (rh) += (ih) + ((rl) < (_il)); \ } -#if _MSC_VER >= 1300 -#define GET_REVERSED_64(p) _byteswap_uint64(*(uint64_t *)(p)) -#pragma intrinsic(_byteswap_uint64) -#endif - #if _MSC_VER >= 1400 && \ (!defined(__INTEL_COMPILER) || __INTEL_COMPILER >= 1000) #define MUL32(i1,i2) (__emulu((uint32_t)(i1),(uint32_t)(i2))) @@ -219,24 +167,6 @@ const uint64_t mpoly = UINT64_C(0x1fffffff1fffffff); /* Poly key mask */ } #endif -#ifndef GET_REVERSED_64 -#ifndef bswap64 -#ifndef bswap32 -#define bswap32(x) \ - ({ uint32_t bsx = (x); \ - ((((bsx) & 0xff000000u) >> 24) | (((bsx) & 0x00ff0000u) >> 8) | \ - (((bsx) & 0x0000ff00u) << 8) | (((bsx) & 0x000000ffu) << 24)); }) -#endif -#define bswap64(x) \ - ({ union { uint64_t ll; uint32_t l[2]; } w, r; \ - w.ll = (x); \ - r.l[0] = bswap32 (w.l[1]); \ - r.l[1] = bswap32 (w.l[0]); \ - r.ll; }) -#endif -#define GET_REVERSED_64(p) bswap64(*(uint64_t *)(p)) -#endif - /* ----------------------------------------------------------------------- */ #if (VMAC_PREFER_BIG_ENDIAN) @@ -247,9 +177,9 @@ const uint64_t mpoly = UINT64_C(0x1fffffff1fffffff); /* Poly key mask */ #if (VMAC_ARCH_BIG_ENDIAN) # define get64BE(ptr) (*(uint64_t *)(ptr)) -# define get64LE(ptr) GET_REVERSED_64(ptr) +# define get64LE(ptr) bswap64(*(uint64_t *)(ptr)) #else /* assume little-endian */ -# define get64BE(ptr) GET_REVERSED_64(ptr) +# define get64BE(ptr) bswap64(*(uint64_t *)(ptr)) # define get64LE(ptr) (*(uint64_t *)(ptr)) #endif From patchwork Wed Apr 16 11:58:55 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 14053767 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 0EF69C369CD for ; Wed, 16 Apr 2025 11:59:23 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.955724.1349399 (Exim 4.92) (envelope-from ) id 1u51QB-00084q-E8; Wed, 16 Apr 2025 11:59:15 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 955724.1349399; Wed, 16 Apr 2025 11:59:15 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1u51QA-00082F-Uq; Wed, 16 Apr 2025 11:59:14 +0000 Received: by outflank-mailman (input) for mailman id 955724; Wed, 16 Apr 2025 11:59:13 +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 1u51Q9-0006At-0Z for xen-devel@lists.xenproject.org; Wed, 16 Apr 2025 11:59:13 +0000 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [2a00:1450:4864:20::32a]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 363bbcde-1aba-11f0-9eaf-5ba50f476ded; Wed, 16 Apr 2025 13:59:12 +0200 (CEST) Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-43ce70f9afbso68171225e9.0 for ; Wed, 16 Apr 2025 04:59:12 -0700 (PDT) Received: from localhost.localdomain (host-92-26-98-202.as13285.net. [92.26.98.202]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4405b5a9846sm18761905e9.35.2025.04.16.04.59.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Apr 2025 04:59:11 -0700 (PDT) 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: 363bbcde-1aba-11f0-9eaf-5ba50f476ded DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1744804752; x=1745409552; 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=BmZBy1HYwNbyvSgffQY0Av0rirqEVUXWQRNDyNJH/e8=; b=jddy8dA45gqnIVnEEjl/bVB8s0PRO6gZPHoa4Os5rkRH0gg9eOAlDTE2Vzfs8hToq1 ihJ7imG9aHPx0cEcb+BiR1Aq+Fo0PBmSA9QLR1ouBVYTzWlIPqoorcnFiQ6zYgP8Pj4B swuIHEygHT+57l7KxxdFy2bHz88nuTBWzP77c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744804752; x=1745409552; 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=BmZBy1HYwNbyvSgffQY0Av0rirqEVUXWQRNDyNJH/e8=; b=fTgzxCIJssxt6hgBTTsCfJTxzQdl+ebsdJtEvEDdE4Is/Amu6/T+jv7RUFQKLb/yRm PxY5ipbiq1L60tf0Nn6PLc0ocGGuSCWqUk8xlTnf2lRNB1MUuxGXLKLNgfHnzUjz/JK4 8c1DQd9/trAkP8XyfSZ7TuepijJkMo12MFCmwPtJ1Jvzr8RsdLwv6ldN0/GEz1QIiP8g woWjNnTwbhkkcSfN3rRHrBtclooyuevjOzsoAofDpeAMV9HDJQdVMkJJtHHtmfVkTsGJ M19L8D8Tvelg7DdCE8ZuuKDX8+qorulyLsDnc8qrkZZIBx4s1YOmiVeOiwfElELSSy+M hFBg== X-Gm-Message-State: AOJu0Yzv1ulsGAUw/EsEfXkC84SJyz/XHuvtQbjcetEAHDcGWZ8DfD73 D1bPnMEsEjK3AFCgf6y25rTBn2egUdLHrL9Pxb8YQKs4DA+VB6Nd0NNfVFrYbZVICYMa9T7GkRI QcoU= X-Gm-Gg: ASbGncufQ/zb7PS6mKSXxk7wfif+vITdlG1AUubR5rFY9Lo7XMesOYrDVXxcgTO2gxe pGsSi04UyECUO3L6B28RRgReaOR1mD2tleWXut4Fq/i6CQp4uEnZ5f4R8LnxkGRoubQ+2O0J2re jTUYP6RwEaeUyXOq/8rUVwN4G50b1bJZQ5YCY+hcQonU/1LTlvU+EvguEnsDVhUlIPbAvrHj+lv pOBixSxcyndzuHYO+4XQiTB38EQ9cZs6rQ22+mjRQm6ZoO5IwNRzTzCGF6VLTR8SIZWTwKiZ/za lfOTTh7/QqkcGDTpbww4L5PnsTw6T09u/qkJ+mCOLwyhVzT5PEzS7t9cgMVg5RG1lk9q9WQ1zA8 3c+y7GQ40S5tl/w== X-Google-Smtp-Source: AGHT+IFkBawxMNVHejaCD1UUjlp6EMAu1xH4XI62dkEJnQI4hxsoWxwWdgur4xV+uXPofj2ZjToCrg== X-Received: by 2002:a05:600c:350e:b0:43d:878c:7c40 with SMTP id 5b1f17b1804b1-4405f2fae8fmr11744555e9.10.1744804751848; Wed, 16 Apr 2025 04:59:11 -0700 (PDT) From: Andrew Cooper To: Xen-devel Cc: Andrew Cooper , Anthony PERARD , Michal Orzel , Jan Beulich , Julien Grall , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Stefano Stabellini , Volodymyr Babchuk , Bertrand Marquis , Shawn Anastasio , Oleksii Kurochko , "Daniel P . Smith" , Lin Liu Subject: [PATCH v6 10/15] xsm/flask: Switch {asm -> xen}/byteorder.h Date: Wed, 16 Apr 2025 12:58:55 +0100 Message-Id: <20250416115900.2491661-11-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250416115900.2491661-1-andrew.cooper3@citrix.com> References: <20250416115900.2491661-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Sort the includes while at it. No functional change. Signed-off-by: Andrew Cooper Acked-by: Daniel P. Smith --- CC: Anthony PERARD CC: Michal Orzel CC: Jan Beulich CC: Julien Grall CC: Roger Pau Monné CC: Stefano Stabellini CC: Volodymyr Babchuk CC: Bertrand Marquis CC: Shawn Anastasio CC: Oleksii Kurochko CC: Daniel P. Smith CC: Lin Liu v5: * New --- xen/xsm/flask/ss/avtab.c | 4 ++-- xen/xsm/flask/ss/conditional.c | 9 ++++----- xen/xsm/flask/ss/ebitmap.c | 9 ++++----- xen/xsm/flask/ss/policydb.c | 7 +++---- 4 files changed, 13 insertions(+), 16 deletions(-) diff --git a/xen/xsm/flask/ss/avtab.c b/xen/xsm/flask/ss/avtab.c index 9761d028d82d..2d07917e79e5 100644 --- a/xen/xsm/flask/ss/avtab.c +++ b/xen/xsm/flask/ss/avtab.c @@ -19,11 +19,11 @@ /* Ported to Xen 3.0, George Coker, */ +#include +#include #include -#include #include #include -#include #include "avtab.h" #include "policydb.h" diff --git a/xen/xsm/flask/ss/conditional.c b/xen/xsm/flask/ss/conditional.c index d314f772b405..a0d255596204 100644 --- a/xen/xsm/flask/ss/conditional.c +++ b/xen/xsm/flask/ss/conditional.c @@ -9,15 +9,14 @@ /* Ported to Xen 3.0, George Coker, */ -#include -#include +#include #include -#include +#include #include +#include +#include #include -#include - #include "security.h" #include "conditional.h" diff --git a/xen/xsm/flask/ss/ebitmap.c b/xen/xsm/flask/ss/ebitmap.c index 1db69d9ad1bd..1ced81ea0287 100644 --- a/xen/xsm/flask/ss/ebitmap.c +++ b/xen/xsm/flask/ss/ebitmap.c @@ -10,13 +10,12 @@ /* Ported to Xen 3.0, George Coker, */ -#include -#include +#include +#include #include +#include #include -#include - -#include +#include #include "ebitmap.h" #include "policydb.h" diff --git a/xen/xsm/flask/ss/policydb.c b/xen/xsm/flask/ss/policydb.c index 5af45fdc2783..165304c1331c 100644 --- a/xen/xsm/flask/ss/policydb.c +++ b/xen/xsm/flask/ss/policydb.c @@ -22,13 +22,12 @@ /* Ported to Xen 3.0, George Coker, */ +#include +#include #include +#include #include #include -#include -#include - -#include #include #include "security.h" From patchwork Wed Apr 16 11:58:56 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 14053769 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 209C4C369C7 for ; Wed, 16 Apr 2025 11:59:28 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.955726.1349416 (Exim 4.92) (envelope-from ) id 1u51QD-00009S-Nd; Wed, 16 Apr 2025 11:59:17 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 955726.1349416; Wed, 16 Apr 2025 11:59:17 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1u51QD-000063-8Z; Wed, 16 Apr 2025 11:59:17 +0000 Received: by outflank-mailman (input) for mailman id 955726; Wed, 16 Apr 2025 11:59:14 +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 1u51QA-0006At-J7 for xen-devel@lists.xenproject.org; Wed, 16 Apr 2025 11:59:14 +0000 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [2a00:1450:4864:20::42b]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 37285338-1aba-11f0-9eaf-5ba50f476ded; Wed, 16 Apr 2025 13:59:14 +0200 (CEST) Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-39bf44be22fso4319763f8f.0 for ; Wed, 16 Apr 2025 04:59:14 -0700 (PDT) Received: from localhost.localdomain (host-92-26-98-202.as13285.net. [92.26.98.202]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4405b5a9846sm18761905e9.35.2025.04.16.04.59.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Apr 2025 04:59:13 -0700 (PDT) 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: 37285338-1aba-11f0-9eaf-5ba50f476ded DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1744804753; x=1745409553; 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=aJ5V0P88d1F7HxoaZFwruMbGQzYzPCa7L7yGSkYModM=; b=cHZx5n2lp2Ktb4Cq56nT3oJ5tckEHN7zN1qwJ3hgiGh+xXZElYOOleVQ8fPlAgBEUl /U6BV93Gw1tzoCUfZJXu0ySxpF1Y+1ReWfOJVbC/GMukmcQT7kU5F1/kJJUKEFHG+KqF FPPHwP629vvfIYwVtp3EV24e2lfrVX8YO4Dow= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744804753; x=1745409553; 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=aJ5V0P88d1F7HxoaZFwruMbGQzYzPCa7L7yGSkYModM=; b=tbTXlQkxbEGCRBm1jaoOL0Vuqt/MHogsVR/1wJNGUERLzEXjS5texMDXV3hCiLHeD6 xKQUtyxMXzly7dE8BgRI2tBKYuxG0GhtopNEYzinSFIT7U0PL3PWrAcCGTEuS94b9oAn 516tWvQg7hEqghHIC5YYbkTSqqWyik9TWLGjk41buLSMl1jXnuslMJx3uApVLRf5jN8j 1U2wFlVMx+RQKp89OnXt1WSHi3sGMXGP/rbF9QO7peBABwFzfZHzWtMC1AYRjB47Qh0U F4zoaIUJMRucatkXySqThLQJg7aCkfys4hVZGrxdO/Dli3vREf5UsR4WnMTiEgqQr2B5 ujhQ== X-Gm-Message-State: AOJu0Yyz92/PwGE4wwlUMqwlF5jTYb8pUzqqvwK9EvTFWEhM73Hi6oKK 3vqgMEQG+Ng/rsB4zTgKYoGgqbzU/r/5WZdoMwGNAuF/Le0FphFFgFkzFrTo0BId0a7BVTmEDQU ne+8= X-Gm-Gg: ASbGncvwgbaiyGHNT/BdDoxb7cDXEraUopdbC+F6cA21CRRSM2HJAqzk4hJ0ln05Pn3 8iQ7c6J0B2xt4UB/HS0hchfzX0fGtvWPPlqr9HOtoWwKaDu+m9bOIArOVm8wyeDjGGE+u3CpGLY oW4iqocZz5CyzRR6vBwzrEFhBRkGWiBNky5j4+He7Ox0bJEEmdm1cXUDoHLGwu1c+TXyy6BX03y jPT3faMjKXSUM7XzzZAtu/Y45r2anZAiRU5GXI5E2Ed5b340gmNqQrJUEIpBJxuPL0r0+sPSwf3 PJhXyU0OHtFA/5BxilxSqOgUGB6IWJXaSeNQTxUF08OzEGcekhKtFiFQxYOpR5UTfBzLU2hLReJ wu0idzze3g5LI7Q== X-Google-Smtp-Source: AGHT+IF9+/KHvB9FAAE/VaTgaEdTj1u6zaTbU7LY/Qac2HW1lWpp1QvowZK5q4BisVdQzSHEqjCMUw== X-Received: by 2002:a05:6000:420e:b0:39e:e3ef:5cbf with SMTP id ffacd0b85a97d-39ee5b16a16mr1481144f8f.24.1744804753341; Wed, 16 Apr 2025 04:59:13 -0700 (PDT) From: Andrew Cooper To: Xen-devel Cc: Andrew Cooper , Jan Beulich , Anthony PERARD , Michal Orzel , Julien Grall , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Stefano Stabellini , Volodymyr Babchuk , Bertrand Marquis , Shawn Anastasio , Oleksii Kurochko , "Daniel P . Smith" , Lin Liu Subject: [PATCH v6 11/15] xen/common: Switch {asm -> xen}/byteorder.h Date: Wed, 16 Apr 2025 12:58:56 +0100 Message-Id: <20250416115900.2491661-12-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250416115900.2491661-1-andrew.cooper3@citrix.com> References: <20250416115900.2491661-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Sort the includes. Drop useless includes of xen/types.h Signed-off-by: Andrew Cooper Acked-by: Jan Beulich --- CC: Anthony PERARD CC: Michal Orzel CC: Jan Beulich CC: Julien Grall CC: Roger Pau Monné CC: Stefano Stabellini CC: Volodymyr Babchuk CC: Bertrand Marquis CC: Shawn Anastasio CC: Oleksii Kurochko CC: Daniel P. Smith CC: Lin Liu v5: * New --- xen/common/bitmap.c | 5 ++--- xen/common/libelf/libelf-private.h | 3 ++- xen/drivers/char/ehci-dbgp.c | 4 +++- xen/include/xen/bitmap.h | 2 +- xen/include/xen/device_tree.h | 3 ++- xen/include/xen/libfdt/libfdt_env.h | 3 +-- xen/include/xen/unaligned.h | 3 +-- 7 files changed, 12 insertions(+), 11 deletions(-) diff --git a/xen/common/bitmap.c b/xen/common/bitmap.c index 6c4af09c18cb..bf1a7fd91e36 100644 --- a/xen/common/bitmap.c +++ b/xen/common/bitmap.c @@ -5,14 +5,13 @@ * This source code is licensed under the GNU General Public License, * Version 2. See the file COPYING for more details. */ -#include -#include #include #include +#include #include +#include #include #include -#include /* * bitmaps provide an array of bits, implemented using an an diff --git a/xen/common/libelf/libelf-private.h b/xen/common/libelf/libelf-private.h index 65417dffc8a0..e5c9cc109972 100644 --- a/xen/common/libelf/libelf-private.h +++ b/xen/common/libelf/libelf-private.h @@ -17,10 +17,11 @@ #ifdef __XEN__ +#include #include #include #include -#include + #include /* we would like to use elf->log_callback but we can't because diff --git a/xen/drivers/char/ehci-dbgp.c b/xen/drivers/char/ehci-dbgp.c index 1ad3c6bebf87..e9cd59b25463 100644 --- a/xen/drivers/char/ehci-dbgp.c +++ b/xen/drivers/char/ehci-dbgp.c @@ -5,15 +5,17 @@ * Linux; see the Linux source for authorship and copyrights. */ +#include #include #include #include #include #include #include -#include + #include #include + #include /* #define DBGP_DEBUG */ diff --git a/xen/include/xen/bitmap.h b/xen/include/xen/bitmap.h index 4b642cd4207b..b5e9cdd3db86 100644 --- a/xen/include/xen/bitmap.h +++ b/xen/include/xen/bitmap.h @@ -230,7 +230,7 @@ static inline unsigned int bitmap_weight(const unsigned long *src, return __bitmap_weight(src, nbits); } -#include +#include #ifdef __LITTLE_ENDIAN #define BITMAP_MEM_ALIGNMENT 8 diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h index 0ff80fda04da..6dc1fb5159cd 100644 --- a/xen/include/xen/device_tree.h +++ b/xen/include/xen/device_tree.h @@ -10,7 +10,8 @@ #ifndef __XEN_DEVICE_TREE_H__ #define __XEN_DEVICE_TREE_H__ -#include +#include + #include #include #include diff --git a/xen/include/xen/libfdt/libfdt_env.h b/xen/include/xen/libfdt/libfdt_env.h index 8368787391b7..04abc6bb68c6 100644 --- a/xen/include/xen/libfdt/libfdt_env.h +++ b/xen/include/xen/libfdt/libfdt_env.h @@ -7,9 +7,8 @@ * Copyright 2012 Kim Phillips, Freescale Semiconductor. */ -#include +#include #include -#include #ifdef __CHECKER__ #define FDT_FORCE __attribute__((force)) diff --git a/xen/include/xen/unaligned.h b/xen/include/xen/unaligned.h index 8c8b08338b8d..e64813ab4b20 100644 --- a/xen/include/xen/unaligned.h +++ b/xen/include/xen/unaligned.h @@ -3,8 +3,7 @@ #define __XEN_UNALIGNED_H__ #ifdef __XEN__ -#include -#include +#include #endif /* From patchwork Wed Apr 16 11:58:57 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 14053768 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 7BA4FC369C4 for ; Wed, 16 Apr 2025 11:59:27 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.955728.1349424 (Exim 4.92) (envelope-from ) id 1u51QE-0000OR-Ue; Wed, 16 Apr 2025 11:59:18 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 955728.1349424; Wed, 16 Apr 2025 11:59:18 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1u51QE-0000Kc-3O; Wed, 16 Apr 2025 11:59:18 +0000 Received: by outflank-mailman (input) for mailman id 955728; Wed, 16 Apr 2025 11:59:15 +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 1u51QB-0006At-CV for xen-devel@lists.xenproject.org; Wed, 16 Apr 2025 11:59:15 +0000 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [2a00:1450:4864:20::330]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 37b3e36b-1aba-11f0-9eaf-5ba50f476ded; Wed, 16 Apr 2025 13:59:15 +0200 (CEST) Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-43d07ca6a80so32146835e9.1 for ; Wed, 16 Apr 2025 04:59:15 -0700 (PDT) Received: from localhost.localdomain (host-92-26-98-202.as13285.net. [92.26.98.202]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4405b5a9846sm18761905e9.35.2025.04.16.04.59.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Apr 2025 04:59:13 -0700 (PDT) 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: 37b3e36b-1aba-11f0-9eaf-5ba50f476ded DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1744804754; x=1745409554; 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=Ndy0JOtlK/bC2KJaj8i9qdYW+j1KeU0OftG9F4DlSoM=; b=W5PUoJV4Cbz53aVPvMV+PTTukz/QKOtf2oBkR3J8TI+XmVvaQHLRNP0n6dF3labp1Y 7E2CSBYeC2dUilpHnv5wQoe0FEImV8u84+fpkz//BJoQkOhBN9XDZhmxKOguxRk7J8/q OR7opn7TLjXCYAumNjGml8Hj1qGnv8FX8Rs7g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744804754; x=1745409554; 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=Ndy0JOtlK/bC2KJaj8i9qdYW+j1KeU0OftG9F4DlSoM=; b=URXY3vYBP68+3j2zkyv7htW+a+/hJ63RWh30V0zo459jtHXdB8Gdpe10oRBFL5ZSji s5j6rn6tjGNI+WquQCkomrSSqSqxNEUJ+yekU141hfZ6ct92pvTZLD3SU3qu4laoV2lf 9SosWGkXgsgJAYicx4MeM1MpB5cNaLcALXghRRXt0l14SUOxiFzmCWdAJ+UZabwEIfb4 7Q03gGuZ81nQGF33i3qLrn5Bl5dbzFN93sV4U2qZnCjxYPHLGxZcGx1vZKytaIKf7JBH /LS6dqGAClcwg09mZDXGHGw5ViTKR1j6oz0N8JyCuJlhMEx6bckvpyI2lygF7Jgvz6cX 9njg== X-Gm-Message-State: AOJu0YxEh+VuYpx4+Quy2u7tSwxsYBo5vqMmFsqR+04o76aAralLTKlo ou2phkb4ncLa4HZ6Xp0Ub8G8yUPM8Nb836Jx96udh/rufRX3ZRKXLuDvIhrQGcDqlc0u7KuVMo3 haAo= X-Gm-Gg: ASbGncvG4GJrH5mNjgLqvAyq1HiyjCp3CkDl7JoYizQoT6ygiXJDMySdxHUQ+EKR+LG ecx/X9NTgLyDLPopuiQiT5/jP4teOQQ9FBe5W3AUIJmmGx2qQlZ8mq/WDd8UoIz1c9wjFNJsKQg xA/3Sv8ByQB8hmBxqL1WHzKkPWaz8Vasxsjkt5rd9VJpmhCPqle/x47NXOWEXzsh27C3LgWq9Y8 kXcTLwxfGl2PUbCmtPbQt8YlrZYY6UTsPOF5QAIu+mJBNDyT3fhF0p4Qaw6oybKpcVcRUgkuZCB CBUTwFRHBEDW3edwgsy67Nf5YisERnhBkKPKfevjIj3JK0UAlHHR/vFOU4wUbPwGvbk45b7sGkf 68oTmTY1+AhJIyiInSv7J3W1T X-Google-Smtp-Source: AGHT+IHjitMFCJIsOumP7C7YLSXHYWhRq5UWsU2ckJinOJ8U3LIkkSfZML+N3VGJ5UBDzmHXLpes4g== X-Received: by 2002:a05:600d:1:b0:43b:d0fe:b8ac with SMTP id 5b1f17b1804b1-4405fbffccbmr7736715e9.30.1744804754200; Wed, 16 Apr 2025 04:59:14 -0700 (PDT) From: Andrew Cooper To: Xen-devel Cc: Andrew Cooper , Anthony PERARD , Michal Orzel , Jan Beulich , Julien Grall , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Stefano Stabellini , Volodymyr Babchuk , Bertrand Marquis , Shawn Anastasio , Oleksii Kurochko , "Daniel P . Smith" , Lin Liu Subject: [PATCH v6 12/15] arm: Remove asm/byteorder.h Date: Wed, 16 Apr 2025 12:58:57 +0100 Message-Id: <20250416115900.2491661-13-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250416115900.2491661-1-andrew.cooper3@citrix.com> References: <20250416115900.2491661-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 With the common code moved fully onto xen/byteorder.h, clean up the dregs. Sort includes in some files while swapping over to xen/byteorder.h. No functional change. Signed-off-by: Andrew Cooper Acked-by: Stefano Stabellini --- CC: Anthony PERARD CC: Michal Orzel CC: Jan Beulich CC: Julien Grall CC: Roger Pau Monné CC: Stefano Stabellini CC: Volodymyr Babchuk CC: Bertrand Marquis CC: Shawn Anastasio CC: Oleksii Kurochko CC: Daniel P. Smith CC: Lin Liu v5: * New --- xen/arch/arm/alternative.c | 6 +++--- xen/arch/arm/arm64/livepatch.c | 2 +- xen/arch/arm/include/asm/arm32/io.h | 3 ++- xen/arch/arm/include/asm/arm64/io.h | 3 ++- xen/arch/arm/include/asm/byteorder.h | 14 -------------- xen/arch/arm/kernel.c | 2 +- xen/arch/arm/vgic/vgic-mmio.c | 3 ++- 7 files changed, 11 insertions(+), 22 deletions(-) delete mode 100644 xen/arch/arm/include/asm/byteorder.h diff --git a/xen/arch/arm/alternative.c b/xen/arch/arm/alternative.c index 2c1af6e7e426..adb9b7d8814b 100644 --- a/xen/arch/arm/alternative.c +++ b/xen/arch/arm/alternative.c @@ -6,18 +6,18 @@ * Copyright (C) 2014-2016 ARM Ltd. */ +#include #include -#include #include #include #include -#include #include #include #include +#include + #include #include -#include #include #include #include diff --git a/xen/arch/arm/arm64/livepatch.c b/xen/arch/arm/arm64/livepatch.c index 6efe4ec770d4..e135bd5bf99a 100644 --- a/xen/arch/arm/arm64/livepatch.c +++ b/xen/arch/arm/arm64/livepatch.c @@ -3,6 +3,7 @@ */ #include +#include #include #include #include @@ -11,7 +12,6 @@ #include #include -#include #include #include diff --git a/xen/arch/arm/include/asm/arm32/io.h b/xen/arch/arm/include/asm/arm32/io.h index 782b564809e3..fb0425e62930 100644 --- a/xen/arch/arm/include/asm/arm32/io.h +++ b/xen/arch/arm/include/asm/arm32/io.h @@ -21,8 +21,9 @@ #ifndef _ARM_ARM32_IO_H #define _ARM_ARM32_IO_H +#include + #include -#include static inline void __raw_writeb(u8 val, volatile void __iomem *addr) { diff --git a/xen/arch/arm/include/asm/arm64/io.h b/xen/arch/arm/include/asm/arm64/io.h index 2e2ab24f7838..7d5959877759 100644 --- a/xen/arch/arm/include/asm/arm64/io.h +++ b/xen/arch/arm/include/asm/arm64/io.h @@ -20,8 +20,9 @@ #ifndef _ARM_ARM64_IO_H #define _ARM_ARM64_IO_H +#include + #include -#include #include /* diff --git a/xen/arch/arm/include/asm/byteorder.h b/xen/arch/arm/include/asm/byteorder.h deleted file mode 100644 index 7f1419c45a16..000000000000 --- a/xen/arch/arm/include/asm/byteorder.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef __ASM_ARM_BYTEORDER_H__ -#define __ASM_ARM_BYTEORDER_H__ - -#include - -#endif /* __ASM_ARM_BYTEORDER_H__ */ -/* - * Local variables: - * mode: C - * c-file-style: "BSD" - * c-basic-offset: 4 - * indent-tabs-mode: nil - * End: - */ diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c index 6eaf9e2b06b3..2647812e8e3e 100644 --- a/xen/arch/arm/kernel.c +++ b/xen/arch/arm/kernel.c @@ -4,6 +4,7 @@ * * Copyright (C) 2011 Citrix Systems, Inc. */ +#include #include #include #include @@ -15,7 +16,6 @@ #include #include -#include #include #include diff --git a/xen/arch/arm/vgic/vgic-mmio.c b/xen/arch/arm/vgic/vgic-mmio.c index b4ba34cfc368..d2bcb32cd797 100644 --- a/xen/arch/arm/vgic/vgic-mmio.c +++ b/xen/arch/arm/vgic/vgic-mmio.c @@ -14,10 +14,11 @@ #include #include +#include #include #include + #include -#include #include "vgic.h" #include "vgic-mmio.h" From patchwork Wed Apr 16 11:58:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 14053770 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 7CC9DC369C5 for ; Wed, 16 Apr 2025 11:59:29 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.955730.1349430 (Exim 4.92) (envelope-from ) id 1u51QF-0000VF-Ht; Wed, 16 Apr 2025 11:59:19 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 955730.1349430; Wed, 16 Apr 2025 11:59:19 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1u51QE-0000Se-Tz; Wed, 16 Apr 2025 11:59:18 +0000 Received: by outflank-mailman (input) for mailman id 955730; Wed, 16 Apr 2025 11:59:16 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1u51QC-0006At-9m for xen-devel@lists.xenproject.org; Wed, 16 Apr 2025 11:59:16 +0000 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [2a00:1450:4864:20::429]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 382e657a-1aba-11f0-9eaf-5ba50f476ded; Wed, 16 Apr 2025 13:59:15 +0200 (CEST) Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-39c30d9085aso4256139f8f.1 for ; Wed, 16 Apr 2025 04:59:15 -0700 (PDT) Received: from localhost.localdomain (host-92-26-98-202.as13285.net. [92.26.98.202]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4405b5a9846sm18761905e9.35.2025.04.16.04.59.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Apr 2025 04:59:14 -0700 (PDT) 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: 382e657a-1aba-11f0-9eaf-5ba50f476ded DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1744804755; x=1745409555; 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=z+IilGevx5q9qVo7mZ80r/6WWtDlcFRJKDVvVraWG5E=; b=EABg1rfC1vfOfqqk2BlIvbcqWSBwuJjAFCf3VIA9hh2Gc1B2Zc6XSBXY739CYTL1gP 3mnAL9LLRY/L2nqTt5nbl7TX7clMlNOy48e6wa83vHgJ1ooZkGoy8yShBOVo4DChljUj 2TZwb6ZJsrRpeuufib6BW1jnQ1XvemMTZi8kw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744804755; x=1745409555; 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=z+IilGevx5q9qVo7mZ80r/6WWtDlcFRJKDVvVraWG5E=; b=Hhp1ZGLzfZ8SxA63DLVjwYgOirn376hXYPrcCaIOdq8VNFCdn3+WR9ooDDMetAc1bs O/U0y5it5hiAtYak/zbRE1Mf2WNYZUl9xTW3wsIbEYkyWNcjIdnlu6Aj4yqyqmOchzel LgBPWqHK6N6KlEb+qnjXH1EcaT+67hRY0Oq/UED0jDsK7O5FDGBni3YkooLLFG3w4AEL oGEaea9uEvo3F0yVb9KdGK9MgHg1Achan37Sxm5UqW+AOfh9cB0aLGXSFenl3zILL6VZ USPqiY2hz+8cjyqdyL0MCBYrXK0J8zweVAbS+JOgzTL1LeYWp4Kbs81fYFzAuNJ5A5Tb qcvQ== X-Gm-Message-State: AOJu0YzB5dqbSeX5ZZzyDJXsVKtcWeksUXS4EteZdvmj/jtTSSVz/s7i W9//u+NmIBQ+6cH6CbvVFXK7XGEbYd8E63bc2t5AayEJ7DyTrcQkFJxMYAyZHVQeeKP1Pn8oMjN pQLA= X-Gm-Gg: ASbGncskQqSBDooORV1LFbXxwN1jZAo3s2LgZPdFiKFf/3ZvJXTNdiV5Z28wsapBTdf r7AIagcnuXvywDCnoMFjpvLULfLC+Ip6C5EPFgVWAzCVu1ihXPCx3PVCam1OFxV9a5zvDBHViKu iqFaRLkx13QQF0mw8/qVreEYArLSl8sUQtwoXEbU0rBeg4plOYKZ71HibhbWWyHNHiING75iv5I ESPZarJ62IWa1B/7NueFNqtUK/BIGdr2ZL1o9UI0jj1vWL6Ivtb07GlqxPNsJlkDHWM5cQOksCE 5esrB7Sxy9gsGtqzNZ2WXrWjCmwdvkThR10laAv9Bc1QtF8EiNP3QbdmB0CRcBmkQDVxlT2u6L+ WRrZd4YSFxccUxy5dXcUmttxX X-Google-Smtp-Source: AGHT+IFR5FzfA941/9ZQtEr7MfsbWMjiicPxFU8WTuginSs0d1JYIhj+KpYz+bQAw6mrWWPLTtFbbA== X-Received: by 2002:a05:6000:1866:b0:390:f394:6271 with SMTP id ffacd0b85a97d-39ee5b992bcmr1552295f8f.43.1744804755118; Wed, 16 Apr 2025 04:59:15 -0700 (PDT) From: Andrew Cooper To: Xen-devel Cc: Andrew Cooper , Anthony PERARD , Michal Orzel , Jan Beulich , Julien Grall , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Stefano Stabellini , Volodymyr Babchuk , Bertrand Marquis , Shawn Anastasio , Oleksii Kurochko , "Daniel P . Smith" , Lin Liu Subject: [PATCH v6 13/15] ppc: Drop asm/byteorder.h Date: Wed, 16 Apr 2025 12:58:58 +0100 Message-Id: <20250416115900.2491661-14-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250416115900.2491661-1-andrew.cooper3@citrix.com> References: <20250416115900.2491661-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 With the common code moved fully onto xen/byteorder.h, clean up the dregs. Signed-off-by: Andrew Cooper Reviewed-by: Shawn Anastasio --- CC: Anthony PERARD CC: Michal Orzel CC: Jan Beulich CC: Julien Grall CC: Roger Pau Monné CC: Stefano Stabellini CC: Volodymyr Babchuk CC: Bertrand Marquis CC: Shawn Anastasio CC: Oleksii Kurochko CC: Daniel P. Smith CC: Lin Liu v5: * New --- xen/arch/ppc/include/asm/byteorder.h | 6 ------ xen/arch/ppc/include/asm/page.h | 4 +--- xen/arch/ppc/mm-radix.c | 2 +- 3 files changed, 2 insertions(+), 10 deletions(-) delete mode 100644 xen/arch/ppc/include/asm/byteorder.h diff --git a/xen/arch/ppc/include/asm/byteorder.h b/xen/arch/ppc/include/asm/byteorder.h deleted file mode 100644 index 8df6adbf0d7d..000000000000 --- a/xen/arch/ppc/include/asm/byteorder.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _ASM_PPC_BYTEORDER_H -#define _ASM_PPC_BYTEORDER_H - -#include - -#endif /* _ASM_PPC_BYTEORDER_H */ diff --git a/xen/arch/ppc/include/asm/page.h b/xen/arch/ppc/include/asm/page.h index 6d4cd2611c2b..c6160afcfdb8 100644 --- a/xen/arch/ppc/include/asm/page.h +++ b/xen/arch/ppc/include/asm/page.h @@ -3,9 +3,7 @@ #define _ASM_PPC_PAGE_H #include -#include - -#include +#include #define PDE_VALID PPC_BIT(0) #define PDE_NLB_MASK 0x1ffffffffffffe0UL diff --git a/xen/arch/ppc/mm-radix.c b/xen/arch/ppc/mm-radix.c index 24232f3907aa..9a00ae416af0 100644 --- a/xen/arch/ppc/mm-radix.c +++ b/xen/arch/ppc/mm-radix.c @@ -1,5 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-or-later */ #include +#include #include #include #include @@ -7,7 +8,6 @@ #include #include -#include #include #include #include From patchwork Wed Apr 16 11:58:59 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 14053776 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 7EEEEC369BD for ; Wed, 16 Apr 2025 12:03:26 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.955902.1349466 (Exim 4.92) (envelope-from ) id 1u51U5-00089I-PB; Wed, 16 Apr 2025 12:03:17 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 955902.1349466; Wed, 16 Apr 2025 12:03:17 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1u51U5-00088J-Kv; Wed, 16 Apr 2025 12:03:17 +0000 Received: by outflank-mailman (input) for mailman id 955902; Wed, 16 Apr 2025 12:03:16 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1u51QD-0006At-Pz for xen-devel@lists.xenproject.org; Wed, 16 Apr 2025 11:59:17 +0000 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [2a00:1450:4864:20::434]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 39220158-1aba-11f0-9eaf-5ba50f476ded; Wed, 16 Apr 2025 13:59:17 +0200 (CEST) Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-39c1efc457bso4465626f8f.2 for ; Wed, 16 Apr 2025 04:59:17 -0700 (PDT) Received: from localhost.localdomain (host-92-26-98-202.as13285.net. [92.26.98.202]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4405b5a9846sm18761905e9.35.2025.04.16.04.59.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Apr 2025 04:59:16 -0700 (PDT) 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: 39220158-1aba-11f0-9eaf-5ba50f476ded DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1744804757; x=1745409557; 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=GtrQ08vcHfYRasMYCjK/xM3GJiF3ZHsvoc0qya/h/70=; b=VsVXyqb3Ps2KtJsWO5M86WiQXiTXkuoRs1fnfIH3fuf87KobcLFvr6T5Xw4wqZmvp8 1O2oAAXfOOGtZa4HbsI40O4RHDdVQCI709oa3ovimO43v+IHd470XHnV+pRvmiIv/FNY KGmBDblbNYXCzwUyh9rzxPn66eN47WBFia3GM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744804757; x=1745409557; 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=GtrQ08vcHfYRasMYCjK/xM3GJiF3ZHsvoc0qya/h/70=; b=eSU2qwBpCPiS1yyk/ym82sZ71HRdPIrvRk6qcGUqu6nQj57E1IXzTJXe0Hc/er+DMJ GLJ1DWawuROKUZqqn8wUy5MVrl/xHyresjYAzRBVJhD2yREq/7Qt6iHFHD7CnVsMYSLi 20PZ7vi2kxf35Zg7L5Wjbgu1M19Grd1OrL+uc9AaxWCSh3xsd4jRPuRC5trPFKlUWYL8 RXNjQa3T9BN2+1brF3Z0RzQd1Od+aQkL9uM4KUHgamvHEfYZemDpfQTxz5Jf+SVK5731 59ctH2WYkgkIS3PtL9srkRYKElXsu6xbFAQX3TLmVEjSwkEZFPgPJJlViVLYLloesfo7 jazg== X-Gm-Message-State: AOJu0YzWmulo4lW7gOJcfmU/AeROlJyYsp7CW+n1lnPQ0EtgNHRiqjmK svUpevDEyFGEdiV0bxFvu/TlexQRDGRzzAXZsbdor8d6VMJPr+RjJfphuIlAyD1yQczBj09gacI PRQ4= X-Gm-Gg: ASbGncsYCF5XL6u9EE5PCtflQgk2tVsGnwxBINYyVYB7r46XVhYx4ETktpVMS1XW1Sg LgT3c5JVYLRwN8B+rnexDLSWwK1YObi9GpFva2NRAzGIXPwkBRhwHo0mEXOxXrcJHCNNG5e2m8U eTfewfkxHTRU70jrRLv0yHGeviNPtE2NaShrB9bSYbX8h+dp9HCQfXnbQNpkCedpi3gwwR6iRVj 0q5cLdHFCbmKUaEcSD05sLcvSrH9nMibs9q0WeHuKgSQw7hOjvxriNAkeAbR+2vDlQYfxk3s3za LT/HXU/cnzjIdtnHzT/ZrGBV22N8NLrPeKcxwrAjpYPeLwBmor5X2XHI8FB0+VXrRJCuTSx4CzR 4fDQigbbZBu0Cwg== X-Google-Smtp-Source: AGHT+IGAljI6COUgiVd+L0rn0qcHYo5Qkthxd3Ys4ZnL52R1Jl/DYNHycJiAt96f/f3f4Ff1pETQZg== X-Received: by 2002:a5d:6daf:0:b0:39c:13fa:80b with SMTP id ffacd0b85a97d-39ee5b130acmr1390455f8f.12.1744804756651; Wed, 16 Apr 2025 04:59:16 -0700 (PDT) From: Andrew Cooper To: Xen-devel Cc: Andrew Cooper , Oleksii Kurochko , Anthony PERARD , Michal Orzel , Jan Beulich , Julien Grall , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Stefano Stabellini , Volodymyr Babchuk , Bertrand Marquis , Shawn Anastasio , "Daniel P . Smith" , Lin Liu Subject: [PATCH v6 14/15] riscv: Remove asm/byteorder.h Date: Wed, 16 Apr 2025 12:58:59 +0100 Message-Id: <20250416115900.2491661-15-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250416115900.2491661-1-andrew.cooper3@citrix.com> References: <20250416115900.2491661-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 With the common code moved fully onto xen/byteorder.h, clean up the dregs. The use of byteorder.h in io.h appears to have been copy&paste from ARM. It's not needed, but macros and types are. No functional change. Signed-off-by: Andrew Cooper Reviewed-by: Oleksii Kurochko --- CC: Anthony PERARD CC: Michal Orzel CC: Jan Beulich CC: Julien Grall CC: Roger Pau Monné CC: Stefano Stabellini CC: Volodymyr Babchuk CC: Bertrand Marquis CC: Shawn Anastasio CC: Oleksii Kurochko CC: Daniel P. Smith CC: Lin Liu v5: * New --- xen/arch/riscv/include/asm/byteorder.h | 14 -------------- xen/arch/riscv/include/asm/io.h | 3 ++- 2 files changed, 2 insertions(+), 15 deletions(-) delete mode 100644 xen/arch/riscv/include/asm/byteorder.h diff --git a/xen/arch/riscv/include/asm/byteorder.h b/xen/arch/riscv/include/asm/byteorder.h deleted file mode 100644 index a32bca02df38..000000000000 --- a/xen/arch/riscv/include/asm/byteorder.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef ASM__RISCV__BYTEORDER_H -#define ASM__RISCV__BYTEORDER_H - -#include - -#endif /* ASM__RISCV__BYTEORDER_H */ -/* - * Local variables: - * mode: C - * c-file-style: "BSD" - * c-basic-offset: 4 - * indent-tabs-mode: nil - * End: - */ diff --git a/xen/arch/riscv/include/asm/io.h b/xen/arch/riscv/include/asm/io.h index 55f329dde321..8bab4ffa0390 100644 --- a/xen/arch/riscv/include/asm/io.h +++ b/xen/arch/riscv/include/asm/io.h @@ -38,7 +38,8 @@ #ifndef ASM__RISCV__IO_H #define ASM__RISCV__IO_H -#include +#include +#include /* * The RISC-V ISA doesn't yet specify how to query or modify PMAs, so we can't From patchwork Wed Apr 16 11:59:00 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 14053771 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 89727C369BD for ; Wed, 16 Apr 2025 11:59:33 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.955732.1349448 (Exim 4.92) (envelope-from ) id 1u51QJ-0001LU-J2; Wed, 16 Apr 2025 11:59:23 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 955732.1349448; Wed, 16 Apr 2025 11:59:23 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1u51QI-0001Gn-L3; Wed, 16 Apr 2025 11:59:22 +0000 Received: by outflank-mailman (input) for mailman id 955732; Wed, 16 Apr 2025 11:59:20 +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 1u51QF-0006Ay-UK for xen-devel@lists.xenproject.org; Wed, 16 Apr 2025 11:59:20 +0000 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [2a00:1450:4864:20::32d]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 39b43747-1aba-11f0-9ffb-bf95429c2676; Wed, 16 Apr 2025 13:59:18 +0200 (CEST) Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-43cf58eea0fso34303275e9.0 for ; Wed, 16 Apr 2025 04:59:18 -0700 (PDT) Received: from localhost.localdomain (host-92-26-98-202.as13285.net. [92.26.98.202]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4405b5a9846sm18761905e9.35.2025.04.16.04.59.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Apr 2025 04:59:17 -0700 (PDT) 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: 39b43747-1aba-11f0-9ffb-bf95429c2676 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1744804758; x=1745409558; 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=pKpw9+M3DGXcB4JzTHPD/cCI8CU9x6+lpkoDYMzsF/g=; b=hjcen20RQKDrwoFgJeB/46xX3CUexZKA2YD8k8WKpSOJp8xXlWhoX5G1SIXHdn1DHn zjvL4rMsgBuO8peFqse7r0LCkbiFYONCzaGCEGAmySmlIn2SNV6mhe/3Ono4MLX6wEZV vZL2uZsE9CTEN1+KaKYaMl4dTaWXDs3XKqty8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744804758; x=1745409558; 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=pKpw9+M3DGXcB4JzTHPD/cCI8CU9x6+lpkoDYMzsF/g=; b=VRSBUBVRDDcmN7ToaPFHefJBNb7+CtyH7nkaZ+w/SlckONZTDim+bV/ks/e8IW5tZV MmcBk+riHs65T486lvRJqAjp8iTMbfVzrt5/+KpOhwsQTRw4duUMjzMD8z/d5PDUJhHh HpC1u72leB1kz9QZ3ck4bBARU769eOprnPHMhOM5ddsakvhNIePLVlPgs2joyvptNCHA QedcMN2IvSt8kGwEsiQLNp+CWMOwoWHZke2m+k45BJHFwgkdGNpc4HPb55O9AwLYX3TL 1IR/DHeC/AoC3JdZq3r9wbxYmYfRDMvOp8ekz1q3Td4O1VKj17x05GptU52/wRiGFzBK Z6xw== X-Gm-Message-State: AOJu0YztrDCD9c/TxLaSTriJgp0TEa8OmCm2k3ZU02ODn6jqodr7Df11 ORohD5nrK8y4vX6Gf8FwVbr5on/C2IVFVdK1r0yJ/JbTnBnhSrRL6ctE0T8uQxSqucMdZ6yOip+ uB9Q= X-Gm-Gg: ASbGncvYYDi0jCqwTnkjjIMqJSXB3c8lKtEZGEDpefbDIdWg2TQDMVsMIFdMRqEXkAV HvDBhzHN26PLf6j0SdDNIIz96xpd7mhMQKvxZgduSXQtso24ldXhm8Nxd3VMlHRwmpOQkHVMQ1Q AqyOyhCzhQuKHnN19BpjBEVZpg7o/P+qZ1ka1/e4R3cKSgKOPvnIV9uUZOW8mQB51i2BRNWVq5b FQd6gCuBcRIVDNNL4jItQTUnEvCjg4CCLDYHJHTrRvr+9BAgo43yeLOPVs73FCfUu+tLu9M0eYG XqJn6aOL0c2Mmp90qc0jU1bs3PymivBQVQ96/XYVfEn9F1Ohwe5cc/EXNNNzrRRaGxCQxSmoDz0 IO7FMOV40rUS+EA== X-Google-Smtp-Source: AGHT+IFmAEkbnGyb/KVsN4YJOPjfgZp61pqCDlyaa8aJ5EneztE/mfwwCgka0vJVdAi+aKopAXQwDg== X-Received: by 2002:a05:600c:811b:b0:43d:ed:ad07 with SMTP id 5b1f17b1804b1-4405d6cc339mr14006305e9.29.1744804757687; Wed, 16 Apr 2025 04:59:17 -0700 (PDT) From: Andrew Cooper To: Xen-devel Cc: Andrew Cooper , Jan Beulich , Anthony PERARD , Michal Orzel , Julien Grall , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Stefano Stabellini , Volodymyr Babchuk , Bertrand Marquis , Shawn Anastasio , Oleksii Kurochko , "Daniel P . Smith" , Lin Liu Subject: [PATCH v6 15/15] x86: Drop asm/byteorder.h Date: Wed, 16 Apr 2025 12:59:00 +0100 Message-Id: <20250416115900.2491661-16-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250416115900.2491661-1-andrew.cooper3@citrix.com> References: <20250416115900.2491661-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 With the common code moved fully onto xen/byteorder.h, clean up the dregs. It turns out that msi.h has not needed byteorder.h since the use of __{BIG,LITTLE}_ENDIAN_BITFIELD was dropped in commit d58f3941ce3f ("x86/MSI: use standard C types in structures/unions"). No functional change. Signed-off-by: Andrew Cooper Acked-by: Jan Beulich --- CC: Anthony PERARD CC: Michal Orzel CC: Jan Beulich CC: Julien Grall CC: Roger Pau Monné CC: Stefano Stabellini CC: Volodymyr Babchuk CC: Bertrand Marquis CC: Shawn Anastasio CC: Oleksii Kurochko CC: Daniel P. Smith CC: Lin Liu v5: * New --- xen/arch/x86/include/asm/byteorder.h | 6 ------ xen/arch/x86/include/asm/msi.h | 1 - 2 files changed, 7 deletions(-) delete mode 100644 xen/arch/x86/include/asm/byteorder.h diff --git a/xen/arch/x86/include/asm/byteorder.h b/xen/arch/x86/include/asm/byteorder.h deleted file mode 100644 index 3524a6cee741..000000000000 --- a/xen/arch/x86/include/asm/byteorder.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef __ASM_X86_BYTEORDER_H__ -#define __ASM_X86_BYTEORDER_H__ - -#include - -#endif /* __ASM_X86_BYTEORDER_H__ */ diff --git a/xen/arch/x86/include/asm/msi.h b/xen/arch/x86/include/asm/msi.h index 975d0f26b35d..00059d4a3a9d 100644 --- a/xen/arch/x86/include/asm/msi.h +++ b/xen/arch/x86/include/asm/msi.h @@ -3,7 +3,6 @@ #include #include -#include #include /*