From patchwork Fri Mar 28 13:44:12 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 14032016 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 35222C3DA4A for ; Fri, 28 Mar 2025 13:45:03 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.930658.1333232 (Exim 4.92) (envelope-from ) id 1tyA0l-0005EC-AR; Fri, 28 Mar 2025 13:44:39 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 930658.1333232; Fri, 28 Mar 2025 13:44:39 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tyA0l-0005E5-7M; Fri, 28 Mar 2025 13:44:39 +0000 Received: by outflank-mailman (input) for mailman id 930658; Fri, 28 Mar 2025 13:44:37 +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 1tyA0j-0005Dj-CT for xen-devel@lists.xenproject.org; Fri, 28 Mar 2025 13:44:37 +0000 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [2a00:1450:4864:20::429]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id c901f076-0bda-11f0-9ffa-bf95429c2676; Fri, 28 Mar 2025 14:44:35 +0100 (CET) Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-38a25d4b9d4so1169295f8f.0 for ; Fri, 28 Mar 2025 06:44:35 -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-43d8314f5c6sm73339085e9.40.2025.03.28.06.44.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Mar 2025 06:44:33 -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: c901f076-0bda-11f0-9ffa-bf95429c2676 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1743169474; x=1743774274; 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=i7+32TIHFV1MVow5Y/aDHKdZapyIzqEiWxHNERaAAd4=; b=SXmubGYIo2Cg/pzaY30E3CJa8mTJOBWNHBnxc5SdaXkxibCpq6kyVgDZpc0wjaKe4A mZuOnoI8n6COwq5F3m1WP8j+Ktzq6kHDmG38z2u460+PhhyWUf/nS1WA+lQkWKTGtaPQ 7QxsoY5+PWPmYtj5TI9nmO/fEc2gmw5MyPiOY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743169474; x=1743774274; 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=i7+32TIHFV1MVow5Y/aDHKdZapyIzqEiWxHNERaAAd4=; b=D4GNkp3RMy/oOcLEiiEuZ+bJW2oZluTgypiahml4GL9TzZcCdDE0SVB9iqzR78B1Zj CJ+5ckmfrr3WQBpN7z/IiMXgAhl3U7+UylWzr9cLnxD2CHRjXRISBEE4Aqmoc3kZvukF qi2gUCKQmwM17xuu45npPqLvMfUeAkAAOTO13DGkC+3sQu0cLx/6q+0NX1S7UIlGxlTM OpI5Bes+MR20FxaLZAOlGISe4RjOjn2bbVALTQEMSS1P3WPOOCOxEvAa3ORgjdTiqRFs 4agqeiGr6FXKtjZNAmUhTmIqQYOYly8ujx8oOGeroGjJlFM7mhsz1ilbRNiOQyCDorkv Wraw== X-Gm-Message-State: AOJu0Yxt8EeFY5bOIGp29/S6H1PpE3v7afZsLO7WouTOwSRy3FnsqeTz zrsHI2Eyk2+3Gwmaa08KnMbRIvGVEtqZ/yIICIoCg2mp7A27BA2lfKWWZxplOM2G9Hb2hSP30kv DX8g= X-Gm-Gg: ASbGncu1/gJOJpI/ID5CwCyrU4424ETrBLWeUyLdR1j0vMzvuN0rqPKhmXzXkLtxOIp eawLfmw7eIA4gw5pBWWQqFad6uy6YzEPs5W5dWJ4iaZWVHjCstNNMJvOszc/kaOOZEtj5vNAyLv vkruznFAdiA82LJ6OxaCRzCHyO8FP9ne5JmdcAwxU0Lq+3OYi0tJN74nVN4SeRTUjzuzEUcU7IS kldJ7pk59swrPAwtTN56PJN01My+1OINgkR3ydVCKxESeaM9/u7Z4Uqz7XiJdwN3NCpfL7z4+g/ rnWrLO8wZHq6RvSX9rB52zNUYJ3N9ZElblHsLFe9D+pqIQkwo2j4KJi41xnSb4tiXgSBUzdlZtU pkVzIAU/Rf6ZYTmkeryimosZfwLKF X-Google-Smtp-Source: AGHT+IHgi8O89tYF4SvaCCsfyFwZsWLyhq00GhH7tdKUWImLZ5mbyFrglHJoukvZmhgGWsNMBN9kog== X-Received: by 2002:a5d:6d0c:0:b0:391:2ab1:d4b8 with SMTP id ffacd0b85a97d-39ad173f9cemr5610377f8f.1.1743169474353; Fri, 28 Mar 2025 06:44:34 -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 v5 01/16] xen/lzo: Remove more remanants of TMEM Date: Fri, 28 Mar 2025 13:44:12 +0000 Message-Id: <20250328134427.874848-2-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250328134427.874848-1-andrew.cooper3@citrix.com> References: <20250328134427.874848-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 This logic was inserted by commit 447f613c5404 ("lzo: update LZO compression to current upstream version") but was only relevant for the TMEM logic, so should have been deleted in commit c492e19fdd05 ("xen: remove tmem from hypervisor") Fixes: c492e19fdd05 ("xen: remove tmem from hypervisor") 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 Notably, this also removes the singular case where anything in Xen cares about the value in __BYTE_ORDER, __LITTLE_ENDIAN and __BIG_ENDIAN, and even then it was only an adaptation to the MiniOS environment. v5: * New. --- xen/common/lzo.c | 21 --------------------- 1 file changed, 21 deletions(-) base-commit: eecb9f437b2c3e2d22d0af93dc6b1f4d978313a7 diff --git a/xen/common/lzo.c b/xen/common/lzo.c index 3454ce4a7e24..07b4017812dc 100644 --- a/xen/common/lzo.c +++ b/xen/common/lzo.c @@ -28,27 +28,6 @@ #define COPY4(dst, src) memcpy(dst, src, 4) #define COPY8(dst, src) memcpy(dst, src, 8) -#ifdef __MINIOS__ -# include -# if __BYTE_ORDER == __LITTLE_ENDIAN -# undef __BIG_ENDIAN -# endif -# if __BYTE_ORDER == __BIG_ENDIAN -# undef __LITTLE_ENDIAN -# endif -#endif - -#if defined(__BIG_ENDIAN) && defined(__LITTLE_ENDIAN) -#error "conflicting endian definitions" -#elif defined(__x86_64__) -#define LZO_USE_CTZ64 1 -#define LZO_USE_CTZ32 1 -#elif defined(__i386__) || defined(__powerpc__) -#define LZO_USE_CTZ32 1 -#elif defined(__arm__) && (__LINUX_ARM_ARCH__ >= 5) -#define LZO_USE_CTZ32 1 -#endif - #define M1_MAX_OFFSET 0x0400 #define M2_MAX_OFFSET 0x0800 #define M3_MAX_OFFSET 0x4000 From patchwork Fri Mar 28 13:44:13 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 14032007 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 9635EC36011 for ; Fri, 28 Mar 2025 13:44:56 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.930659.1333237 (Exim 4.92) (envelope-from ) id 1tyA0l-0005HN-JU; Fri, 28 Mar 2025 13:44:39 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 930659.1333237; Fri, 28 Mar 2025 13:44:39 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tyA0l-0005GA-Dc; Fri, 28 Mar 2025 13:44:39 +0000 Received: by outflank-mailman (input) for mailman id 930659; Fri, 28 Mar 2025 13:44:38 +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 1tyA0k-0005Dj-0v for xen-devel@lists.xenproject.org; Fri, 28 Mar 2025 13:44:38 +0000 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [2a00:1450:4864:20::331]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id c99722b8-0bda-11f0-9ffa-bf95429c2676; Fri, 28 Mar 2025 14:44:36 +0100 (CET) Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-43cf06eabdaso20815185e9.2 for ; Fri, 28 Mar 2025 06:44:36 -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-43d8314f5c6sm73339085e9.40.2025.03.28.06.44.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Mar 2025 06:44:34 -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: c99722b8-0bda-11f0-9ffa-bf95429c2676 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1743169475; x=1743774275; 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=NRRILQjHDNKqdyGUmo0RrPw+FSAhpbsG/wvAGzdfUcA=; b=n4f2eUb3f7BAGYc/xAi9LRmo/tU0Tmdf2BQbIwO7mH1IsDheKbtfmh3LwabA5xsLop ffUGB1I6PZOs8m0ECCpFTpFgGZvhz2VDwFx9wpgFe4XoS4LLeBakIaOue774+MeN9hTG vxDVj/N9WydIpqhdcgOVt9FbqL6kWWERzD37A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743169475; x=1743774275; 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=NRRILQjHDNKqdyGUmo0RrPw+FSAhpbsG/wvAGzdfUcA=; b=NSAsqyx5UQB4GITmaeirf16vlp1Ia9aRBXSXJ/2ZVwqy8OTCQvdfr+Rk1pnhL7I7Xj nLPfjVSprDX1OGwjc6A3m13Gql9co3xL1b+bd5u0602bI8/dDvsjATDvbeOUmXM9Sjaj TDfc/jOFk/18BfgF0XP27XRK+MvbQl2wSbJ0VWkugxrtHTmxP1J92snk2haD03Z1avra d7s0YNYuS4nMjGDjX2ezEZdaNNoy6aBDIa4Rh+rwucdITyHwC//ht6uz9iHURQPWwKoi D78BBvy0BHuzzaD1x1Sq3Y1DNleNh4PbRrrlbpwT9BZwuJiSQ0B/DqJW1ZcWTzrMHEFM Kcdg== X-Gm-Message-State: AOJu0YwlGGjq+qjMhN5a5IFzpfg+8kCOtGqd15QAq34wfMJNVxxp083e iIikG+VHN/wz4fQxpjGMA9BCOpMrwyony1MgskRnqjJeDK1EKlczSCN+61veC7XJzFAtYDjKTJk uqOk= X-Gm-Gg: ASbGncvrwEuD+5RnRCMfvxr/IFiHIIhLo921mtX+R53vQ3IZTofZ6up+E25Vl7kf+Q3 yTl/FCid5gDBsCYRyzcDU8DfvwXKrEV4oMT1G1vzMVYMhv3Qm9ik8pqUo93PkEGFmOnluKUMRNe /e2lQSi+HsghpIzKtB17ePSsXzeOtklZ9SKomm7qm3ADjyN1cFOZJvHTTtM85PNUNogO0Qogddb K6XzcOixzAp7ES591kNyjQeRY9dYsNY0gxCJM9abUaTypmacgR3qGcI/JqS4wWKzuLN7sZenc0y 5TN0+UwL1QEcVFhduzg4znlAsswJEaxso4f8xw1Oq/SIzcFw+SZ2zlaIpwjTRkjGJPxtYb/48Gh kSODgUo4MKV3OdtbmDw== X-Google-Smtp-Source: AGHT+IHqbQoB2iudC36JECsuxphrbT5v04XPCLu6L9Tg3pfb5AB90XdZUhIW+UVjFQbaG4W6hLUIAg== X-Received: by 2002:a05:6000:1448:b0:391:11b:c7e9 with SMTP id ffacd0b85a97d-39ad175ba00mr6474469f8f.28.1743169475371; Fri, 28 Mar 2025 06:44:35 -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 v5 02/16] xen: Remove __{BIG,LITTLE}_ENDIAN_BITFIELD Date: Fri, 28 Mar 2025 13:44:13 +0000 Message-Id: <20250328134427.874848-3-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250328134427.874848-1-andrew.cooper3@citrix.com> References: <20250328134427.874848-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 There is a singular user. It's unlikely we'll gain a big-endian build of Xen, but it's far more unlikely that bitfields will differ from main endianness. Signed-off-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 I'm tempted to simply drop the logic in maptrack_node. If any big-endian build of Xen came along, that's probably the least of it's worries. v5: * New. --- xen/common/grant_table.c | 4 ++-- xen/include/xen/byteorder/big_endian.h | 3 --- xen/include/xen/byteorder/little_endian.h | 3 --- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c index 6c77867f8cdd..d6886ee74847 100644 --- a/xen/common/grant_table.c +++ b/xen/common/grant_table.c @@ -979,12 +979,12 @@ static struct active_grant_entry *grant_map_exists(const struct domain *ld, union maptrack_node { struct { /* Radix tree slot pointers use two of the bits. */ -#ifdef __BIG_ENDIAN_BITFIELD +#ifdef __BIG_ENDIAN unsigned long _0 : 2; #endif unsigned long rd : BITS_PER_LONG / 2 - 1; unsigned long wr : BITS_PER_LONG / 2 - 1; -#ifndef __BIG_ENDIAN_BITFIELD +#ifndef __BIG_ENDIAN unsigned long _0 : 2; #endif } cnt; diff --git a/xen/include/xen/byteorder/big_endian.h b/xen/include/xen/byteorder/big_endian.h index ce395a17f64b..9cfb567d51d5 100644 --- a/xen/include/xen/byteorder/big_endian.h +++ b/xen/include/xen/byteorder/big_endian.h @@ -4,9 +4,6 @@ #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..96c80eab2b12 100644 --- a/xen/include/xen/byteorder/little_endian.h +++ b/xen/include/xen/byteorder/little_endian.h @@ -4,9 +4,6 @@ #ifndef __LITTLE_ENDIAN #define __LITTLE_ENDIAN 1234 #endif -#ifndef __LITTLE_ENDIAN_BITFIELD -#define __LITTLE_ENDIAN_BITFIELD -#endif #include #include From patchwork Fri Mar 28 13:44:14 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 14032013 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 273EEC36014 for ; Fri, 28 Mar 2025 13:45:03 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.930660.1333243 (Exim 4.92) (envelope-from ) id 1tyA0l-0005N7-Qc; Fri, 28 Mar 2025 13:44:39 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 930660.1333243; Fri, 28 Mar 2025 13:44:39 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tyA0l-0005Lk-MU; Fri, 28 Mar 2025 13:44:39 +0000 Received: by outflank-mailman (input) for mailman id 930660; Fri, 28 Mar 2025 13:44:38 +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 1tyA0k-0005Dp-5i for xen-devel@lists.xenproject.org; Fri, 28 Mar 2025 13:44:38 +0000 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [2a00:1450:4864:20::331]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id ca3bd7d6-0bda-11f0-9ea3-5ba50f476ded; Fri, 28 Mar 2025 14:44:37 +0100 (CET) Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-43d04ea9d9aso9910575e9.3 for ; Fri, 28 Mar 2025 06:44:37 -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-43d8314f5c6sm73339085e9.40.2025.03.28.06.44.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Mar 2025 06:44:35 -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: ca3bd7d6-0bda-11f0-9ea3-5ba50f476ded DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1743169476; x=1743774276; 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=SnmFGZh2rWbEy7OVP//9VnfXl8YcAR4cPveLI05OgG8=; b=oukTryhz2N+E26GnKvoZohLGKQk4H74xRzqqk6pQpGilyQNFAOC5X9hw1+0sQWwXrI FILXX1zcpnXtDy1uOBBXnFI3XqfkfNNIL+xReQ/FeaJkv6Iq02Oj7RdYVDtXWlChiIJH GReTGxJ/+FPXC8b7s1TLRL7Ys+sJkfdn51KQY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743169476; x=1743774276; 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=SnmFGZh2rWbEy7OVP//9VnfXl8YcAR4cPveLI05OgG8=; b=LOr5Pjn8h/ZqCAGP/yOMlmsnrA9Cm+uIzuaCAXUPXeyTzmPmciwI85U3KXNR77WGb0 wDJ2/ZtZ6NKv1CkUB9SoXLJDBOYOESiPf7zpQ8jxIE9IOCnEutuFB64NLHaCAXoXANd1 T5zsszfr4k6n124xMlNQrq7D7rgSP/Nba7QlkjnjRNq9go8u+2PfhKPw6jQi/TBJPq58 vYxagrs6Lh1vOz31xfByORBf7uOfGOQHipUCnd0UtDSvqlpoDyE2W7UH/QcbqUZ1I/vt nkU/8OuxJUeG6IvTx3XC2s/7V6qGVWC6TkltA63/fnGxw6LMGCHjp95pX6S+UkfRQsS7 PtdA== X-Gm-Message-State: AOJu0YxsxDNXDkxEsd/SGJXxyMF9pScpWG4AlPH3HcQOmr2U4BLT0b5d dmJbJOxbefjlguaUN4wrVNL3GwXXzDOnCqb91wtjJL56YfdEGXjKzdQ7TjJveLU3ojspeB8bNCN qJN8= X-Gm-Gg: ASbGncuE5M4+HR3WusOlM2qNE4Dpm7+P5q2WmiiFdTFr47DeT5ii9gxKCEuQUrylD+/ VNH9no4Rph1kb7Ha00unjmxD2FT+cnCjYAMXy0/oQmj9m7bI6R0b5mZM2AuBlxw9sa7WgR7E2LW 3zrz2o7dRT+zlyllkmMlnxiBMW5TSpYA9DdYx/sp2z6L+ngbedp/yWyjMZYLfq1pHx7yQIww8jZ L46ewDKrU53rpVsVCab/SAbqTWolWQ8bsNMXdOGjU+geDJEv0ZhTfuoML3hvmnRRVh36dTJ10+9 8Xejk2oZb8YOTeumv1x+CnuRyRJ2OIgXbgh5waFKKXect9qoeoZtOy6W4+A2Syd2MPXtgEbtJhv CB9j3K2CfBHRd3GFWng== X-Google-Smtp-Source: AGHT+IG0L24lXhaREFMHxWE7TkKiPdJJLa25T1zFmm+87C1wfPYQvQrBSAHNDtw8hOILYL/dRPC8wg== X-Received: by 2002:a05:600c:1388:b0:43d:b3:fb1 with SMTP id 5b1f17b1804b1-43d8528c38cmr53745725e9.27.1743169476335; Fri, 28 Mar 2025 06:44:36 -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 v5 03/16] xen: Implement common byte{order,swap}.h Date: Fri, 28 Mar 2025 13:44:14 +0000 Message-Id: <20250328134427.874848-4-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250328134427.874848-1-andrew.cooper3@citrix.com> References: <20250328134427.874848-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 From: Lin Liu The current swab??() infrastructure is unecesserily complicated, and can be repated 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 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 | 4 --- xen/include/xen/byteorder/little_endian.h | 4 --- xen/include/xen/byteswap.h | 15 ++++++++ xen/include/xen/config.h | 6 ++++ 5 files changed, 65 insertions(+), 8 deletions(-) create mode 100644 xen/include/xen/byteorder.h create mode 100644 xen/include/xen/byteswap.h diff --git a/xen/include/xen/byteorder.h b/xen/include/xen/byteorder.h new file mode 100644 index 000000000000..570a7fe027e5 --- /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 9cfb567d51d5..512291c76f1b 100644 --- a/xen/include/xen/byteorder/big_endian.h +++ b/xen/include/xen/byteorder/big_endian.h @@ -1,10 +1,6 @@ #ifndef __XEN_BYTEORDER_BIG_ENDIAN_H__ #define __XEN_BYTEORDER_BIG_ENDIAN_H__ -#ifndef __BIG_ENDIAN -#define __BIG_ENDIAN 4321 -#endif - #include #include diff --git a/xen/include/xen/byteorder/little_endian.h b/xen/include/xen/byteorder/little_endian.h index 96c80eab2b12..bd1afc6a67c3 100644 --- a/xen/include/xen/byteorder/little_endian.h +++ b/xen/include/xen/byteorder/little_endian.h @@ -1,10 +1,6 @@ #ifndef __XEN_BYTEORDER_LITTLE_ENDIAN_H__ #define __XEN_BYTEORDER_LITTLE_ENDIAN_H__ -#ifndef __LITTLE_ENDIAN -#define __LITTLE_ENDIAN 1234 -#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 d888b2314daf..6815a0ef0c1a 100644 --- a/xen/include/xen/config.h +++ b/xen/include/xen/config.h @@ -98,4 +98,10 @@ #define ZERO_BLOCK_PTR ((void *)-1L) #endif +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ +# define __LITTLE_ENDIAN +#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ +# define __BIG_ENDIAN +#endif + #endif /* __XEN_CONFIG_H__ */ From patchwork Fri Mar 28 13:44:15 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 14032009 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 277ACC36014 for ; Fri, 28 Mar 2025 13:44:57 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.930662.1333272 (Exim 4.92) (envelope-from ) id 1tyA0n-00063A-Gs; Fri, 28 Mar 2025 13:44:41 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 930662.1333272; Fri, 28 Mar 2025 13:44:41 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tyA0n-00062E-Aq; Fri, 28 Mar 2025 13:44:41 +0000 Received: by outflank-mailman (input) for mailman id 930662; Fri, 28 Mar 2025 13:44:40 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tyA0m-0005Dj-1K for xen-devel@lists.xenproject.org; Fri, 28 Mar 2025 13:44:40 +0000 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [2a00:1450:4864:20::330]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id cadc374f-0bda-11f0-9ffa-bf95429c2676; Fri, 28 Mar 2025 14:44:38 +0100 (CET) Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-43690d4605dso15049135e9.0 for ; Fri, 28 Mar 2025 06:44:38 -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-43d8314f5c6sm73339085e9.40.2025.03.28.06.44.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Mar 2025 06:44:36 -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: cadc374f-0bda-11f0-9ffa-bf95429c2676 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1743169477; x=1743774277; 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=a8W5SkdckqpViwNw8B8SNV+vwNGpyKIiESmN47LM7ug=; b=k3F71TGlpKWc0h0UociXjUdpjfnQ733SNJamr7weppzYTnkTja9bZ4dPS0TmRO5xhT nmEJ2qY0zEqCexIM2gD7hmfUXkP3RWPBwsGHFsloLTB3uZ+WrUk8gvLGt+s65FYtYDAq XoerqlLBaeEmajqTowBrv36UPo6M4nX7LltPM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743169477; x=1743774277; 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=a8W5SkdckqpViwNw8B8SNV+vwNGpyKIiESmN47LM7ug=; b=MNurhW4fKAEbw77x9j0xrgTyzVpgqylhugx3DuOuq6DoysRRYndTitLhvrvhX+EJ6t HV51bkpbPZo1tmn1lQxiFKPDK4mqV2nc4qQSkBaUiFK1cRvJ+UmtBTXON1NN6bOc3uc8 k4itJPtxgGC/C7qdGRr83WHnjqVajznK1QyqRESNVJG6Lk2V0Pd7vWBJB3XivJcYTw2S 0FeBfiraUjiIMsiUCePagejrud2Qxo/znuMDUnzmsnQv7YTbf1gnxooaYfjQjfa7v0Sq oZ32OEDFzRrWdajm6/IWGWtV4g/T9LLUk/8z3B27oX8SWlEK1Ag009vKodFCfNHD+RiD 4qCg== X-Gm-Message-State: AOJu0Yxz0N97q6ioa1zB6k0i5vX+gulW4XXKZRNfEs3epUe7/WErJTWK j1oLAlnAweNL+rWmLk5gx9sog1ewR1Bcjqb1iXnZr2JSAU1o2B54L3L0iayMQRlvdUpCo4dlBlf WzBc= X-Gm-Gg: ASbGncsLTVrOjOcc+c1IIyfLpOHjwcTh6n4uF7xCY+au/JjjmgxUtu65yKl/uNdfmke oSEWWMQ3v8s6arxEX6bPxwOnkOWWALgh3hlix2SuxlddikQGBBq1XBRYHNlk32xlzC8cuklno8B dzcpgE52EF49Zj0r+a5XZsrjS6FIdSyGqWsQx5Y2xPU9PdMUSkD2HmJn+tk5EQXsrRfcDWBFTZF QTWN+T/okutByBZv7foGnqvHvt0R09ZA+xhZA/hh3kVN3G4/+p1/AHk4pSF5Nww83uGUVTDVjMp DMDSEDUze6VbQzaD+RoWXB52PoL6pvS53v/TIUhR5TAINvcqMk/MelcgFYWfzKEW+qn2y+V9x0s tYNZVqK5ykgkjrEYRQA== X-Google-Smtp-Source: AGHT+IG2t1EAyDACSeBb/uY/ZuDdN+wJPR2Z8n9fr2z1771JJWgzWikUg+Oo6d29LOM7vxTz9J1mag== X-Received: by 2002:a05:600c:1c0e:b0:43c:fffc:7886 with SMTP id 5b1f17b1804b1-43d850a93c9mr72645975e9.8.1743169477478; Fri, 28 Mar 2025 06:44:37 -0700 (PDT) From: Andrew Cooper To: Xen-devel Cc: Lin Liu , 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 v5 04/16] xen/lib: Switch to xen/byteorder.h Date: Fri, 28 Mar 2025 13:44:15 +0000 Message-Id: <20250328134427.874848-5-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250328134427.874848-1-andrew.cooper3@citrix.com> References: <20250328134427.874848-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. Despite the comments, it was a local modification when the logic was imported from Linux, because Xen didn't have a suitable helper. The new infrsatructure does have a suitable primitive, so use it. No functional change. Signed-off-by: Lin Liu 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 | 5 ++--- xen/lib/find-next-bit.c | 39 +++++++-------------------------------- 2 files changed, 9 insertions(+), 35 deletions(-) diff --git a/xen/lib/divmod.c b/xen/lib/divmod.c index 0377d62130ae..b5b111dacecc 100644 --- a/xen/lib/divmod.c +++ b/xen/lib/divmod.c @@ -1,6 +1,5 @@ -#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 Fri Mar 28 13:44:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 14032014 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 273ACC36011 for ; Fri, 28 Mar 2025 13:45:03 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.930664.1333285 (Exim 4.92) (envelope-from ) id 1tyA0p-0006P7-1O; Fri, 28 Mar 2025 13:44:43 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 930664.1333285; Fri, 28 Mar 2025 13:44:42 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tyA0o-0006OE-Qx; Fri, 28 Mar 2025 13:44:42 +0000 Received: by outflank-mailman (input) for mailman id 930664; Fri, 28 Mar 2025 13:44:41 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tyA0n-0005Dj-1d for xen-devel@lists.xenproject.org; Fri, 28 Mar 2025 13:44:41 +0000 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [2a00:1450:4864:20::331]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id cb7af4c3-0bda-11f0-9ffa-bf95429c2676; Fri, 28 Mar 2025 14:44:39 +0100 (CET) Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-4394a823036so21519985e9.0 for ; Fri, 28 Mar 2025 06:44:39 -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-43d8314f5c6sm73339085e9.40.2025.03.28.06.44.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Mar 2025 06:44:38 -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: cb7af4c3-0bda-11f0-9ffa-bf95429c2676 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1743169479; x=1743774279; 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=iEEuRzEkzv5c8FcoYVegB9/wT3rXdc8PnT3tjiz+5oa6oZF69jM8bIbwWv8FBBXwx8 1zYgG//xj8l+qc+jSzGojr4MomacheXeFjXZuIWUx3SsNLOSDhsBcZRxsgMmCsWHexuE lU/kmafPlRs9S2MhC2rGafsnaYcYYvSW7fvbc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743169479; x=1743774279; 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=co81OiL1JnFpixxStUuBgUdnASUgTKWyOrdJ20pkAsGjQ26v6BJdgiNFNJJSU7LQoQ r8lqYUnLTeEQVD+2V59bzemMP2MU6XXn/sfqRQEaVPzWrvk56dqa6b0Fmj2SdUomrfjh eoUTWOQ9PVeaR+nwN4iVBP0LWCgE8HSKBmmrfiko9xgoOq+HM4cp+3StDWZess7HLtT2 Wbp5uhkxpdBjGz9GRY8gdKO+jk0j4lCs1xqAt9/oYDqItTWn491GVldzt4XgHaumxk9l CI0nEqH10XZkAEQ7rxfBeGeXVd+bKFIdnhjqt/bpmSUv1IF1SF6UuvJjqLA2I2c6LCqK kN1g== X-Gm-Message-State: AOJu0Ywi/2T+VH9tYqRN/Krh2bq++Fu3Ak9opnnMhGqQl+vHOD9l+pKb JfdeI6tuPZSi97YW2Xm5mztgvTOVuuW/beQFZOHKQvOz4P/SI5irHcaPUo9yWzdxlu4x9wIgPkS fDP0= X-Gm-Gg: ASbGncv4bEbMh8NAQEII0aLsgUdVBSa3I/3kzQyxb5Bx8olSOHiJvpgh9AQ8/gtPp7+ OvrlLLc7FZMCFSiY0bDVy/Rtb5QWAnrcQzIOya7vz9DPOXNDNrVev2LHIqZ7DXkb+TZMCn2yv2j /qddPNHoLH1eAkQe8ACyM+txJVgSdOruwlb2kYXUFMBPBBb00z4ilHS87moIfFtwedkERmpntjv DVBJDLhvxqqtmWufyRWNgm/JTOiDfSWqFfRcI6FeQqT/YrZliATrBM+PZBBnId7pUNBizY/l/iB +qZ4pwfdDiyNUaQL3FlhcB8czLeysu1q9GNGk7rdjbJ/km9rRaIMCZSZ2Edr8+eShGHyKjEFDZF zHV57hoQaMzR3OwzC6w== X-Google-Smtp-Source: AGHT+IFpGaM1UkpZQawuV8q0zxzITdIPLaEq+TB4g1vBMIklq4bOPRRgoT1JeWiE0tZFtBzJtvDfEg== X-Received: by 2002:a05:600c:4585:b0:43c:f8fc:f6a6 with SMTP id 5b1f17b1804b1-43d84f8843dmr74418325e9.9.1743169478514; Fri, 28 Mar 2025 06:44:38 -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 v5 05/16] xen/device-tree: Remove use of *_to_cpup() helpers Date: Fri, 28 Mar 2025 13:44:16 +0000 Message-Id: <20250328134427.874848-6-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250328134427.874848-1-andrew.cooper3@citrix.com> References: <20250328134427.874848-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 --- 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 Fri Mar 28 13:44:17 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 14032018 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 E11D4C36016 for ; Fri, 28 Mar 2025 13:45:05 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.930663.1333282 (Exim 4.92) (envelope-from ) id 1tyA0o-0006Mj-Mg; Fri, 28 Mar 2025 13:44:42 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 930663.1333282; Fri, 28 Mar 2025 13:44:42 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tyA0o-0006MT-Jk; Fri, 28 Mar 2025 13:44:42 +0000 Received: by outflank-mailman (input) for mailman id 930663; Fri, 28 Mar 2025 13:44:41 +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 1tyA0m-0005Dp-Ua for xen-devel@lists.xenproject.org; Fri, 28 Mar 2025 13:44:40 +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 cc26e366-0bda-11f0-9ea3-5ba50f476ded; Fri, 28 Mar 2025 14:44:40 +0100 (CET) Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-43d04dc73b7so23795025e9.3 for ; Fri, 28 Mar 2025 06:44:40 -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-43d8314f5c6sm73339085e9.40.2025.03.28.06.44.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Mar 2025 06:44:38 -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: cc26e366-0bda-11f0-9ea3-5ba50f476ded DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1743169480; x=1743774280; 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=6vxny9Ua3aG8RjUIz7Wo3MrzwCxL4xJ81L7tEzt2uTw=; b=ZBjoV0cPdOC/GgY1bUo/uNXoG5O9VlCxQQNVSaebYlBBXmRse7tX2AJoqy0geq/5aZ jhL1BWsSU/8AwHRAy56YKypyDaULTYa4c3ssgSbWiEcpA7sG22lDXxMKSh9O3YIpP4ic 4qrwqD/6DGaJV6LMfRgMSSzuE5xe8ATrsHBRQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743169480; x=1743774280; 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=6vxny9Ua3aG8RjUIz7Wo3MrzwCxL4xJ81L7tEzt2uTw=; b=oLcABMPXDXht+c2zt3+MlHRdMls8PHtR1oiP6LN1vGn3W9lijYkMupIEYLHhQRj72M 7c1N1eaKxgm6uIINkjUpHF2iQp42jrpK9gX4tO10NWmILixPWf6LXmQEreJvkchb2T2W 8bjpTz02bnHPcNuYja6Fs/+Cm8yAYEnjnklH85J5d5aBAVoPrjf0bIqgec1fkIfz9J5J lJVKpKiF/M7xuf/X97Ga/eaThPCL5cjv1/4PoUUhH0z9cQE+gUcnK3ZxiKyLx80TIQY2 C5Dipx6ao0PZ5yXEkg6EtrqtflgA3Lgz6L409xAS+IIzVcB2gUaoHhBuO+Wp74yU3fkQ onxg== X-Gm-Message-State: AOJu0Yw/xuMymTBEngsNvg/nfGTZ8MDXIt8fUgqBbgUQnti+UVDpHWZE HRno2X9WBP5hIWQgwGJ65aL8qtmIVQ9SbvHm6Atq9SdmkNgIz+F3RAGGfxDbN+9HAfjJTFAmCXk Oib4= X-Gm-Gg: ASbGnctgzqMENFZhgvZIpLsb3e8+10WV3Bvk6LDoGxqlr3IDwu9hvZm2BDUyByeHmf4 rYY3hDypNL5rU834v2TyhC/owGSAwzR/vTAjSzE1oGSkVtlh+kFzlwXrxKDHidcSUhmjECEeYrf I4lc6K8rIO1AWwVdIkpxJhrsrgGV513ixOmEn/nQZ9WEbH9NY0wQz4LjpqIs9X2VSRqkn5ukjLi GNoBSVOBeyi8EKwhfJeUC3rSM0jyGogchK9wA1s/9yVeJVG0zZQHXYO7ZlkXKU8K6uiifx4d6kv O8XF86tucrsz/IuDbGEdXEeHEqDH3Nl1ZyzqJySlWOt4+4MsiuNZTukKp2nipbKKIfAqeF6nwZd yaBfYPW+5DeXO1mITUQ== X-Google-Smtp-Source: AGHT+IE6FLYXaFun3GgwWjRgz9r5idpvAYiFiY/dwWATzywhIDkfAehEApGxMKxnAnaLlCYmB0xfrQ== X-Received: by 2002:a05:600c:4455:b0:43d:1b95:6d0e with SMTP id 5b1f17b1804b1-43d8506a680mr74359755e9.23.1743169479555; Fri, 28 Mar 2025 06:44:39 -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 v5 06/16] xen/decompressors: Remove use of *_to_cpup() helpers Date: Fri, 28 Mar 2025 13:44:17 +0000 Message-Id: <20250328134427.874848-7-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250328134427.874848-1-andrew.cooper3@citrix.com> References: <20250328134427.874848-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 --- 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 * Rearranged from other patches --- tools/libs/guest/xg_dom_decompress_unsafe_xz.c | 13 +++++++------ xen/common/lz4/defs.h | 6 +++++- xen/common/xz/private.h | 12 +++++++++--- 3 files changed, 21 insertions(+), 10 deletions(-) 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/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 Fri Mar 28 13:44:18 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 14032012 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 843C8C28B20 for ; Fri, 28 Mar 2025 13:45:02 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.930666.1333307 (Exim 4.92) (envelope-from ) id 1tyA0q-0006tF-V9; Fri, 28 Mar 2025 13:44:44 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 930666.1333307; Fri, 28 Mar 2025 13:44:44 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tyA0q-0006rH-MW; Fri, 28 Mar 2025 13:44:44 +0000 Received: by outflank-mailman (input) for mailman id 930666; Fri, 28 Mar 2025 13:44:43 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tyA0p-0005Dj-3E for xen-devel@lists.xenproject.org; Fri, 28 Mar 2025 13:44:43 +0000 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [2a00:1450:4864:20::329]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id ccbf01d9-0bda-11f0-9ffa-bf95429c2676; Fri, 28 Mar 2025 14:44:41 +0100 (CET) Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-4394345e4d5so14393375e9.0 for ; Fri, 28 Mar 2025 06:44:41 -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-43d8314f5c6sm73339085e9.40.2025.03.28.06.44.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Mar 2025 06:44:40 -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: ccbf01d9-0bda-11f0-9ffa-bf95429c2676 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1743169481; x=1743774281; 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=ttvNpcZmlBfIkEET7nitOsFbwOtCvrXrDSn+XhUAciM=; b=A4rudLNTJQ9ipjkNpXeEuERMiSMQnBxyVxLVKSIeOgrHJxD/PTSFKszYb+YBQcADBv 4djEXrqOB7hEFmzvzTGjAOoPjyYnWqQkhG2TOuGrgdfPN81ko55dXSUYhLoXFjbT2Ui+ HgMIFwdOyVbF9xgxUZAXIeKIBMPKMC9LiOQ78= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743169481; x=1743774281; 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=ttvNpcZmlBfIkEET7nitOsFbwOtCvrXrDSn+XhUAciM=; b=feXN7XhosrHV0KFfER6Si1WbplE+5w/aQ3A/yOru01SADOpRVVDOpT/sjUse1mOmXS z6IpiJE4egyTP/w9LPk8WUmlMoCQImQdUM1A9dH7gAGPGVNUrLfDJVE8OZgSZXO58aQ2 tOOM4zXOqaJ4Sb9XVdAMUHog+Ujfl8w9DI57xEVqo7d2FPz/naUL+42JdWb1Pc39r5Vs Q7Rlni7bPW0PSGLgND+v5giGWxYRY+YNcI63c7klCsU8BeRxPDo+gqGkud88GxjPBhBj 2fwnrCerSiESe/pzYLf4OSlM28VsYvyj68+U7l38RNlumf1PHyd0VKskW5ZPSkVPlGvV RVEw== X-Gm-Message-State: AOJu0Yye+xmOVZtikRXBwnSqrEE9CQd6TzIvsB46KCZWlrVmdcF651Yn BiwqMSnqdvqZJhspqQfcCbB4ZP8M5k5JxWecdABum7B4PuZBEckpKJb1jq9XC+AR9dYOf2Y0uSq PLA4= X-Gm-Gg: ASbGncuYNd49BSS9JdFT08Zh/F5d3TV6CiYAGW4G4/SkzzuO8oo0Vg5zTatiLILrxPy X6+Y28JgpC3VD/mI/HziJ16XSdloP6zhQsCwiOZmnlQp7cwr+G3k67RYyU5zUy6pjiPAhbmKK/0 7D7M8EA6x4lgvbDwcgNdSUtpV1ak8FUSTrfXLz4idJsxU9kzNFI7hbb0TWJuz7Hj7PYhw+lFFDq sX1sx9DIkCbW0LQUwIE/ZJJh733hqlEhisxhnFEiYBPxXJlT8mwCJgyB2bfXaNnCyG7IIz4pd5G DplK9qjqFpus4OxOzD7IB13+stnYbfe56/tlQh/tIahzTvujpd9HlWvt2wJH+1HtKgLz2H1yoAk 9xT/0t+s7eGApWjjwnA== X-Google-Smtp-Source: AGHT+IHxyI3XzFh9MqhUZDwTWwDjJcgZpOYlwzU+RbIpRWqU0+t94NeoTUNuuOrBRzyA3jxcIovDNA== X-Received: by 2002:a05:600c:1e17:b0:43c:fe15:41d4 with SMTP id 5b1f17b1804b1-43d84fd517dmr91210845e9.18.1743169480662; Fri, 28 Mar 2025 06:44:40 -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 v5 07/16] xen/arch: Switch to new byteorder infrastructure Date: Fri, 28 Mar 2025 13:44:18 +0000 Message-Id: <20250328134427.874848-8-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250328134427.874848-1-andrew.cooper3@citrix.com> References: <20250328134427.874848-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 swabXX() 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 Fri Mar 28 13:44:19 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 14032006 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 83A33C28B20 for ; Fri, 28 Mar 2025 13:44:54 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.930665.1333302 (Exim 4.92) (envelope-from ) id 1tyA0q-0006pc-Kb; Fri, 28 Mar 2025 13:44:44 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 930665.1333302; Fri, 28 Mar 2025 13:44:44 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tyA0q-0006na-Cq; Fri, 28 Mar 2025 13:44:44 +0000 Received: by outflank-mailman (input) for mailman id 930665; Fri, 28 Mar 2025 13:44:42 +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 1tyA0o-0005Dp-QC for xen-devel@lists.xenproject.org; Fri, 28 Mar 2025 13:44:42 +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 cd4c8ec6-0bda-11f0-9ea3-5ba50f476ded; Fri, 28 Mar 2025 14:44:42 +0100 (CET) Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-43cf680d351so18660525e9.0 for ; Fri, 28 Mar 2025 06:44:42 -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-43d8314f5c6sm73339085e9.40.2025.03.28.06.44.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Mar 2025 06:44:41 -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: cd4c8ec6-0bda-11f0-9ea3-5ba50f476ded DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1743169482; x=1743774282; 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=xv/5+f+BWzji1CB1SXmZ+OaK7UeEkWaO0hHsnfSGUeo=; b=CxwXeqxN2FYKt8GImqt1zE0dvtvlr0eGblr59YUvgjbBa45l5y5EMUPxVLeQkoOol5 81PDFsntsKHRTl6ZCW5Zkb+JQwofXDQvcQkyILOzaQ8zX9fLzKhbU+rghiPa3NJTK1PN 500P1ccGLkJf5bJIq5gnKQc/jy1HMffLY+q1E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743169482; x=1743774282; 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=xv/5+f+BWzji1CB1SXmZ+OaK7UeEkWaO0hHsnfSGUeo=; b=ZNaQCXxtkjIKVToFbj740rBk6OF7R6ZEEeQNTY/Yi8gpF+9c+BQJCwa7DxCxZ5Jbvn joSemzEjRB8Ktsjzw20ljgTqziJg3CPPLNLgi1APZzVoKumBiX5gzb6f3FzxyOSsTWYt sFQpntiKmngn2+eJCC72jJ1gcBK6+3Ok7JHsv23bjABHT26AncS8LUoxWGH2oGcwLWlI MHZ7GqmY1PvmoZh2QpXgjeL3fBX12vjMDoXlkc7Mu/yRrj57Yq9eVv69w6q/3ByZgMjM xwEtQ3qiT+RINNyMgsIQARktqBxnD8AJE3hxFw6QjQlQDlEsyvCqD1ob17QNLddo+m86 6z4w== X-Gm-Message-State: AOJu0YyldTvL2wE2jL6VyqzRsKvx9/uM9NUloLxWbd1M1n7sdVwC9Ej6 ki/aF65LiF2v0xidWUwYShjGRfxX0ds4f4n6CUlUdrzfF2HRoRkyPLVXJq8z5aNNnqlfvHeGIzi T+h0= X-Gm-Gg: ASbGnctEDASsK5lBpqSHWC2Zd3Q/JGgxAOmC9C4IyMRL9lVSdkV22H06lamBF6mTEVV 8ao1FqakdLejME4XH96CScR3ELVkqaCpsclJ82OQquFRSTns+Fx6FDp8DlKjnLbthbLPjLbZIod Twby5MQTfI83tnmN4vU7BniEDP/ds+4U1mvcExpzs7mpKST0Z1Imu4oZQ+U1A9B7g1tY/wNJHib CD6xBz0Q8zglUGAfAQP4UZS671GH8g3zMUZ+evqWTe6o+U03kcNFE4VaunZuYpw6+3w9YVO9eAg usrK362FlIOwWH9+9ueRu9a8dItbBYfuTVX+UfT8waxSdvPOxq+sRnIsZ1+igQB25WZ9tPGQr+n 1kpAC8/XKSmpwxFAHMA== X-Google-Smtp-Source: AGHT+IFe8F1Ghmv2+iYN3jy64ZhwzbMwIzbrHZkvQTMw2sExavxGXaR+RYLUFdw+YWQIFJ5rh045Bw== X-Received: by 2002:a5d:5f95:0:b0:391:b93:c971 with SMTP id ffacd0b85a97d-39c0c136bc9mr2658967f8f.20.1743169481653; Fri, 28 Mar 2025 06:44:41 -0700 (PDT) From: Andrew Cooper To: Xen-devel Cc: Lin Liu , 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 v5 08/16] xen/decompressors: Use new byteorder infrastructure Date: Fri, 28 Mar 2025 13:44:19 +0000 Message-Id: <20250328134427.874848-9-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250328134427.874848-1-andrew.cooper3@citrix.com> References: <20250328134427.874848-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 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 acb8dff600fc..d52c1c92548d 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 Fri Mar 28 13:44:20 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 14032010 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 C31D5C36016 for ; Fri, 28 Mar 2025 13:44:58 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.930667.1333312 (Exim 4.92) (envelope-from ) id 1tyA0r-00072T-H8; Fri, 28 Mar 2025 13:44:45 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 930667.1333312; Fri, 28 Mar 2025 13:44:45 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tyA0r-00071m-80; Fri, 28 Mar 2025 13:44:45 +0000 Received: by outflank-mailman (input) for mailman id 930667; Fri, 28 Mar 2025 13:44:44 +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 1tyA0p-0005Dp-Rk for xen-devel@lists.xenproject.org; Fri, 28 Mar 2025 13:44:43 +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 cde74abc-0bda-11f0-9ea3-5ba50f476ded; Fri, 28 Mar 2025 14:44:43 +0100 (CET) Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-43ce70f9afbso21882795e9.0 for ; Fri, 28 Mar 2025 06:44:43 -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-43d8314f5c6sm73339085e9.40.2025.03.28.06.44.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Mar 2025 06:44:42 -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: cde74abc-0bda-11f0-9ea3-5ba50f476ded DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1743169483; x=1743774283; 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=lMkCy5uU52m6Nkb9/AOxZXYQWO+U/njjgyb3D7V81+FWrs/ie9M7ERwdp4bHvKi/iH tT37DlPfibMJ0bbyJxoMaDoDUc0p7pbrUf0uJzotjAUH5uyqQr4T/CQxZsKsoaqS4fX+ 8TLQEGIVxM3MyvEL3WMOgbzX/qJ4mZ078K9m0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743169483; x=1743774283; 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=vmRJUZJ9GmdkeLMqR+sr1/IhMGZ0NrRqvqQFIEVsLeRZRU7u5Jt3YCJHR+V1OylPIL xdKTL+OyRANex+GR9ghxBLd5TWYL8d9GydOO/CfQ9/J6d5q/cwX7lqDb4dYRWYHqRkKd CnqwuAuJVxDBHb6bfmZKGrov7TJDja1NwU8PwZK+IH9+YROjgiFt6tlyDaS0rgz+z1jO rJiFndiNc32iSlfD83pj1DPdbWCGqZ60wSXDbkuytf5o/icyb7FfB90w4NiNmIzW3lcn UkeXnSyIHsMRURB5jgcJV/irDItLbjXiBUxEKN64y5/C8NJl4qnU6+gDBErQq8/5YI36 l/LQ== X-Gm-Message-State: AOJu0Ywzop/g3sb/jSnNsIgDs0gK/P2Ul3SNa7i1i8lgkGVEoKKzzsWO l8SVJxNow1lmhmQj6BKJc4PPayc4eMwwzsx9ZBLxdqGFo1EhTItpqzDUDDkgj70ubvOjuc9kZGy NpHo= X-Gm-Gg: ASbGncu3OrdPw0/198YZF+QPUaxEITCRSh6ol80U/PaVADIbLbGAH/HAjrg2jxj0wwY dqKkOnkv2Op3pjhGq7lb3VdnDOp8CnrmcPd05VCEWl3gRG2TJInEsMQDVO0GmJ8ZNIOQm5Ybe4d 5IVGFMYqbK7un4aPjvM1jJ9jgbraCh54KbXk15ajGOk2KnaVHjIqRtWNmUSPXRGzVU0Z54Z69IZ iu6RFsxKpfc8iF5+9sS/ohWSn1u2fMz/S+mjltkX6Ky/u1/Ez4PpPAE12Iq887ZJy6DZFcS/h0s iTQnaTDXPcw3tpNp/DcD6qXQ3mvAeMyhm3A+6unoK8jaqe43u1dTrHLPy75ntv0mOlsU/pVMIsz C5S1rVZ+pIiv54EGgvw== X-Google-Smtp-Source: AGHT+IHmmDmZC96ovPd8t2DNUfGnrEAgRE5PI4GTCYcZLnA5alpYNJaPmKyjWDdrQ4ZWUaMpbRimRg== X-Received: by 2002:a05:600c:1f0c:b0:43c:fbbf:7bf1 with SMTP id 5b1f17b1804b1-43d8509c1b4mr78706855e9.30.1743169482556; Fri, 28 Mar 2025 06:44:42 -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 v5 09/16] xen: Remove old byteorder infrastructure Date: Fri, 28 Mar 2025 13:44:20 +0000 Message-Id: <20250328134427.874848-10-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250328134427.874848-1-andrew.cooper3@citrix.com> References: <20250328134427.874848-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 Fri Mar 28 13:44:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 14032008 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 72B48C36013 for ; Fri, 28 Mar 2025 13:44:57 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.930668.1333326 (Exim 4.92) (envelope-from ) id 1tyA0t-0007U9-D3; Fri, 28 Mar 2025 13:44:47 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 930668.1333326; Fri, 28 Mar 2025 13:44:47 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tyA0t-0007TE-0y; Fri, 28 Mar 2025 13:44:47 +0000 Received: by outflank-mailman (input) for mailman id 930668; Fri, 28 Mar 2025 13:44:45 +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 1tyA0q-0005Dp-Su for xen-devel@lists.xenproject.org; Fri, 28 Mar 2025 13:44:44 +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 ce7d7fcc-0bda-11f0-9ea3-5ba50f476ded; Fri, 28 Mar 2025 14:44:44 +0100 (CET) Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-3914bc3e01aso1267620f8f.2 for ; Fri, 28 Mar 2025 06:44:44 -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-43d8314f5c6sm73339085e9.40.2025.03.28.06.44.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Mar 2025 06:44:43 -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: ce7d7fcc-0bda-11f0-9ea3-5ba50f476ded DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1743169484; x=1743774284; 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=FKNP22lmX5m2JJvtWLouYNOcz0bESBZ/pR10+FaQLTzStmVgDjqq/RLGeHCHM6DDV5 kPcpx6xa4TF7U2z4Q/Hu7G7ffUcLMnpaCN3vB3llqkpOjAE2RZNXa139NDeiaKEFf9Ta BSeq44pZYn0ePvwm3gU58BawUrxtL9jInlnCQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743169484; x=1743774284; 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=WB1M76qlOJy29NrMBnGUtUUGXhqK224RJFz6vqrQTjQlVJmdvHJ2wySw9r3ZPC0Ltm hXufForckHXlpPYAPVAdIwaFJFp/KKhtz3qLiiyntumaUHvN7dP5x47lTn/xlJgWmXEl mNV5i/3VyNaEiySABOyUmU1pF9yb0gJjPGGuvVPnMJpvl8Iv8VbQwlVOL09Cp860Ltje kcC3dNfoRhJzJEPmOgXypU4OIu483oB+2VPNyMIR6hGQbOsXWbcoCQ0DDvU3/MgumsTr JCdvpQd/SSvgb/342rOxAxd+HNGp/SuSfXWbixEYbMVGVQEp/znsnsAR/p9IAragvU0s Nx7Q== X-Gm-Message-State: AOJu0Yy1je+ttiT8VMLZj0b9HtuDRKV0dIJtr11bAF7L3OboOhJB8ebE g2KJ/JptTwMxnD5boN5SuB12l957PQldDrL5m/6lH5Hre1BP9T8+S44C/JOqknwm+bisFAfKo3X q7ig= X-Gm-Gg: ASbGncu0JXMUQZmuNWeMoB7opxx/oNkOuyoyfOcDzbuolCJJsHPtOHFVMcD81Zf5W8o VxhLGrhRopOxRq7xhc0CTHWAahu+TfDrdWaiMpavvUVGdQ7BQoRLOnKUhvT/7Adw38nZI8tlSqg OIOn0DB6lUMZMFA3SSu2KK4fCL/hApZFsboipBJy7XTECbx/d29vUa/SDHeXdsRzZ/WkcH1S9ZK WxGWxBmzt1svSIDLow9xLZq8WG6rPfGpzlYHg9hV5JLh4StKw6fh8kb8JFUScK18xpp8dPnAvf4 hcSFYdE6mipSn5glgDZVU5M4cej3TQ1lHGjA5BN8N7mT1qTLfa1m8VIIpjMCeJhC2uopJ2CWchh Fae+jL1nkbejcGt44Iw== X-Google-Smtp-Source: AGHT+IHfBwU8lMEk844l2Bqv78P9pWpma6JZFdTv9M1m1XCQNrVjdpdQ4irRXoe4H6et0ztnnkknCw== X-Received: by 2002:a5d:6dad:0:b0:391:40b8:e890 with SMTP id ffacd0b85a97d-39ad174b7e9mr6983573f8f.22.1743169483561; Fri, 28 Mar 2025 06:44:43 -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 v5 10/16] crypto/vmac: Switch to xen/byteswap.h Date: Fri, 28 Mar 2025 13:44:21 +0000 Message-Id: <20250328134427.874848-11-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250328134427.874848-1-andrew.cooper3@citrix.com> References: <20250328134427.874848-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 Fri Mar 28 13:44:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 14032011 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 D2945C36017 for ; Fri, 28 Mar 2025 13:44:58 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.930673.1333342 (Exim 4.92) (envelope-from ) id 1tyA0v-000846-Hh; Fri, 28 Mar 2025 13:44:49 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 930673.1333342; Fri, 28 Mar 2025 13:44:49 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tyA0v-00083a-EL; Fri, 28 Mar 2025 13:44:49 +0000 Received: by outflank-mailman (input) for mailman id 930673; Fri, 28 Mar 2025 13:44:48 +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 1tyA0t-0005Dj-Sm for xen-devel@lists.xenproject.org; Fri, 28 Mar 2025 13:44:47 +0000 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [2a00:1450:4864:20::42b]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id cf120adf-0bda-11f0-9ffa-bf95429c2676; Fri, 28 Mar 2025 14:44:45 +0100 (CET) Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-391342fc1f6so1826734f8f.1 for ; Fri, 28 Mar 2025 06:44:45 -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-43d8314f5c6sm73339085e9.40.2025.03.28.06.44.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Mar 2025 06:44:44 -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: cf120adf-0bda-11f0-9ffa-bf95429c2676 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1743169485; x=1743774285; 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=F+Q96Pz1YmVX7Z0eekUa67dddfXAaU3KT6aOr3p30LF3oiOPMjquX+kKs7nPcc/vVw SCmLigcmYzRokknBIeeEsljcDgLiIMMERynFnZje3lvJ/GEeqZhjW+qCgKqEA222wWma lPl/SJsUvXFeC4sXhciGk0RVj5Y9Z0DvVAAaE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743169485; x=1743774285; 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=fMbyQxCO6G97CnkmDKJ7uG+9j5MpsM9Ki9otwGrSLBK4llHnjBNBnVduT29Zwqwbbs 6J7+Y2YwlxMishm1cmXqJ2jDuCgPRjRdrN+S4wT6eq/1Y+sY9nq+QFVD48W36NCsGM7t Ej9r8V/7hW+GcIJPYXx9Fcono4Dg8gbJwFQvTtgoMB7OKP2pTiIb1/LvrTkpcE5A/Rzp XC+dN3s2OkXCqyGYn2UNK+KEd8vJtFh11mpGDyKteQRxn0oVBxwPzlq20u3uzsy/wVQS 6GQcHaJbo7aAzOaZuKmsyU10k2u51Qi8mm80UkkU76cvJtRxqnmhbAO+3VtXLVc7TEbz 706A== X-Gm-Message-State: AOJu0Yy2eJ+9IH6mTdWi91UTf3LazuUMQOdvzsR65zYWkVnDoOGRL3RD Z1pumbyq1TqeZj7k1o7Vm/kvOuuKqqa0+HL8SCUOIbArTD/3nJQq9Ws9Zybz/bRi51319lK6F3s swno= X-Gm-Gg: ASbGnctkFgskKwLnUfoZ+uE4sl+87gDhpT6v0luEPj8NYiYjpKc6ZNY8JZnvkIUGCZb WwoDysp4UDtYBBaGhr9MqMmWULAfSiMDFjCWn9iD3XjHEOCH1DWamRwHZlrL98lpUDQGceaOaaK MQNoBEuZPobGJL3E+MS1ru5F6eKMKR6vsKGe+T9kzhq3iHzFCS15kXq7VmAYOZvJZsSn7kpsEBV Wj2/rghFUZaQBE6qgdTUAGYDp3JwXCEI7pyWGTCTIPANlyRtPJ/wzWTGMu67LwfhzGNjZVs+4PR X8Vr3kGz4ZXIc6unIphWz+MS0LaNYRAcN/N045+ThiMd+sExw+ziT7mlyAKUpmc5geGYyyPQslo KVtgr4pccjstwOKfpLA== X-Google-Smtp-Source: AGHT+IFUWweznwg116NpoWFi+yvyz0sRMtpeqzErO3aq4nIcbQSzH//8/f9PCMAH0h7dBSDzXA3q8g== X-Received: by 2002:a5d:64ef:0:b0:38d:e584:81ea with SMTP id ffacd0b85a97d-39ad17606d5mr7016727f8f.45.1743169484563; Fri, 28 Mar 2025 06:44:44 -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 v5 11/16] xsm/flask: Switch {asm -> xen}/byteorder.h Date: Fri, 28 Mar 2025 13:44:22 +0000 Message-Id: <20250328134427.874848-12-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250328134427.874848-1-andrew.cooper3@citrix.com> References: <20250328134427.874848-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Sort the includes while at it. No functional change. Signed-off-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 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 Fri Mar 28 13:44:23 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 14032017 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 8E100C36018 for ; Fri, 28 Mar 2025 13:45:04 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.930674.1333349 (Exim 4.92) (envelope-from ) id 1tyA0w-00089l-BB; Fri, 28 Mar 2025 13:44:50 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 930674.1333349; Fri, 28 Mar 2025 13:44:50 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tyA0v-00088S-Tv; Fri, 28 Mar 2025 13:44:49 +0000 Received: by outflank-mailman (input) for mailman id 930674; Fri, 28 Mar 2025 13:44:48 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tyA0t-0005Dp-VE for xen-devel@lists.xenproject.org; Fri, 28 Mar 2025 13:44:47 +0000 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [2a00:1450:4864:20::430]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id cfabb72b-0bda-11f0-9ea3-5ba50f476ded; Fri, 28 Mar 2025 14:44:46 +0100 (CET) Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-39129fc51f8so1577889f8f.0 for ; Fri, 28 Mar 2025 06:44:46 -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-43d8314f5c6sm73339085e9.40.2025.03.28.06.44.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Mar 2025 06:44:45 -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: cfabb72b-0bda-11f0-9ea3-5ba50f476ded DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1743169486; x=1743774286; 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=YPiphnUaO7ugL9sM7Fivw+OCXGn6oQ+TuuGwtrqgEik=; b=WXcOrQFZpy4MQo4bk+bL7Ts+DpmuFbK4OUuHFl9eX9Yg1nT4cohfuz3dqCbPSk6/x5 h8gHIB2mgzbr3NNQx8vnSCHeZXHdjBcHj9y6KVRgfzIjrF4pnKemFX4DMnwWrCgPnZdw 1lmAINTyMFE9F8KMZ1JRrwb6GnGou1syl3wQs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743169486; x=1743774286; 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=YPiphnUaO7ugL9sM7Fivw+OCXGn6oQ+TuuGwtrqgEik=; b=xCgslDTE5sKDxSJvfqcUSOIapsvikPalVoM8RmwhpkZZKdEwRedgL+z3/nka/O8nen EcGju3X16g8tYpjTDBQlqJahW69/v2lOqgmXTc3orbOiLW7V1CVDjYSjyKGx12XibDzr iGSgkKYUh8lqsS66tUnz2LLw6L4nzV4ugDhRCwOp8y7uTS6o7uOqFNUEyy6UAI3O90fc NniIfWNzUw/rWszLEis+eXTb83GA6sATZZpHn4BAP3aCjNKJvHQajyrxebA78MMH2iDp R+4ggqI+wWfw61izBWnvBLfRkaKKP29NYsHSH2KjbzKZQP8qPMmV1nzfnL+UNmUgLPZQ Mh1g== X-Gm-Message-State: AOJu0YwneMs19WW3aWItEsrBfzIATLs5Trc5d0mibf2B8a/QOKV8eUpw q743LrBOLDfFVsaaYoY/m0MFBqPfnsVuko96K59WPofHFrWZTLi/cGc2uySDaNdtpODvhelHmKw ++sQ= X-Gm-Gg: ASbGncsHdHicOo6Nk40DkHp13HjPC3Dg9CMo9wfHx6+espRv5G4stl/QfwIFtUAVg+t 22E4AuuAHGBhCw8ZAAm1/3R217ZX9DvPNS0HpHbEM8PjaO3WgEuRqX0Mx9ay64BqoZ1sw7ZmO8d F7t/pOTq8idhcmafPWrHEeZvywxgsdbiPgLJnMJBpiYHMYJ7bQfqSvWRPTOLePFhbGXSOE7/ChZ Bm2W8cjKfwGu1msDZPvv6veq25ZnWQYhHhITi/B5CZpdrg5I1cYCuzT9lWZTV1wfbOuxzRZ6+eY jHiu2+O19hNeGoUSYxPvCTdJjtgpDBkX7k1xg7tyPTpDKXXaIFRa1beoNiQX3hITDTUEtbr8okp bNZ/jkY1pu9DbihBLhA== X-Google-Smtp-Source: AGHT+IHB7XUpDqHtiaz95nxliZmnFd4VtG0oJAk+yY+CAy7MT4jnzocP1fTBggA3PBjVFpoV21XUfQ== X-Received: by 2002:a5d:47ac:0:b0:38d:d371:e04d with SMTP id ffacd0b85a97d-39ad175c0cfmr6503103f8f.34.1743169485521; Fri, 28 Mar 2025 06:44:45 -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 v5 12/16] xen/common: Switch {asm -> xen}/byteorder.h Date: Fri, 28 Mar 2025 13:44:23 +0000 Message-Id: <20250328134427.874848-13-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250328134427.874848-1-andrew.cooper3@citrix.com> References: <20250328134427.874848-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 3da63a32a680..f605c98a02b2 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 Fri Mar 28 13:44:24 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 14032019 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 15E52C28B20 for ; Fri, 28 Mar 2025 13:45:07 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.930675.1333352 (Exim 4.92) (envelope-from ) id 1tyA0w-0008EP-RG; Fri, 28 Mar 2025 13:44:50 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 930675.1333352; Fri, 28 Mar 2025 13:44:50 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tyA0w-0008DN-CG; Fri, 28 Mar 2025 13:44:50 +0000 Received: by outflank-mailman (input) for mailman id 930675; Fri, 28 Mar 2025 13:44:49 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tyA0u-0005Dp-VT for xen-devel@lists.xenproject.org; Fri, 28 Mar 2025 13:44:48 +0000 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [2a00:1450:4864:20::431]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id d03d945b-0bda-11f0-9ea3-5ba50f476ded; Fri, 28 Mar 2025 14:44:47 +0100 (CET) Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-3914a5def6bso1165808f8f.1 for ; Fri, 28 Mar 2025 06:44:47 -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-43d8314f5c6sm73339085e9.40.2025.03.28.06.44.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Mar 2025 06:44:46 -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: d03d945b-0bda-11f0-9ea3-5ba50f476ded DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1743169486; x=1743774286; 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=Jg3jnfNuv7NeEnD+o5BITmYdbPH0xSFgDOuuHWlSb9PhhDr25Lm/KWtz14JM2zw3fO 3zGGfLcJhJyH4N23uEUXtx+cHeFcQpRQeWuQw2KQizAmx/9L07m3WoUMSPnWfOfB4HA6 yJ5U3RdSnxwTc3AvPbZekyEuKq4q1c1xf+xcU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743169486; x=1743774286; 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=G+T6i2KCPO8KsLd5DVZIXpy34VQV3yHu+BMH7X32KONpMAt8fJKAgVYSvXYIv3FQz/ k27dJO4W3TQ4y4pnRjDPuUkqAN86dkcp50Oc0QU3WR3VTpO6//E73szeYOmwtgyghYQZ JcdUTm4NquJSBX866A2wLI71Hq7/Hv6x0VTFODR1tm+R0E7EuphXpACBJrtCUHvvBCzE GJHbLg3V0D+8kkoPigP3l6pL9JUi7DrNzPKXlVr2p9exUYhnGJq92QvGg98zlV85dusH X0Ftm576COAvQuZ6SpTa3lZ6oObW/JNtoofqjjqgFc/LpVrw6WFuAA7eH4tGkk08v/D5 tpoQ== X-Gm-Message-State: AOJu0YzlPQPzw7/riQt/i4RSEG/nrzbIJFSaguIGLsnMLB8KNXNDO/ow DpTrDHN7u0M5XnOuC8h5L3dXds2laYalYb8O9VCc8iaskZErcWqBjnQbeXDzXLUXjl5ga99SGLR gduc= X-Gm-Gg: ASbGnctzW2ZlGRCdlAqVlWdNUBJvj8Hbe9BU0XEiiitWtOLQQLIaDcroaAFUySIB3MH IqUj4HIi/XGRLHL+dD4KQ0yQUJznrxf45qeMu15ztnrdNrMX9jb+oBOu178MqB650Txj5S90K14 Yfu4NGgXQ9biw5fE3RnbeOb1UvIhE7J3p/5oo68PhqFTbSct4oJSYhsikKhzUBkt6FnmImmERBH P9cq67uSRX1WtAQFdTA66rtkqSo9UNLirpyM1G4XCSWcfzHIStjp9c/htAY+Ggxol0cjBmVm7zP xDXUV+KUP78tgHjg7ld/Ypb0AY6UER585vugrYY7ktl/9vPq2Wwa3XrgCd0SgxWn1W8By9kpHmO k1qkE1Em+t0eN4kb77bLw4wSLTM7+ X-Google-Smtp-Source: AGHT+IEZCb8zah9M+EwsxZJjuqRbSRKz3ql1yONsqA24plQVJp2eXkMTTqoezHlITccAeP0+Ht90FQ== X-Received: by 2002:a05:6000:2d10:b0:39a:d336:16 with SMTP id ffacd0b85a97d-39ad33600edmr3783728f8f.34.1743169486526; Fri, 28 Mar 2025 06:44:46 -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 v5 13/16] arm: Remove asm/byteorder.h Date: Fri, 28 Mar 2025 13:44:24 +0000 Message-Id: <20250328134427.874848-14-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250328134427.874848-1-andrew.cooper3@citrix.com> References: <20250328134427.874848-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 --- 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 Fri Mar 28 13:44:25 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 14032026 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 BD5DBC36014 for ; Fri, 28 Mar 2025 13:51:54 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.930758.1333373 (Exim 4.92) (envelope-from ) id 1tyA7d-0005yD-6U; Fri, 28 Mar 2025 13:51:45 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 930758.1333373; Fri, 28 Mar 2025 13:51:45 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tyA7d-0005y6-27; Fri, 28 Mar 2025 13:51:45 +0000 Received: by outflank-mailman (input) for mailman id 930758; Fri, 28 Mar 2025 13:51:43 +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 1tyA0w-0005Dp-Vu for xen-devel@lists.xenproject.org; Fri, 28 Mar 2025 13:44:50 +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 d10277bf-0bda-11f0-9ea3-5ba50f476ded; Fri, 28 Mar 2025 14:44:48 +0100 (CET) Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-43cf034d4abso23718445e9.3 for ; Fri, 28 Mar 2025 06:44:48 -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-43d8314f5c6sm73339085e9.40.2025.03.28.06.44.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Mar 2025 06:44:47 -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: d10277bf-0bda-11f0-9ea3-5ba50f476ded DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1743169488; x=1743774288; 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=miYAZjSOgopZ7er3mpT1Pb6zFMXz5ecOcXh9ZUJUwf9cUrGoFb3N5lIoB5GxcH1h2T yZzkScbOChY3Erd1EAKs5/aJnFHJ+kuQ+3Jbd9yClompx8ZsfdzkGKGU2mghqK4FbZ1A mmRMLbuJT/NHV7DtulJt6kXfaySbwsahgOrt8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743169488; x=1743774288; 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=MeRX0YEZR6jdPPHiHsQf8TXjwYCQ72xXhj+HiGsqhYfTPrl6Rq2hE8ztZQj8oHB1D9 R3Kh4CwSF216P3CXNJ0PKadqHtjkd0lUm9Q/0ZagVWiLlGj04EcUVN0ExRaA8ZsF9MEO yrS39/UmF7Glk5LnnfaAC7gesPQnKd1DduinPYmYJ9Tp8eSXTxS6w9yGiBhJhVSvaDxf W1RYHk/6Y9AaZZCiqyI6bUrRqZAyoZfaAlrjI+s+1+vYbHWdi7Z+rQGDH/TSYxhCdfVj fVQbYKpA3g14nWbx2pyG0gaAhFzl/q18x51J5ybmYCE6nw94k9hZuYvDcBUwnwvIuUDX XJqg== X-Gm-Message-State: AOJu0YzOVGLMlc80bvo9WM9ODLEG7qKsp6nenGymd95sXY6WEJbsCBOl zIyG9htFclkvw9Us/wK3vqGe/XAfHqx48qfX4JE8uOn2Kg0mCYk2yt8MRpcMcTrpDXQYNXa3qd1 PZ8U= X-Gm-Gg: ASbGnct7xgD56fYYWldq96+Yhl81f8FFZNFZ9SnyNmfIFZeJltkpgTjQ6BIwvpvCVO6 I/zYxGfsYpqEJF25fJTkAy3/oJnkJdDwt5+fcXUmBpB0H1v8M20sGvzSl0Xm1sVrB4zMsijo9UT ZL2DSMPrqon7nyxez5TKnsV0V2VHkqJKlPp0xI5EO+DtlA6adUhLTEkEzVCziZq3BZtjkZ2K4tf cuQC8KNVIB34RG7liZMnyuGnRO8Fat2B/Br2cCWQZpFi8o5HLPeUa05mXS3vGqu0PPXxOqd0sFf 69unE/STJOrZ8h9Dj6WmutCd1RmQqx9IYLAjm84Zft4fH4+7JbKTJD6eKNXjiJhiGe08ROYd2Uw ZgEoRIPhOyKsqlqcg5KseOkyBK5MP X-Google-Smtp-Source: AGHT+IHx3WBGb8B0p0qC21b3Uv+TnBjigba14tinL+ecURm3/tNn9wT516bmb4QZYSGgnCNW0JuRig== X-Received: by 2002:a05:600c:444c:b0:43c:ed61:2c26 with SMTP id 5b1f17b1804b1-43d84fb27a7mr70300525e9.17.1743169487737; Fri, 28 Mar 2025 06:44:47 -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 v5 14/16] ppc: Drop asm/byteorder.h Date: Fri, 28 Mar 2025 13:44:25 +0000 Message-Id: <20250328134427.874848-15-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250328134427.874848-1-andrew.cooper3@citrix.com> References: <20250328134427.874848-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 --- 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 Fri Mar 28 13:44:26 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 14032028 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 B7EC6C28B20 for ; Fri, 28 Mar 2025 13:52:08 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.930782.1333392 (Exim 4.92) (envelope-from ) id 1tyA7t-0006uK-Ji; Fri, 28 Mar 2025 13:52:01 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 930782.1333392; Fri, 28 Mar 2025 13:52:01 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tyA7t-0006uB-FO; Fri, 28 Mar 2025 13:52:01 +0000 Received: by outflank-mailman (input) for mailman id 930782; Fri, 28 Mar 2025 13:51:59 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tyA11-0005Dp-0L for xen-devel@lists.xenproject.org; Fri, 28 Mar 2025 13:44:55 +0000 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [2a00:1450:4864:20::431]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id d192ab8b-0bda-11f0-9ea3-5ba50f476ded; Fri, 28 Mar 2025 14:44:49 +0100 (CET) Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-39ac8e7688aso1777585f8f.2 for ; Fri, 28 Mar 2025 06:44:49 -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-43d8314f5c6sm73339085e9.40.2025.03.28.06.44.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Mar 2025 06:44:48 -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: d192ab8b-0bda-11f0-9ea3-5ba50f476ded DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1743169489; x=1743774289; 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=sOpUu990EoQlzQRzQ8NP3z9qRiebIA5naXnjIh1S24E=; b=qmwgr2c4hFtyNf3hMdqS6sOLC818gB/CPmLxPGTBhkj1eFyoCjZhWh0mbb62+RRss2 Dg5mqmki8bg1AsusvqfGdvIr+wKUNszsVq486HMALP/2x7vbDETqjIvCLvun/K6iLx+e qxPKQSxk2I7k1kZRnR+eWMwKyP3Aok9w/FqIk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743169489; x=1743774289; 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=sOpUu990EoQlzQRzQ8NP3z9qRiebIA5naXnjIh1S24E=; b=vzPR5BC4wLJ1sBH2JCxbXTYRFgmhXE29T15Jhr9XkT9IR2v0tZ6Nx92O+HBL/e3vz0 Jp17e+xy5M/4LOqrYYueJkNgBX+bjjS9w+cSvmSYPLFaXwBddPdG9/E1ldmh++QBmgpI IDhilwAO5BUHQlwc02aKBiXj/mtvYM8ICiiw4fSloDpVjn1FRqvDW1NHyLnFJo/wqeJ6 bu9WaP0fgGaKXfIDFsqNwQNzvFNWQvNslf3rxq8uKmip79HO+qUZzbggxRlZGOiucb4X PiMZSfjZ2Wwh/4TBADh8wXUFCZ/uV7TMKRtI8m/jxxo508/msVfzXqS8jf8yCzTir2L4 x0kw== X-Gm-Message-State: AOJu0YytT0rbB6EToJan0azmyhdlOvEo3v2wAzuo+EIFy35gt6xhOYPJ i1Hfs/JWYpCX1OrPf4jol+3WnCI/epLBh5Q7kvlLA6kXa8TvYlXACCNmvUcGxlUV/E8jtThbtjH 5YWo= X-Gm-Gg: ASbGncuZeUfX4sYCuds4W4hkA3DflweRtoPJ7N0nQo9K2yigMqHsqsJG8h8no1MVi5W Ixbvo0hZampvC8mslXyZ6lawhe4aaGDUJ5FVKQm9JBvZT1fvc6fVaQYbNDXc2ZN7RPVe5FESSdI /yxno08lNofAbsB5ZtoWPA1RZ1LWO65MET3Sw0TZpxeNbr7keLpoTt0oaOgi1YB2rAD52OyOAur pGC8d9OnjzYIcuVMJvUKLVA37e8ZxagMr2DO6zK80f9YW5RE14uEge0sxe2lfUqJVk76KmFvMuD XDKO0RRW3IrWhz8JfqIOIU6Sw7fbS7cE1Sd03og785U2HkumrPs69+cJDoViszZHPzs3CBADiOC rv6z3N6Tdi8hPupxvgRmBkE3yF+gF X-Google-Smtp-Source: AGHT+IGI7JO4UlPZY2avFsom7n/30LCzzvOjr02jm255ArguGao3va3hCkObUFth/phBf95IeTK7aw== X-Received: by 2002:a5d:6da5:0:b0:39a:cc34:2f9b with SMTP id ffacd0b85a97d-39ad1746622mr8531467f8f.16.1743169488749; Fri, 28 Mar 2025 06:44:48 -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 v5 15/16] riscv: Remove asm/byteorder.h Date: Fri, 28 Mar 2025 13:44:26 +0000 Message-Id: <20250328134427.874848-16-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250328134427.874848-1-andrew.cooper3@citrix.com> References: <20250328134427.874848-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 Fri Mar 28 13:44:27 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 14032027 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 A2FC8C36011 for ; Fri, 28 Mar 2025 13:51:58 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.930762.1333382 (Exim 4.92) (envelope-from ) id 1tyA7l-0006Lp-BW; Fri, 28 Mar 2025 13:51:53 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 930762.1333382; Fri, 28 Mar 2025 13:51:53 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tyA7l-0006Li-8y; Fri, 28 Mar 2025 13:51:53 +0000 Received: by outflank-mailman (input) for mailman id 930762; Fri, 28 Mar 2025 13:51:52 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tyA10-0005Dj-Tq for xen-devel@lists.xenproject.org; Fri, 28 Mar 2025 13:44:54 +0000 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [2a00:1450:4864:20::32f]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id d24769c3-0bda-11f0-9ffa-bf95429c2676; Fri, 28 Mar 2025 14:44:50 +0100 (CET) Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-43d0359b1fcso13827195e9.0 for ; Fri, 28 Mar 2025 06:44:50 -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-43d8314f5c6sm73339085e9.40.2025.03.28.06.44.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Mar 2025 06:44:49 -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: d24769c3-0bda-11f0-9ffa-bf95429c2676 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1743169490; x=1743774290; 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=nZUHv1N8vC2mMF6eWvDAbxG4QVBLI9VbNCfXt15VpfQ=; b=p66dy26dzXdb/XfM8MUYs/aMwxlllqZYYPjH2HUv82xFo+6VLze3WiDIrVgxlZauvm O2vye+zfNPiKjD5yIHBPkS5ho9Mpf8uKRaKMfkvmy1eTRg8gN3dIsDx2FA5X98MwbBaa 6F0OMz0NNs3qOqlqPKOL337EtwtjjYxMLQRgY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743169490; x=1743774290; 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=nZUHv1N8vC2mMF6eWvDAbxG4QVBLI9VbNCfXt15VpfQ=; b=UhDRMQfAetTkyN/zLuMkSxuUNdafuJ9vhr2/qI/nB5tFGXvRQCm4b9lSwGedV0j7bt NZHkVAaCi4ZePfCsGkradtKFUXf0vNPi5/17d14PP2dsU9INR/5knoOmJVHp7LUzmNzZ uyMb4SHc/6l0zk4tiBTDJuLW1IfIXbbujWCB2YNwfnmYTfatIgSmGIWhNORXJBrtliGY IrGncHsY9wblOC/jMp0oz+fEiVKMWXTVnnd6ZrMoKDjuul9gQmZYga3zqhZxASxLxoVN 0NCkYNu0CGEPFgA8F6PZLgejRzxCfXGpF6Cxt4tQR9cDDZZht8YbOednuW/bByo5SlZj VbzA== X-Gm-Message-State: AOJu0Yzh9RRNi7FukezqpZDFtjbcIP8dtIHTIEDVwhMPDKBFYI5zL7iH BT8IeJ9TECvyXKY0Doo145Dq1yX9YGXnsJlGa7HOyh99Vp0cnWQeoBNO9NIyrG45+o5+Fnq1vD3 WPBk= X-Gm-Gg: ASbGnctBPNHPY4lpVFKfJKOoRsHMBVHgS2Dk9TplAS5mFC2bHc2eTTJDqWu8scbLGgq 6JNnaUb57xLUk5b6d5XmWMZ3U7tn8N4gSKTt4J6JBas0Jti5OB/xnTxhdjcusAJ1JUfgtqka7pi NOY5TmhBBvnu8f5HY3veXDkMLgub1o+sMRmimY83WDC23zKOymA+Ff276xwX7l/9va3hCrRJJEc nCu9Im1ai+ht1yTIltx79ZdqRIZUYtzOc3aoe8MWLdMi9YgCfJVUvHDYpi9ctktEPk/x4ojq7kD TvszuwKSIn664Fd81jknDB+hqrohr2GoHOBmk9X+jVL3yUX5/Mtmp66NsWKgHpO/Bz/KTm/126D qin+Xuukn27MnwPJFRQ== X-Google-Smtp-Source: AGHT+IHw+QsVzsomMfTCdpkftRub0+DzPQiQkS8UhilMb7h18EvQMtpeEMKhngv8Jt618dN3evt5ew== X-Received: by 2002:a05:600c:5026:b0:43b:c857:e9d7 with SMTP id 5b1f17b1804b1-43d91435e08mr26331665e9.5.1743169489894; Fri, 28 Mar 2025 06:44:49 -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 v5 16/16] x86: Drop asm/byteorder.h Date: Fri, 28 Mar 2025 13:44:27 +0000 Message-Id: <20250328134427.874848-17-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250328134427.874848-1-andrew.cooper3@citrix.com> References: <20250328134427.874848-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 /*