From nobody Mon Feb 9 06:28:12 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1767940558; cv=none; d=zohomail.com; s=zohoarc; b=UM6Ty2K4HEzo8TBURQIXFH1yb+MPdvBIQ6gmTDbgKLDexQObToCLlyovPhqQpMeYzwCP7ILgRXiPbtV83x5ddiyuzTaZGnfSHFwIM6k6KSVE5jIwtG+My5TIJ9Iq52FOlPjGYmlpNFhxKsmca9CsmtbsrcK/y2VR6bTF4TeU0eM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1767940558; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=lYe5OM9n3hWR6ZPryFp5pgvfiahoglXKqPwtWMRKxsg=; b=cmHOy/r6tpZ6+abh/QBS+KGBU546X65Zhw4VKcT2XqFC3IWfkDYNKXchHGUDssXBQFuKiMRT2b3ZYNs6iv5Ro0E9glhmAOkifnFV5EIuOPie4VDw6AsUNURur98sgFS1y4NrA8oMowPRIGg/lKEzWq2b58Al/jVgrfPdd36hqic= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1767940558616438.8146702622537; Thu, 8 Jan 2026 22:35:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ve65f-0001xf-Go; Fri, 09 Jan 2026 01:35:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ve65e-0001u9-BJ for qemu-devel@nongnu.org; Fri, 09 Jan 2026 01:35:18 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ve65c-0007MJ-F2 for qemu-devel@nongnu.org; Fri, 09 Jan 2026 01:35:18 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-4779aa4f928so42375935e9.1 for ; Thu, 08 Jan 2026 22:35:15 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47d7f41f5e0sm186116365e9.8.2026.01.08.22.35.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 08 Jan 2026 22:35:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1767940514; x=1768545314; darn=nongnu.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=lYe5OM9n3hWR6ZPryFp5pgvfiahoglXKqPwtWMRKxsg=; b=KYDEgZ7Kz8rdr6o4c9RwgQN7pnYKVNvqZ/OJ5Ixs/QRFG/Xf76FodM6oN03n5rji05 NfaLjicPMDN9/bqA9dl06GgH7CuIJ5vmOhABYrhjcCrreVUDer+c1ZHPsrA7u8Q5pRQt tpzP64VogAINDCJMbWqLda6Uf+S57JVjGwQUoYD+sV37vveOwDoetrW3t0BqsUJIQRwg MTML/MEKqwgiyebGULvRVHVmEKFjnjpOXS123+XS69TTGhdjosUI84W54JP2H1oLrA8O MAa5YvHxXVQD3Iz28Mq7azk0E68fjA24ewZp5s9HxEqYkpbvF2IPoZknrRh/GiCVRqh0 ferA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767940514; x=1768545314; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=lYe5OM9n3hWR6ZPryFp5pgvfiahoglXKqPwtWMRKxsg=; b=MbtkK8STkaGIo3/k+slhIOYFuNs42KRVOiwZtXNjn323B0dPCoNmw0AL40Pf5mY8hy eL7jBDFkAleRBvPcPNtQ1mKx3hUeHZxgL6HAbvqlxQVfzHeyzuj4Xzctho2KPJ3Yr18j EYu1gCYTfiftkZ/rA/L84qDPrVuuCutKN3hjDF05vlQgJUdwe4RwRe2G5QUxz0b1xgqG xSZpM5aNuU/yQ8oVDuKfFE0CJlTxuTejPCBURtSDqUmRb2nMkQDqQsKjfrHcznynaNQy BMDf7OhhIIshbKQBtEdo/ML3hUVyZcQ73XBEkgNzlD9n+v+4Y5ffEGgz+JAvIeJNoKTJ P04Q== X-Gm-Message-State: AOJu0YzqVurUGNUDUeK8ppcaYVgG/ks1T6Tg3B9GKiyP46jshiyhBvSm ySLM0tGuWS5TKbn1/6ldgk67SnrSIotiie0MFxaIWPyhSXKOKQpMrb5lx2kgd/hHs4bH2btrrSs VUd6hFoE= X-Gm-Gg: AY/fxX4GC/Yk69fCT9iEpxlRDNKRvIWhxfDjAjgGsEUl+MW+btFCTmc94V9bB3vSIQT eeScQ3mG7uOBp98xNMnvJeGfm96IFAf4EDO+oUwraImuwPEp7/0jp00kRKMoe7B+u6J408uYuls xlVGZPK7mdmZPBtsN9AtZxTl4anAbQzPJdsBxAawOMkJ9dPVrlkmS/ghMNfG4dQGRzWoTixonI0 YBG1ksZflVyAqmbTggluwesP4aEKnGL7RxgYrZMMMJw4iFza6DXKNRIlevVUZp/T1rbxYkn4k3s tS+KCSKREomMgNNkWzK5+Qf67V21YdcQpONp9eNiqxeFh0+7c7EFDQogpx7dwrjILwI9CutJrwF ys3UHzJkjM+lk6FTyb8iiwkz9cF/ReyYaZfy6tQQOkMgnVsGhp627k6QX10TxCKYq2pJQ6l9wxr ub/bCY6l+mGgZtvO1q8kZhL5Z1CEPPffH2HLA8W8tAtS4P8tj6pDfCQLQH41s1 X-Google-Smtp-Source: AGHT+IFqOU8/u+XVqW5AaXsguYp54q742aG4CDHtRjPgeGi4FlEsFtkwyqEWp4ZRAX2+ZAdVLh8qCg== X-Received: by 2002:a05:600c:3143:b0:47d:4fbe:e6cc with SMTP id 5b1f17b1804b1-47d84b179f7mr105791515e9.13.1767940513669; Thu, 08 Jan 2026 22:35:13 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 1/4] docs/devel/loads-stores: Clarify regexp are POSIX basic ones Date: Fri, 9 Jan 2026 07:35:01 +0100 Message-ID: <20260109063504.71576-2-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260109063504.71576-1-philmd@linaro.org> References: <20260109063504.71576-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1767940559826158500 While git-grep uses POSIX basic regexp by default, git-config can select a distinct one. Add the '-G' (--basic-regexp) argument to be sure our regexps work on first try. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Maydell --- docs/devel/loads-stores.rst | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/devel/loads-stores.rst b/docs/devel/loads-stores.rst index c906c6509ee..fc78def0612 100644 --- a/docs/devel/loads-stores.rst +++ b/docs/devel/loads-stores.rst @@ -63,7 +63,7 @@ which stores ``val`` to ``ptr`` as an ``{endian}`` order = value of size ``sz`` bytes. =20 =20 -Regexes for git grep: +Regexes for git grep -G: - ``\`` - ``\`` - ``\`` @@ -120,7 +120,7 @@ store: ``cpu_st{size}{end}_mmu(env, ptr, val, oi, retad= dr)`` - ``_be`` : big endian - ``_le`` : little endian =20 -Regexes for git grep: +Regexes for git grep -G: - ``\`` - ``\`` =20 @@ -154,7 +154,7 @@ store: ``cpu_st{size}{end}_mmuidx_ra(env, ptr, val, mmu= idx, retaddr)`` - ``_be`` : big endian - ``_le`` : little endian =20 -Regexes for git grep: +Regexes for git grep -G: - ``\`` - ``\`` =20 @@ -192,7 +192,7 @@ store: ``cpu_st{size}{end}_data_ra(env, ptr, val, ra)`` - ``_be`` : big endian - ``_le`` : little endian =20 -Regexes for git grep: +Regexes for git grep -G: - ``\`` - ``\`` =20 @@ -231,7 +231,7 @@ store: ``cpu_st{size}{end}_data(env, ptr, val)`` - ``_be`` : big endian - ``_le`` : little endian =20 -Regexes for git grep: +Regexes for git grep -G: - ``\`` - ``\`` =20 @@ -265,7 +265,7 @@ load: ``cpu_ld{sign}{size}_code(env, ptr)`` - ``l`` : 32 bits - ``q`` : 64 bits =20 -Regexes for git grep: +Regexes for git grep -G: - ``\`` =20 ``translator_ld*`` @@ -296,7 +296,7 @@ swap: ``translator_ld{sign}{size}_swap(env, ptr, swap)`` - ``l`` : 32 bits - ``q`` : 64 bits =20 -Regexes for git grep: +Regexes for git grep -G: - ``\`` =20 ``helper_{ld,st}*_mmu`` @@ -325,7 +325,7 @@ store: ``helper_{size}_mmu(env, addr, val, opindex, ret= addr)`` - ``l`` : 32 bits - ``q`` : 64 bits =20 -Regexes for git grep: +Regexes for git grep -G: - ``\`` - ``\`` =20 @@ -382,7 +382,7 @@ succeeded using a MemTxResult return code. =20 The ``_{endian}`` suffix is omitted for byte accesses. =20 -Regexes for git grep: +Regexes for git grep -G: - ``\`` - ``\`` - ``\`` @@ -400,7 +400,7 @@ Note that portions of the write which attempt to write = data to a device will be silently ignored -- only real RAM and ROM will be written to. =20 -Regexes for git grep: +Regexes for git grep -G: - ``address_space_write_rom`` =20 ``{ld,st}*_phys`` @@ -438,7 +438,7 @@ device doing the access has no way to report such an er= ror. =20 The ``_{endian}_`` infix is omitted for byte accesses. =20 -Regexes for git grep: +Regexes for git grep -G: - ``\`` - ``\`` =20 @@ -460,7 +460,7 @@ For new code they are better avoided: =20 ``cpu_physical_memory_write`` =20 -Regexes for git grep: +Regexes for git grep -G: - ``\`` =20 ``cpu_memory_rw_debug`` @@ -495,7 +495,7 @@ make sure our existing code is doing things correctly. =20 ``dma_memory_rw`` =20 -Regexes for git grep: +Regexes for git grep -G: - ``\`` - ``\`` - ``\`` @@ -536,7 +536,7 @@ correct address space for that device. =20 The ``_{endian}_`` infix is omitted for byte accesses. =20 -Regexes for git grep: +Regexes for git grep -G: - ``\`` - ``\`` - ``\`` --=20 2.52.0 From nobody Mon Feb 9 06:28:12 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1767940594; cv=none; d=zohomail.com; s=zohoarc; b=XFKXz/XfGKz5iJNgt9Qo6UfjKBs2WwMIphdG0vKHTeRS0x3Cqx4FDX7vB34BdncHG2/Zske23AfRZ8BLLbcFFd/nmCbip8jrTn6Mws0v/yonPg8yIdrgWie4SapLQJ9O6GwTip7XlWEGrPRm/HbHvqg3/L2QMd41MvMtKtTDZZE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1767940594; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=SQ54xeTTUwy0II+XoXo3E3Wu99SLAlkeuwkAgFVFUYo=; b=EDkLD+IyvYcB/2pS/CptLcKHVlUMb/enhVQhoiTXwuBBhyZ63wSZJBjMYBFK3cil1/sFU/PDdDy55b/IynQk1X3+4qpbLrN/IxyzEqYVo/m0udfn136o1u4+HAY8QQfXEegKNSq5seFaEhFtobchF4RkgE6dUdlB3o81D6RH0vk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1767940594704192.11440627718105; Thu, 8 Jan 2026 22:36:34 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ve65o-00020e-Vm; Fri, 09 Jan 2026 01:35:30 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ve65k-0001zb-Vx for qemu-devel@nongnu.org; Fri, 09 Jan 2026 01:35:25 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ve65j-0007N0-7O for qemu-devel@nongnu.org; Fri, 09 Jan 2026 01:35:24 -0500 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-4779aa4f928so42376655e9.1 for ; Thu, 08 Jan 2026 22:35:22 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47d7f390a69sm189717435e9.0.2026.01.08.22.35.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 08 Jan 2026 22:35:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1767940521; x=1768545321; darn=nongnu.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=SQ54xeTTUwy0II+XoXo3E3Wu99SLAlkeuwkAgFVFUYo=; b=lhEq3zTw9FgUU243fL/cqZRr852mudNITbnurmkT0pt5hfWA5iK/OmoXEp44TCnXmE W7BT/AoAmSTAxhPNn1qcQIWY47cnV8gW46XIQxuYHD2lJN5DMiAlgvMXGHPo0nPEC+lb Pyb4CcAF1VCm+omA5IvjX/yN8Ohkm7IKU4VzvOFCFrlyQZTZ/0WZZ4JLaEjl/eNuCwl3 yvKHAeE/3rhTcY7DZJFGkunPxy0qTH++CFyV8DXMshzzCRdx8cwtEa7PaCpNyTsECyqi cb0EBf/bmLdCya4jnuLPqDXYo5ChEktJc9R4zY3G2eU+TRWv9oumDl9jltJp+Mu+YivP 1sEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767940521; x=1768545321; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=SQ54xeTTUwy0II+XoXo3E3Wu99SLAlkeuwkAgFVFUYo=; b=vrbHX7qTasvhVRw/9ZjmTTRbhxAO9c8hJUTNck4FIdu8CDsT7OeIYZssXof0qKMhPx pp4BH7t+XwuPDNVG/s/ZNOrEW8Z/++MKexif5EdJwYGpCY3NvuLXUzsFATxn1ERLg2mi d8JuqCVU5I3aJQ+pv1oSswKmHFN+NXvU1ccZagWJXXPPK1oaNQBm1INOBTjeUnFVCmcA neLlw+FZ7rZ2Zb+/s4oHLJ3ogbwToeq4hFvC6o6qcmp1ub9GCApzMhhb96eIRk7pzuMK F8md0hO7fXEchNh/RM+mgta5Ri5+z1l5g3KEuhUSC3UQTwF4fPu9OJq6trsr0kCTWeo0 e34Q== X-Gm-Message-State: AOJu0Ywl21KjdTN7UrEnSk7awoExuQZRSzFlbEMPp0dqMpJUS0eRArm6 KvLbnVkXeZiJ03X+f53VEYSi1uMgdKsZdzr6WEMlyctyJGYW0PG5jXX2/tkvZ1PbmLvezM44IPR GTI9VSzI= X-Gm-Gg: AY/fxX7JSYBAy5Mij4zrYR4BC3MfYGQ6k+M30sifqHxakDRKu2iR4pjuJ6sth0W6/Yu iWMFACo54jzjJUZpXhP3cDhqRzYUHYDfoKzcEeY4we9Zy04A2llYkY6cgAq3DNhggGACGF5eHu3 yWyarjgup5RpHVm3AwBLppLCjftsvEnlH4tW3FL72w91/CT4YGcwxmKRVRzAd3qxxpI05XuO4ub tPLNYGAi6hckrEeCEje6EsuFJsml2QPhaEHsyKdzO1fOwD6RniX8PBeM4c+sEvKfDCFjCLb90Z/ /RhLlJPf82Vr5IwBnfM2fFmz6Z3R9f6z8V1a9BbSI24e9t2gYdwkQoU366QevRBGghi7UKFTxhN rr7taLRTX0jKdiu2wagvJkjcL+kUd4k833yAZ8CifH7+krXu2+EF2TA3C/H8f1mlRtHMcqdLPf+ ABY31yY/LjnqBVBVlLqXlAqpxSY7+RypSEZqkg5DM+Adnq/IPd1bVWE8z8xAa1 X-Google-Smtp-Source: AGHT+IGeZ/56Kw0pYVv8+CnEg/77ax55wBWg9bL/NuFDuvt1iPfufw8e5f5Vblw9CSOVruXL3ibjCQ== X-Received: by 2002:a05:600c:1e85:b0:471:13dd:bae7 with SMTP id 5b1f17b1804b1-47d84b38604mr106952265e9.30.1767940521304; Thu, 08 Jan 2026 22:35:21 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 2/4] docs/devel/loads-stores: Fix ld/stn_*_p() regexp Date: Fri, 9 Jan 2026 07:35:02 +0100 Message-ID: <20260109063504.71576-3-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260109063504.71576-1-philmd@linaro.org> References: <20260109063504.71576-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=philmd@linaro.org; helo=mail-wm1-x329.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1767940595733158500 Fixes: afa4f6653dc ("bswap: Add stn_*_p() and ldn_*_p() functions") Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- docs/devel/loads-stores.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/devel/loads-stores.rst b/docs/devel/loads-stores.rst index fc78def0612..3582814c580 100644 --- a/docs/devel/loads-stores.rst +++ b/docs/devel/loads-stores.rst @@ -52,12 +52,12 @@ files which are built per-target. =20 There are also functions which take the size as an argument: =20 -load: ``ldn{endian}_p(ptr, sz)`` +load: ``ldn_{endian}_p(ptr, sz)`` =20 which performs an unsigned load of ``sz`` bytes from ``ptr`` as an ``{endian}`` order value and returns it in a uint64_t. =20 -store: ``stn{endian}_p(ptr, sz, val)`` +store: ``stn_{endian}_p(ptr, sz, val)`` =20 which stores ``val`` to ``ptr`` as an ``{endian}`` order value of size ``sz`` bytes. @@ -67,8 +67,8 @@ Regexes for git grep -G: - ``\`` - ``\`` - ``\`` - - ``\`` - - ``\`` + - ``\`` + - ``\`` =20 ``cpu_{ld,st}*_mmu`` ~~~~~~~~~~~~~~~~~~~~ --=20 2.52.0 From nobody Mon Feb 9 06:28:12 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1767940571; cv=none; d=zohomail.com; s=zohoarc; b=L6/LwNOOqCDB+sXJ46MI4CS6rgdlZlaSeNH0J3wl6VETk/YdMENpOdfNLVK53FUKHSfE4l7VThMpaNAvqWPYCo7ZAHr003cOghH3igl2MG+by5+QC3A0D1n9Kyk8GxU37PgFN1yXhqUUeHKj5YH24cq5Ya8j3ifpn7tGrW+PZsY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1767940571; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=T+J5mIPS+jOoqnBN8dMAKPf18ftseLrzM2fMBdN6b1I=; b=dpdegbj3i+YVlFErdAQTVgHqy4nmvf2vuCwlPUbfKLN++lMbL20JuiMSKb3xSQXz7RJjEhnisT5PhhHBP8RbNBMZjngmnY0zLPjNcNjRCiqG7haUuwBKHU9v3YQHd5mq0/+6NueFOJ3wllQGJrX5SgyZgzXE0VrFlEWDvPN+hVE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 176794057185974.6987590263285; Thu, 8 Jan 2026 22:36:11 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ve65x-00021R-7w; Fri, 09 Jan 2026 01:35:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ve65s-00020w-HM for qemu-devel@nongnu.org; Fri, 09 Jan 2026 01:35:33 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ve65q-0007Nb-DY for qemu-devel@nongnu.org; Fri, 09 Jan 2026 01:35:32 -0500 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-47a95efd2ceso35307575e9.2 for ; Thu, 08 Jan 2026 22:35:30 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47d8718c610sm54550455e9.15.2026.01.08.22.35.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 08 Jan 2026 22:35:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1767940529; x=1768545329; darn=nongnu.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=T+J5mIPS+jOoqnBN8dMAKPf18ftseLrzM2fMBdN6b1I=; b=MjLiCyLo6jV4098iuOydRY3bWzpa/bExt2Hxa6yPoeOohSEeoVZp1KSB7ejJI5NLhz zojotOdQ24ightJIOP5dMzMC9AXVWlm5HJaitv3O7/NofZGzgfOwqgNORtdPgvyev2di L0mzeLQVdxOnrMk7VnrasEYOsVWtdVu4LKOKfDNrFzpqLxnckmZNiTu4xPhFkoHevdiK Gi1Okw7/MtX6mkoZCgJt1IAXqE0AU3Zabdt9Xf8JjDmWXxjENHTapBzGEKVacnk1FypJ IzOIc2vQ0+o6zWTWz91y2Oyw5DoEAGvjOms3RjnM4nxKPa7Z99B/6pM6N1TU9DlDNpwZ C7xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767940529; x=1768545329; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=T+J5mIPS+jOoqnBN8dMAKPf18ftseLrzM2fMBdN6b1I=; b=VbkTmpsSd00Ucbida8P+jVWPQ9nCsHzoHdhVahwuSa7w4rFIFSwBmRoRcW/c83TcFl Aq7Pxfifca6cPu8+eUvrBL2kzHp9rlOejklzWeXm1ExYhULKI4Zo8PaEycSm231xsKFm 1y1lBj+jV70P5rEn78PCZLqjZ17jo7zm8WV4DiQtYmixiVSyqkgRukPcwTGTPf3otLwW O8c5JaoFpMyWAhVsqFzdri558mdvpM8Ys3Va3YjayTj50Bhgd/s3L3he26ToYTp3I8w0 UGnITmNqigO+0OpY6CXIr+6BgBA/Jd+i8VdJnDyQAxNiuBh9X58TZEmdVgPN/hXGyaET dT/w== X-Gm-Message-State: AOJu0YzJQE86pnr+6X3aHX+37lNAHWfaWsVxT+lMLHX/8mKIY7z9DSiS 13kVvRQleAvq/Y/SuANrBNYRaLIztIXzaY+rfxuksPu8+5pT+t+EvUOQS0q1vQCFj4ehCp9W6mz 5iHfb7G4= X-Gm-Gg: AY/fxX6uRLPDIlwqjuIMuosVgU4ODXODEhg5ThFzu8OCdj1SZ5Kwk71Dub1v7prUG6k /Fo+y8BGFob/uMcemN/fTKWML54HkZY6VPKfFQ67Eb7Ho1VIgF0xRYwSV+ltoPBCvnIrn7l+ryW aZt53zbDkd9vk9dte+quncotTqiHaDIt8w7FkAxsFpcappRRxJifRjOzB9FyfK21Rnq+RxKfWvj Tfp0bfh/qnRPVL4VJXME+rxYXsF/FFMNstF1iIR4Ek5dE4EkNj7fUmXY0pwFr1qOd4szvP7mati wyjMUpCVQPJcwMNJJRp1D0Rx55YEwkgCuxAvSDNDabREGwZv1wWqj0zn7J2aBr9BMCIp9b7MV2i RjL3TKlw6YyfNCq7Ig0erxm340lLr2sGceFlnHAKmIGmSCaxW0FycJ6yC3LeUv/1elhJZlLIHco 2d8ZAZRKeuXun++suXOuCwYqCS6j7B11HTYwzcvjx2OWzWcVSDjhgtW14im+OF X-Google-Smtp-Source: AGHT+IEAUeSmNz0nV9uLT8W7iQw/ofFYJWxeU28ichZTS1aqLyfrQXVAUX5ofjuyOCqmZM5NnoiY1g== X-Received: by 2002:a05:600c:4747:b0:47b:da85:b9ef with SMTP id 5b1f17b1804b1-47d84b18a7dmr121215555e9.16.1767940528564; Thu, 08 Jan 2026 22:35:28 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , BALATON Zoltan , Elena Ufimtseva , Jagannathan Raman , "Michael S. Tsirkin" , Alexander Graf , Phil Dennis-Jordan , Peter Xu , Jason Wang , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-ppc@nongnu.org Subject: [PATCH v2 3/4] system/memory: Extract 'qemu/ldst_unaligned.h' header Date: Fri, 9 Jan 2026 07:35:03 +0100 Message-ID: <20260109063504.71576-4-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260109063504.71576-1-philmd@linaro.org> References: <20260109063504.71576-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1767940573899158500 Unaligned memcpy API is buried within 'qemu/bswap.h', supposed to be related to endianness swapping. Extract to a new header to clarify. Suggested-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: BALATON Zoltan Reviewed-by: Richard Henderson --- MAINTAINERS | 1 + include/qemu/bswap.h | 62 +------------------------------- include/qemu/ldst_unaligned.h | 67 +++++++++++++++++++++++++++++++++++ accel/tcg/translator.c | 1 + hw/display/ati_2d.c | 1 + hw/display/sm501.c | 2 +- hw/remote/vfio-user-obj.c | 1 + hw/vmapple/virtio-blk.c | 1 + net/checksum.c | 1 + ui/vnc-enc-tight.c | 1 + util/bufferiszero.c | 2 +- 11 files changed, 77 insertions(+), 63 deletions(-) create mode 100644 include/qemu/ldst_unaligned.h diff --git a/MAINTAINERS b/MAINTAINERS index 9a55b649e8b..6602c9891db 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3257,6 +3257,7 @@ R: Philippe Mathieu-Daud=C3=A9 S: Supported F: include/system/ioport.h F: include/exec/memop.h +F: include/qemu/ldst_unaligned.h F: include/system/ram_addr.h F: include/system/memory.h F: include/system/physmem.h diff --git a/include/qemu/bswap.h b/include/qemu/bswap.h index 39ba64046a6..e70452b425a 100644 --- a/include/qemu/bswap.h +++ b/include/qemu/bswap.h @@ -1,6 +1,7 @@ #ifndef BSWAP_H #define BSWAP_H =20 +#include "qemu/ldst_unaligned.h" #include "qemu/target-info.h" =20 #undef bswap16 @@ -173,8 +174,6 @@ CPU_CONVERT(le, 64, uint64_t) # define const_le16(_x) (_x) #endif =20 -/* unaligned/endian-independent pointer access */ - /* * the generic syntax is: * @@ -201,7 +200,6 @@ CPU_CONVERT(le, 64, uint64_t) * q: 64 bits * * endian is: - * he : host endian * be : big endian * le : little endian * te : target endian @@ -237,64 +235,6 @@ static inline void stb_p(void *ptr, uint8_t v) *(uint8_t *)ptr =3D v; } =20 -/* - * Any compiler worth its salt will turn these memcpy into native unaligned - * operations. Thus we don't need to play games with packed attributes, or - * inline byte-by-byte stores. - * Some compilation environments (eg some fortify-source implementations) - * may intercept memcpy() in a way that defeats the compiler optimization, - * though, so we use __builtin_memcpy() to give ourselves the best chance - * of good performance. - */ - -static inline int lduw_he_p(const void *ptr) -{ - uint16_t r; - __builtin_memcpy(&r, ptr, sizeof(r)); - return r; -} - -static inline int ldsw_he_p(const void *ptr) -{ - int16_t r; - __builtin_memcpy(&r, ptr, sizeof(r)); - return r; -} - -static inline void stw_he_p(void *ptr, uint16_t v) -{ - __builtin_memcpy(ptr, &v, sizeof(v)); -} - -static inline void st24_he_p(void *ptr, uint32_t v) -{ - __builtin_memcpy(ptr, &v, 3); -} - -static inline int ldl_he_p(const void *ptr) -{ - int32_t r; - __builtin_memcpy(&r, ptr, sizeof(r)); - return r; -} - -static inline void stl_he_p(void *ptr, uint32_t v) -{ - __builtin_memcpy(ptr, &v, sizeof(v)); -} - -static inline uint64_t ldq_he_p(const void *ptr) -{ - uint64_t r; - __builtin_memcpy(&r, ptr, sizeof(r)); - return r; -} - -static inline void stq_he_p(void *ptr, uint64_t v) -{ - __builtin_memcpy(ptr, &v, sizeof(v)); -} - static inline int lduw_le_p(const void *ptr) { return (uint16_t)le_bswap(lduw_he_p(ptr), 16); diff --git a/include/qemu/ldst_unaligned.h b/include/qemu/ldst_unaligned.h new file mode 100644 index 00000000000..201e32d0734 --- /dev/null +++ b/include/qemu/ldst_unaligned.h @@ -0,0 +1,67 @@ +/* + * QEMU unaligned/endian-independent host pointer access + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ +#ifndef QEMU_LDST_UNALIGNED_H +#define QEMU_LDST_UNALIGNED_H + +/* + * Any compiler worth its salt will turn these memcpy into native unaligned + * operations. Thus we don't need to play games with packed attributes, or + * inline byte-by-byte stores. + * Some compilation environments (eg some fortify-source implementations) + * may intercept memcpy() in a way that defeats the compiler optimization, + * though, so we use __builtin_memcpy() to give ourselves the best chance + * of good performance. + */ + +static inline int lduw_he_p(const void *ptr) +{ + uint16_t r; + __builtin_memcpy(&r, ptr, sizeof(r)); + return r; +} + +static inline int ldsw_he_p(const void *ptr) +{ + int16_t r; + __builtin_memcpy(&r, ptr, sizeof(r)); + return r; +} + +static inline void stw_he_p(void *ptr, uint16_t v) +{ + __builtin_memcpy(ptr, &v, sizeof(v)); +} + +static inline void st24_he_p(void *ptr, uint32_t v) +{ + __builtin_memcpy(ptr, &v, 3); +} + +static inline int ldl_he_p(const void *ptr) +{ + int32_t r; + __builtin_memcpy(&r, ptr, sizeof(r)); + return r; +} + +static inline void stl_he_p(void *ptr, uint32_t v) +{ + __builtin_memcpy(ptr, &v, sizeof(v)); +} + +static inline uint64_t ldq_he_p(const void *ptr) +{ + uint64_t r; + __builtin_memcpy(&r, ptr, sizeof(r)); + return r; +} + +static inline void stq_he_p(void *ptr, uint64_t v) +{ + __builtin_memcpy(ptr, &v, sizeof(v)); +} + +#endif diff --git a/accel/tcg/translator.c b/accel/tcg/translator.c index 034f2f359ef..d767e5dff24 100644 --- a/accel/tcg/translator.c +++ b/accel/tcg/translator.c @@ -9,6 +9,7 @@ =20 #include "qemu/osdep.h" #include "qemu/bswap.h" +#include "qemu/ldst_unaligned.h" #include "qemu/log.h" #include "qemu/error-report.h" #include "accel/tcg/cpu-ldst-common.h" diff --git a/hw/display/ati_2d.c b/hw/display/ati_2d.c index 309bb5ccb6c..08f722cd63e 100644 --- a/hw/display/ati_2d.c +++ b/hw/display/ati_2d.c @@ -10,6 +10,7 @@ #include "qemu/osdep.h" #include "ati_int.h" #include "ati_regs.h" +#include "qemu/ldst_unaligned.h" #include "qemu/log.h" #include "ui/pixel_ops.h" #include "ui/console.h" diff --git a/hw/display/sm501.c b/hw/display/sm501.c index a07aa9886f9..1c38b17b04c 100644 --- a/hw/display/sm501.c +++ b/hw/display/sm501.c @@ -28,6 +28,7 @@ #include "qapi/error.h" #include "qemu/error-report.h" #include "qemu/log.h" +#include "qemu/ldst_unaligned.h" #include "qemu/module.h" #include "hw/usb/hcd-ohci.h" #include "hw/char/serial-mm.h" @@ -40,7 +41,6 @@ #include "hw/display/i2c-ddc.h" #include "qemu/range.h" #include "ui/pixel_ops.h" -#include "qemu/bswap.h" #include "trace.h" #include "qom/object.h" =20 diff --git a/hw/remote/vfio-user-obj.c b/hw/remote/vfio-user-obj.c index 4eb036a5469..8d99b78245d 100644 --- a/hw/remote/vfio-user-obj.c +++ b/hw/remote/vfio-user-obj.c @@ -49,6 +49,7 @@ #include "qapi/error.h" #include "qapi/qapi-visit-sockets.h" #include "qapi/qapi-events-misc.h" +#include "qemu/ldst_unaligned.h" #include "qemu/notify.h" #include "qemu/thread.h" #include "qemu/main-loop.h" diff --git a/hw/vmapple/virtio-blk.c b/hw/vmapple/virtio-blk.c index 9de9aaae0bf..3acb29eea88 100644 --- a/hw/vmapple/virtio-blk.c +++ b/hw/vmapple/virtio-blk.c @@ -19,6 +19,7 @@ #include "hw/vmapple/vmapple.h" #include "hw/virtio/virtio-blk.h" #include "hw/virtio/virtio-pci.h" +#include "qemu/ldst_unaligned.h" #include "qemu/log.h" #include "qemu/module.h" #include "qapi/error.h" diff --git a/net/checksum.c b/net/checksum.c index 537457d89d0..ea55b468060 100644 --- a/net/checksum.c +++ b/net/checksum.c @@ -16,6 +16,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/ldst_unaligned.h" #include "net/checksum.h" #include "net/eth.h" =20 diff --git a/ui/vnc-enc-tight.c b/ui/vnc-enc-tight.c index 9dfe6ae5a24..78ac7a2eacc 100644 --- a/ui/vnc-enc-tight.c +++ b/ui/vnc-enc-tight.c @@ -42,6 +42,7 @@ #include #endif =20 +#include "qemu/ldst_unaligned.h" #include "qemu/bswap.h" #include "vnc.h" #include "vnc-enc-tight.h" diff --git a/util/bufferiszero.c b/util/bufferiszero.c index 522146dab97..ca38606032d 100644 --- a/util/bufferiszero.c +++ b/util/bufferiszero.c @@ -23,7 +23,7 @@ */ #include "qemu/osdep.h" #include "qemu/cutils.h" -#include "qemu/bswap.h" +#include "qemu/ldst_unaligned.h" #include "host/cpuinfo.h" =20 typedef bool (*biz_accel_fn)(const void *, size_t); --=20 2.52.0 From nobody Mon Feb 9 06:28:12 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1767940567; cv=none; d=zohomail.com; s=zohoarc; b=DNgs67hGbvX4spDpe6zJF7OHqzLLucqa1ySRlb21wNBZNAZHQWBOfWuLIYi9oT3emD0i6crkaP2tKQ9SOIZvo0G8VESx5y5ZEEvPB9uFYlstoZOP1jz1Z8h2CwQJmvyGCQxChYTsj02XGyyxp4NTEK85SlR320xoP1d3cjd7KnI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1767940567; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=NeH0QpT/0zOGE77kvIWm/QtqUPhGnAr2X/Dda2LE5sk=; b=NvuzYhK4Jbw2ySyZ+u0xtEsSrlSPNNTAvfhz+loLmv6VeS5b6RTFGaFommnDv1ZJzdBX+lrywC4Kabi9/6knPEej4lFR+5pFXpP7MdGovxiJNiK+NAXd++mk9Pkwxxw/rtqXZTAEnP1gc+KYuyFq2cRdbB5K8ZMveM7f3kux7cE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1767940567765711.0833249983126; Thu, 8 Jan 2026 22:36:07 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ve669-000253-L6; Fri, 09 Jan 2026 01:35:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ve664-00022h-54 for qemu-devel@nongnu.org; Fri, 09 Jan 2026 01:35:45 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ve660-0007OH-0j for qemu-devel@nongnu.org; Fri, 09 Jan 2026 01:35:42 -0500 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-4779cc419b2so34076265e9.3 for ; Thu, 08 Jan 2026 22:35:38 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47d8636c610sm54776085e9.0.2026.01.08.22.35.35 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 08 Jan 2026 22:35:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1767940537; x=1768545337; darn=nongnu.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=NeH0QpT/0zOGE77kvIWm/QtqUPhGnAr2X/Dda2LE5sk=; b=issl074JgnPcUC71BxnadUMC0pJeMCirrWv2EQzu0IYSCp68wK7eXSor/N9oTCkeIl tKmshRmdi9JtIwqT+tLm+1Tzgg8gDxfPz73sSR00bg5Y2t3J69OCVGzf3e6PxSUvm4nd CpFFXzYxG6XKTlxT7mFwSZmNhKa0uOCddEcr7jtbqNDi6i0OOXz17gNgmG85sZwm+jk8 6qtd+ER43MVGzX8x0OsOomvekf/eZEYJbP5wD3VQx/NSu/fJZAEwDrXgNhEb7OryWp/c TjvGcFVt+zMvoVn0BU/IlqVihjIPavfHuk4smlnj15lVgxrqo1Kl4vb3zlyRaXJV9Awl eYIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767940537; x=1768545337; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=NeH0QpT/0zOGE77kvIWm/QtqUPhGnAr2X/Dda2LE5sk=; b=K4FgdrBNsJxxpqupQoawxoFIjO1w8ZP2yyzrf2v1qfjvDxOS3tC1jiAapUKaNGRkMB vGfCzgi/xrRds9P1TeRXrlK6j+Ry6ofmksszSN4wpqU1VVQa58mAhquTjOY44ZYevJW9 5KSBFce6nPk75fF4d53IuwpSePYJMUuvIsZwTFP18pzlzTCCcY+EuJx47X1mA1xTngWQ 0iPaP1zdp1KLdNJZpcOF20ho0SHyUxBsw3nosp9/nGdTSQIlT/jk5ZdK8Rxc6NWtaATl EflqTPnQc1uemQ04F2NYTcxpWVj9pBEYcxHrnuSGpTvZt0gGzHbt9sFuwGMdSwttw6Au QP/g== X-Gm-Message-State: AOJu0YwbbtsR/Pt+Jsy+a+A3ACkgA6y+WZnwH/Y4Rk/MpTjTznHXp0RI FcERhI7TQT+Voe8lHS9aba0rWXxBmwOCsNae+ClvSeR6d06+0Z8G+cRizFoN/dvVisN7hlEo1Rj fbeyC7r4= X-Gm-Gg: AY/fxX5PtL6f4Lg0ldROsQpWskslsjwcRz/dZNwKn+NKgZ/GIMEQqkIWGOySvBwwahk Dh8IErYxWcYcriqXk1k7OxxSIR8ekUUayEBrPJP/LENbfj4KWODRubfJ2IEenkyIqcQEuPhnezk 0cIw9ga1e3IFAXSSOY8S/R1u5L1oFHrCJ3gB73z5WMVXujrDuADlYKiHR02n9UC9ity+TiZEpIL CRpVzgTEdedLN2UQjp4kNmo4YmxTt1wJap3O/B8BTHLC8+p+x2lM3Xx5bMvIItiVrRodiB3SYmq GWkK3l7d+6d+xQk772bhZjwGkpyX6lcWJojiBFEdFKS1XF6OPu/s2/uQEk4O+/zmHGVv4WTVknY Ur1/oe3TT88ukMiBdnmUBywqih5sLKlpT1WtO3eFhShMqRHEJDyPSXyi+mZf0XYX/hZPIpFmkFy hjQbdKWqWwThI5AsJiqBPswGZYYOEo3Kq2r2zAUeKAcPMlaPTQq9e4TfzoN3pC X-Google-Smtp-Source: AGHT+IHLSrhuD1cZzrK6WoucFJf0ozMGTX6PaJXDGTeKGvZF4nk36YWALO7MhvedCYU0fc2t77P5Qw== X-Received: by 2002:a05:600c:3b90:b0:471:9da:5248 with SMTP id 5b1f17b1804b1-47d84b39890mr96653655e9.26.1767940537029; Thu, 08 Jan 2026 22:35:37 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , BALATON Zoltan , Elena Ufimtseva , Jagannathan Raman , Alexander Graf , Phil Dennis-Jordan , "Michael S. Tsirkin" , Peter Xu , Jason Wang , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-ppc@nongnu.org Subject: [PATCH v2 4/4] system/memory: Rename unaligned load/store API Date: Fri, 9 Jan 2026 07:35:04 +0100 Message-ID: <20260109063504.71576-5-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260109063504.71576-1-philmd@linaro.org> References: <20260109063504.71576-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1767940570502158500 Rename the API methods using the explicit 'unaligned' description instead of 'he' which stands for 'host endianness'. Inspired-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- docs/devel/loads-stores.rst | 19 +++++++++---------- include/qemu/bswap.h | 34 +++++++++++++++++----------------- include/qemu/ldst_unaligned.h | 16 ++++++++-------- accel/tcg/translator.c | 6 +++--- hw/display/ati_2d.c | 2 +- hw/display/sm501.c | 19 +++++++++++-------- hw/remote/vfio-user-obj.c | 4 ++-- hw/vmapple/virtio-blk.c | 2 +- net/checksum.c | 6 +++--- system/memory.c | 4 ++-- system/physmem.c | 8 ++++---- ui/vnc-enc-tight.c | 2 +- util/bufferiszero.c | 6 +++--- accel/tcg/ldst_atomicity.c.inc | 10 +++++----- 14 files changed, 70 insertions(+), 68 deletions(-) diff --git a/docs/devel/loads-stores.rst b/docs/devel/loads-stores.rst index 3582814c580..cb6f73b0b13 100644 --- a/docs/devel/loads-stores.rst +++ b/docs/devel/loads-stores.rst @@ -24,9 +24,9 @@ potentially unaligned pointer values. =20 Function names follow the pattern: =20 -load: ``ld{sign}{size}_{endian}_p(ptr)`` +load: ``ld{sign}{size}_{unaligned|endian}_p(ptr)`` =20 -store: ``st{size}_{endian}_p(ptr, val)`` +store: ``st{size}_{unaligned|endian}_p(ptr, val)`` =20 ``sign`` - (empty) : for 32 or 64 bit sizes @@ -41,7 +41,6 @@ store: ``st{size}_{endian}_p(ptr, val)`` - ``q`` : 64 bits =20 ``endian`` - - ``he`` : host endian - ``be`` : big endian - ``le`` : little endian =20 @@ -52,23 +51,23 @@ files which are built per-target. =20 There are also functions which take the size as an argument: =20 -load: ``ldn_{endian}_p(ptr, sz)`` +load: ``ldn_{unaligned|endian}_p(ptr, sz)`` =20 which performs an unsigned load of ``sz`` bytes from ``ptr`` as an ``{endian}`` order value and returns it in a uint64_t. =20 -store: ``stn_{endian}_p(ptr, sz, val)`` +store: ``stn_{unaligned|endian}_p(ptr, sz, val)`` =20 which stores ``val`` to ``ptr`` as an ``{endian}`` order value of size ``sz`` bytes. =20 =20 Regexes for git grep -G: - - ``\`` - - ``\`` - - ``\`` - - ``\`` - - ``\`` + - ``\`` + - ``\`` + - ``\`` + - ``\`` + - ``\`` =20 ``cpu_{ld,st}*_mmu`` ~~~~~~~~~~~~~~~~~~~~ diff --git a/include/qemu/bswap.h b/include/qemu/bswap.h index e70452b425a..dc31d48fd13 100644 --- a/include/qemu/bswap.h +++ b/include/qemu/bswap.h @@ -237,82 +237,82 @@ static inline void stb_p(void *ptr, uint8_t v) =20 static inline int lduw_le_p(const void *ptr) { - return (uint16_t)le_bswap(lduw_he_p(ptr), 16); + return (uint16_t)le_bswap(lduw_unaligned_p(ptr), 16); } =20 static inline int ldsw_le_p(const void *ptr) { - return (int16_t)le_bswap(lduw_he_p(ptr), 16); + return (int16_t)le_bswap(lduw_unaligned_p(ptr), 16); } =20 static inline int ldl_le_p(const void *ptr) { - return le_bswap(ldl_he_p(ptr), 32); + return le_bswap(ldl_unaligned_p(ptr), 32); } =20 static inline uint64_t ldq_le_p(const void *ptr) { - return le_bswap(ldq_he_p(ptr), 64); + return le_bswap(ldq_unaligned_p(ptr), 64); } =20 static inline void stw_le_p(void *ptr, uint16_t v) { - stw_he_p(ptr, le_bswap(v, 16)); + stw_unaligned_p(ptr, le_bswap(v, 16)); } =20 static inline void st24_le_p(void *ptr, uint32_t v) { - st24_he_p(ptr, le_bswap24(v)); + st24_unaligned_p(ptr, le_bswap24(v)); } =20 static inline void stl_le_p(void *ptr, uint32_t v) { - stl_he_p(ptr, le_bswap(v, 32)); + stl_unaligned_p(ptr, le_bswap(v, 32)); } =20 static inline void stq_le_p(void *ptr, uint64_t v) { - stq_he_p(ptr, le_bswap(v, 64)); + stq_unaligned_p(ptr, le_bswap(v, 64)); } =20 static inline int lduw_be_p(const void *ptr) { - return (uint16_t)be_bswap(lduw_he_p(ptr), 16); + return (uint16_t)be_bswap(lduw_unaligned_p(ptr), 16); } =20 static inline int ldsw_be_p(const void *ptr) { - return (int16_t)be_bswap(lduw_he_p(ptr), 16); + return (int16_t)be_bswap(lduw_unaligned_p(ptr), 16); } =20 static inline int ldl_be_p(const void *ptr) { - return be_bswap(ldl_he_p(ptr), 32); + return be_bswap(ldl_unaligned_p(ptr), 32); } =20 static inline uint64_t ldq_be_p(const void *ptr) { - return be_bswap(ldq_he_p(ptr), 64); + return be_bswap(ldq_unaligned_p(ptr), 64); } =20 static inline void stw_be_p(void *ptr, uint16_t v) { - stw_he_p(ptr, be_bswap(v, 16)); + stw_unaligned_p(ptr, be_bswap(v, 16)); } =20 static inline void st24_be_p(void *ptr, uint32_t v) { - st24_he_p(ptr, be_bswap24(v)); + st24_unaligned_p(ptr, be_bswap24(v)); } =20 static inline void stl_be_p(void *ptr, uint32_t v) { - stl_he_p(ptr, be_bswap(v, 32)); + stl_unaligned_p(ptr, be_bswap(v, 32)); } =20 static inline void stq_be_p(void *ptr, uint64_t v) { - stq_he_p(ptr, be_bswap(v, 64)); + stq_unaligned_p(ptr, be_bswap(v, 64)); } =20 static inline unsigned long leul_to_cpu(unsigned long v) @@ -363,7 +363,7 @@ static inline unsigned long leul_to_cpu(unsigned long v) } \ } =20 -DO_STN_LDN_P(he) +DO_STN_LDN_P(unaligned) DO_STN_LDN_P(le) DO_STN_LDN_P(be) =20 diff --git a/include/qemu/ldst_unaligned.h b/include/qemu/ldst_unaligned.h index 201e32d0734..63a091ad401 100644 --- a/include/qemu/ldst_unaligned.h +++ b/include/qemu/ldst_unaligned.h @@ -16,50 +16,50 @@ * of good performance. */ =20 -static inline int lduw_he_p(const void *ptr) +static inline int lduw_unaligned_p(const void *ptr) { uint16_t r; __builtin_memcpy(&r, ptr, sizeof(r)); return r; } =20 -static inline int ldsw_he_p(const void *ptr) +static inline int ldsw_unaligned_p(const void *ptr) { int16_t r; __builtin_memcpy(&r, ptr, sizeof(r)); return r; } =20 -static inline void stw_he_p(void *ptr, uint16_t v) +static inline void stw_unaligned_p(void *ptr, uint16_t v) { __builtin_memcpy(ptr, &v, sizeof(v)); } =20 -static inline void st24_he_p(void *ptr, uint32_t v) +static inline void st24_unaligned_p(void *ptr, uint32_t v) { __builtin_memcpy(ptr, &v, 3); } =20 -static inline int ldl_he_p(const void *ptr) +static inline int ldl_unaligned_p(const void *ptr) { int32_t r; __builtin_memcpy(&r, ptr, sizeof(r)); return r; } =20 -static inline void stl_he_p(void *ptr, uint32_t v) +static inline void stl_unaligned_p(void *ptr, uint32_t v) { __builtin_memcpy(ptr, &v, sizeof(v)); } =20 -static inline uint64_t ldq_he_p(const void *ptr) +static inline uint64_t ldq_unaligned_p(const void *ptr) { uint64_t r; __builtin_memcpy(&r, ptr, sizeof(r)); return r; } =20 -static inline void stq_he_p(void *ptr, uint64_t v) +static inline void stq_unaligned_p(void *ptr, uint64_t v) { __builtin_memcpy(ptr, &v, sizeof(v)); } diff --git a/accel/tcg/translator.c b/accel/tcg/translator.c index d767e5dff24..a2ec3a35c38 100644 --- a/accel/tcg/translator.c +++ b/accel/tcg/translator.c @@ -342,14 +342,14 @@ static bool translator_ld(CPUArchState *env, DisasCon= textBase *db, case 2: if (QEMU_IS_ALIGNED(pc, 2)) { uint16_t t =3D qatomic_read((uint16_t *)host); - stw_he_p(dest, t); + stw_unaligned_p(dest, t); return true; } break; case 4: if (QEMU_IS_ALIGNED(pc, 4)) { uint32_t t =3D qatomic_read((uint32_t *)host); - stl_he_p(dest, t); + stl_unaligned_p(dest, t); return true; } break; @@ -357,7 +357,7 @@ static bool translator_ld(CPUArchState *env, DisasConte= xtBase *db, case 8: if (QEMU_IS_ALIGNED(pc, 8)) { uint64_t t =3D qatomic_read__nocheck((uint64_t *)host); - stq_he_p(dest, t); + stq_unaligned_p(dest, t); return true; } break; diff --git a/hw/display/ati_2d.c b/hw/display/ati_2d.c index 08f722cd63e..ad546f10ace 100644 --- a/hw/display/ati_2d.c +++ b/hw/display/ati_2d.c @@ -222,7 +222,7 @@ void ati_2d_blt(ATIVGAState *s) for (y =3D 0; y < s->regs.dst_height; y++) { i =3D dst_x * bypp + (dst_y + y) * dst_pitch; for (x =3D 0; x < s->regs.dst_width; x++, i +=3D bypp) { - stn_he_p(&dst_bits[i], bypp, filler); + stn_unaligned_p(&dst_bits[i], bypp, filler); } } } diff --git a/hw/display/sm501.c b/hw/display/sm501.c index 1c38b17b04c..93f6a1097cd 100644 --- a/hw/display/sm501.c +++ b/hw/display/sm501.c @@ -768,7 +768,7 @@ static void sm501_2d_operation(SM501State *s) for (y =3D 0; y < height; y++) { i =3D (dst_x + (dst_y + y) * dst_pitch) * bypp; for (x =3D 0; x < width; x++, i +=3D bypp) { - stn_he_p(&d[i], bypp, ~ldn_he_p(&d[i], bypp)); + stn_unaligned_p(&d[i], bypp, ~ldn_unaligned_p(&d[i], b= ypp)); } } } else if (!rop_mode && rop =3D=3D 0x99) { @@ -781,8 +781,9 @@ static void sm501_2d_operation(SM501State *s) i =3D (dst_x + (dst_y + y) * dst_pitch) * bypp; j =3D (src_x + (src_y + y) * src_pitch) * bypp; for (x =3D 0; x < width; x++, i +=3D bypp, j +=3D bypp) { - stn_he_p(&d[i], bypp, - ~(ldn_he_p(&sp[j], bypp) ^ ldn_he_p(&d[i], by= pp))); + stn_unaligned_p(&d[i], bypp, + ~(ldn_unaligned_p(&sp[j], bypp) + ^ ldn_unaligned_p(&d[i], bypp))); } } } else if (!rop_mode && rop =3D=3D 0xee) { @@ -795,8 +796,9 @@ static void sm501_2d_operation(SM501State *s) i =3D (dst_x + (dst_y + y) * dst_pitch) * bypp; j =3D (src_x + (src_y + y) * src_pitch) * bypp; for (x =3D 0; x < width; x++, i +=3D bypp, j +=3D bypp) { - stn_he_p(&d[i], bypp, - ldn_he_p(&sp[j], bypp) | ldn_he_p(&d[i], bypp= )); + stn_unaligned_p(&d[i], bypp, + ldn_unaligned_p(&sp[j], bypp) + | ldn_unaligned_p(&d[i], bypp)); } } } else { @@ -818,8 +820,9 @@ static void sm501_2d_operation(SM501State *s) if (width =3D=3D 1 && height =3D=3D 1) { unsigned int si =3D (src_x + src_y * src_pitch) * bypp; unsigned int di =3D (dst_x + dst_y * dst_pitch) * bypp; - stn_he_p(&s->local_mem[dst_base + di], bypp, - ldn_he_p(&s->local_mem[src_base + si], bypp)); + stn_unaligned_p(&s->local_mem[dst_base + di], bypp, + ldn_unaligned_p(&s->local_mem[src_base + s= i], + bypp)); break; } /* If reverse blit do simple check for overlaps */ @@ -917,7 +920,7 @@ static void sm501_2d_operation(SM501State *s) for (y =3D 0; y < height; y++) { i =3D (dst_x + (dst_y + y) * dst_pitch) * bypp; for (x =3D 0; x < width; x++, i +=3D bypp) { - stn_he_p(&d[i], bypp, color); + stn_unaligned_p(&d[i], bypp, color); } } } diff --git a/hw/remote/vfio-user-obj.c b/hw/remote/vfio-user-obj.c index 8d99b78245d..aa13f14949c 100644 --- a/hw/remote/vfio-user-obj.c +++ b/hw/remote/vfio-user-obj.c @@ -392,7 +392,7 @@ static int vfu_object_mr_rw(MemoryRegion *mr, uint8_t *= buf, hwaddr offset, access_size =3D memory_access_size(mr, size, offset); =20 if (is_write) { - val =3D ldn_he_p(ptr, access_size); + val =3D ldn_unaligned_p(ptr, access_size); =20 result =3D memory_region_dispatch_write(mr, offset, val, size_memop(access_size), @@ -402,7 +402,7 @@ static int vfu_object_mr_rw(MemoryRegion *mr, uint8_t *= buf, hwaddr offset, size_memop(access_size), MEMTXATTRS_UNSPECIFIED); =20 - stn_he_p(ptr, access_size, val); + stn_unaligned_p(ptr, access_size, val); } =20 if (release_lock) { diff --git a/hw/vmapple/virtio-blk.c b/hw/vmapple/virtio-blk.c index 3acb29eea88..ae4fa2cc511 100644 --- a/hw/vmapple/virtio-blk.c +++ b/hw/vmapple/virtio-blk.c @@ -79,7 +79,7 @@ static void vmapple_virtio_blk_get_config(VirtIODevice *v= dev, uint8_t *config) g_assert(dev->parent_obj.config_size >=3D endof(struct virtio_blk_conf= ig, zoned)); =20 /* Apple abuses the field for max_secure_erase_sectors as type id */ - stl_he_p(&blkcfg->max_secure_erase_sectors, dev->apple_type); + stl_unaligned_p(&blkcfg->max_secure_erase_sectors, dev->apple_type); } =20 static void vmapple_virtio_blk_class_init(ObjectClass *klass, const void *= data) diff --git a/net/checksum.c b/net/checksum.c index ea55b468060..b27f22c4da8 100644 --- a/net/checksum.c +++ b/net/checksum.c @@ -110,7 +110,7 @@ void net_checksum_calculate(void *data, int length, int= csum_flag) =20 /* Calculate IP checksum */ if (csum_flag & CSUM_IP) { - stw_he_p(&ip->ip_sum, 0); + stw_unaligned_p(&ip->ip_sum, 0); csum =3D net_raw_checksum((uint8_t *)ip, IP_HDR_GET_LEN(ip)); stw_be_p(&ip->ip_sum, csum); } @@ -142,7 +142,7 @@ void net_checksum_calculate(void *data, int length, int= csum_flag) } =20 /* Set csum to 0 */ - stw_he_p(&tcp->th_sum, 0); + stw_unaligned_p(&tcp->th_sum, 0); =20 csum =3D net_checksum_tcpudp(ip_len, ip->ip_p, (uint8_t *)&ip->ip_src, @@ -166,7 +166,7 @@ void net_checksum_calculate(void *data, int length, int= csum_flag) } =20 /* Set csum to 0 */ - stw_he_p(&udp->uh_sum, 0); + stw_unaligned_p(&udp->uh_sum, 0); =20 csum =3D net_checksum_tcpudp(ip_len, ip->ip_p, (uint8_t *)&ip->ip_src, diff --git a/system/memory.c b/system/memory.c index 4bf00d82bcf..4625cf9e5ae 100644 --- a/system/memory.c +++ b/system/memory.c @@ -1365,7 +1365,7 @@ static uint64_t memory_region_ram_device_read(void *o= paque, hwaddr addr, unsigned size) { MemoryRegion *mr =3D opaque; - uint64_t data =3D ldn_he_p(mr->ram_block->host + addr, size); + uint64_t data =3D ldn_unaligned_p(mr->ram_block->host + addr, size); =20 trace_memory_region_ram_device_read(get_cpu_index(), mr, addr, data, s= ize); =20 @@ -1379,7 +1379,7 @@ static void memory_region_ram_device_write(void *opaq= ue, hwaddr addr, =20 trace_memory_region_ram_device_write(get_cpu_index(), mr, addr, data, = size); =20 - stn_he_p(mr->ram_block->host + addr, size, data); + stn_unaligned_p(mr->ram_block->host + addr, size, data); } =20 static const MemoryRegionOps ram_device_mem_ops =3D { diff --git a/system/physmem.c b/system/physmem.c index 0105e88058d..be0c8094736 100644 --- a/system/physmem.c +++ b/system/physmem.c @@ -3275,7 +3275,7 @@ static MemTxResult flatview_write_continue_step(MemTx= Attrs attrs, =20 /* * Assure Coverity (and ourselves) that we are not going to OVERRUN - * the buffer by following ldn_he_p(). + * the buffer by following ldn_unaligned_p(). */ #ifdef QEMU_STATIC_ANALYSIS assert((*l =3D=3D 1 && len >=3D 1) || @@ -3283,7 +3283,7 @@ static MemTxResult flatview_write_continue_step(MemTx= Attrs attrs, (*l =3D=3D 4 && len >=3D 4) || (*l =3D=3D 8 && len >=3D 8)); #endif - val =3D ldn_he_p(buf, *l); + val =3D ldn_unaligned_p(buf, *l); result =3D memory_region_dispatch_write(mr, mr_addr, val, size_memop(*l), attrs); if (release_lock) { @@ -3370,7 +3370,7 @@ static MemTxResult flatview_read_continue_step(MemTxA= ttrs attrs, uint8_t *buf, =20 /* * Assure Coverity (and ourselves) that we are not going to OVERRUN - * the buffer by following stn_he_p(). + * the buffer by following stn_unaligned_p(). */ #ifdef QEMU_STATIC_ANALYSIS assert((*l =3D=3D 1 && len >=3D 1) || @@ -3378,7 +3378,7 @@ static MemTxResult flatview_read_continue_step(MemTxA= ttrs attrs, uint8_t *buf, (*l =3D=3D 4 && len >=3D 4) || (*l =3D=3D 8 && len >=3D 8)); #endif - stn_he_p(buf, *l, val); + stn_unaligned_p(buf, *l, val); =20 if (release_lock) { bql_unlock(); diff --git a/ui/vnc-enc-tight.c b/ui/vnc-enc-tight.c index 78ac7a2eacc..2f22c0057ef 100644 --- a/ui/vnc-enc-tight.c +++ b/ui/vnc-enc-tight.c @@ -912,7 +912,7 @@ static void tight_pack24(VncState *vs, uint8_t *buf, si= ze_t count, size_t *ret) } =20 while (count--) { - pix =3D ldl_he_p(buf8); + pix =3D ldl_unaligned_p(buf8); *buf++ =3D (char)(pix >> rshift); *buf++ =3D (char)(pix >> gshift); *buf++ =3D (char)(pix >> bshift); diff --git a/util/bufferiszero.c b/util/bufferiszero.c index ca38606032d..7357fe9c7f4 100644 --- a/util/bufferiszero.c +++ b/util/bufferiszero.c @@ -38,10 +38,10 @@ static bool buffer_is_zero_int_lt256(const void *buf, s= ize_t len) * the beginning and end of the buffer. */ if (unlikely(len <=3D 8)) { - return (ldl_he_p(buf) | ldl_he_p(buf + len - 4)) =3D=3D 0; + return (ldl_unaligned_p(buf) | ldl_unaligned_p(buf + len - 4)) =3D= =3D 0; } =20 - t =3D ldq_he_p(buf) | ldq_he_p(buf + len - 8); + t =3D ldq_unaligned_p(buf) | ldq_unaligned_p(buf + len - 8); p =3D QEMU_ALIGN_PTR_DOWN(buf + 8, 8); e =3D QEMU_ALIGN_PTR_DOWN(buf + len - 1, 8); =20 @@ -58,7 +58,7 @@ static bool buffer_is_zero_int_ge256(const void *buf, siz= e_t len) * Use unaligned memory access functions to handle * the beginning and end of the buffer. */ - uint64_t t =3D ldq_he_p(buf) | ldq_he_p(buf + len - 8); + uint64_t t =3D ldq_unaligned_p(buf) | ldq_unaligned_p(buf + len - 8); const uint64_t *p =3D QEMU_ALIGN_PTR_DOWN(buf + 8, 8); const uint64_t *e =3D QEMU_ALIGN_PTR_DOWN(buf + len - 1, 8); =20 diff --git a/accel/tcg/ldst_atomicity.c.inc b/accel/tcg/ldst_atomicity.c.inc index c735add2615..eeb18c716c0 100644 --- a/accel/tcg/ldst_atomicity.c.inc +++ b/accel/tcg/ldst_atomicity.c.inc @@ -415,7 +415,7 @@ static uint16_t load_atom_2(CPUState *cpu, uintptr_t ra, atmax =3D required_atomicity(cpu, pi, memop); switch (atmax) { case MO_8: - return lduw_he_p(pv); + return lduw_unaligned_p(pv); case MO_16: /* The only case remaining is MO_ATOM_WITHIN16. */ if (!HAVE_al8_fast && (pi & 3) =3D=3D 1) { @@ -512,7 +512,7 @@ static uint64_t load_atom_8(CPUState *cpu, uintptr_t ra, } switch (atmax) { case MO_8: - return ldq_he_p(pv); + return ldq_unaligned_p(pv); case MO_16: return load_atom_8_by_2(pv); case MO_32: @@ -875,7 +875,7 @@ static void store_atom_2(CPUState *cpu, uintptr_t ra, =20 atmax =3D required_atomicity(cpu, pi, memop); if (atmax =3D=3D MO_8) { - stw_he_p(pv, val); + stw_unaligned_p(pv, val); return; } =20 @@ -928,7 +928,7 @@ static void store_atom_4(CPUState *cpu, uintptr_t ra, atmax =3D required_atomicity(cpu, pi, memop); switch (atmax) { case MO_8: - stl_he_p(pv, val); + stl_unaligned_p(pv, val); return; case MO_16: store_atom_4_by_2(pv, val); @@ -996,7 +996,7 @@ static void store_atom_8(CPUState *cpu, uintptr_t ra, atmax =3D required_atomicity(cpu, pi, memop); switch (atmax) { case MO_8: - stq_he_p(pv, val); + stq_unaligned_p(pv, val); return; case MO_16: store_atom_8_by_2(pv, val); --=20 2.52.0