From mboxrd@z Thu Jan 1 00:00:00 1970 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.gnu.org (lists.gnu.org [209.51.188.17]) (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 52B49EB64DC for ; Thu, 20 Jul 2023 08:56:09 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qMPRk-0006ik-Dk; Thu, 20 Jul 2023 04:55:40 -0400 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 1qMPRi-0006hu-97; Thu, 20 Jul 2023 04:55:38 -0400 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qMPRg-0004XE-Ao; Thu, 20 Jul 2023 04:55:37 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 11075320243E; Thu, 20 Jul 2023 04:55:32 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Thu, 20 Jul 2023 04:55:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irrelevant.dk; h=cc:cc:content-type:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1689843332; x= 1689929732; bh=9bhb1KhdrwWvZj2Co0nCg2/He0WRIlVe/jpPT2GmYCU=; b=P ykhCuMNdSnZKvjzB+Rgw6hUH1/L+hKON1TlhjDbGsXqiooS8sd0CLysad9Zcth1G dK5GGq7uzi97rwy9gYNvfStSpFGvHh5vsVs4SfRQRIw5/ZiOkeKrM7rQ265cGyp0 Wd05Ccixsjq841RCn1lYGH6ek6DHL3WGK602iKgFFSxpg624iaiBjo/wiR0y+TJK VWgZMTs6tBfT1F7Q/V38qRUEgsxyzKj3ljlLfi9cj5p87B2dGqqoOs5GU3Dr6tqA lxZUCz378ey5j9ycJgmzdE4sA+wuNnP7PgDdTQ02/wJQZ1NHqfHbgLKpcO9mFepm ybLM7B5TYiWDCepMylYhw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1689843332; x=1689929732; bh=9bhb1KhdrwWvZ j2Co0nCg2/He0WRIlVe/jpPT2GmYCU=; b=on/3B0PX8vBPt3iUkQM0szfPGA7k6 0RhGZkSV/RKmVieYe2c+EhjKzVMTDA4XyfEIZYhYqzqKdPe2UKlUoImHIMTLdhTP zD3fVtFNEpIwbHbq7qX2ltRODyG0U7kfYK5toYhPwG1ZSaDEZ/ZTqhqV3ZdZYlgq F3ilOkwLGTdF7q+dceo67mij1g931Ej6KHjv+lpMOqAIBdCd2ll55sB7qf7z8yQC FoZM5LOHFh2ERvETPordQzCQSvgLCDHKl0jw7io9dYsau/DhBpwqbkWz6TmXe/9o hvjuPPRCR6TdEr3AUzjZyMQ3AtWYBU4+vXbJW/UqicqI3P33e0MTRyRGQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrhedtgddtlecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfhfgggtuggjsehgtderredttdejnecuhfhrohhmpefmlhgruhhs ucflvghnshgvnhcuoehithhssehirhhrvghlvghvrghnthdrughkqeenucggtffrrghtth gvrhhnpeffuddvhfehjedugfeijeeuieelgeevuddvlefhkefhgfettefftddvkeevieel feenucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepihhtshesihhrrhgvlhgvvhgrnhhtrdgukh X-ME-Proxy: Feedback-ID: idc91472f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 20 Jul 2023 04:55:30 -0400 (EDT) Date: Thu, 20 Jul 2023 10:55:28 +0200 From: Klaus Jensen To: Peter Maydell Cc: Michael Tokarev , qemu-devel@nongnu.org, Stefan Hajnoczi , Keith Busch , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Hanna Reitz , Kevin Wolf , qemu-block@nongnu.org, Fam Zheng , Klaus Jensen , qemu-stable@nongnu.org, Thomas Huth , =?utf-8?Q?C=C3=A9dric?= Le Goater Subject: Re: [PULL 1/1] hw/nvme: fix endianness issue for shadow doorbells Message-ID: References: <20230719073605.98222-3-its@irrelevant.dk> <20230719073605.98222-4-its@irrelevant.dk> <437f0e05-f052-cb78-418f-054378c6ae68@tls.msk.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="B7RTa1C57hXLz3IK" Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=64.147.123.25; envelope-from=its@irrelevant.dk; helo=wout2-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org --B7RTa1C57hXLz3IK Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Jul 20 09:51, Peter Maydell wrote: > On Thu, 20 Jul 2023 at 09:49, Klaus Jensen wrote: > > > > On Jul 20 09:43, Peter Maydell wrote: > > > On Wed, 19 Jul 2023 at 21:13, Michael Tokarev wrote: > > > > > > > > 19.07.2023 10:36, Klaus Jensen wrote: > > > > pu(req->cmd.dptr.prp2); > > > > > + uint32_t v; > > > > > > > > > if (sq) { > > > > > + v =3D cpu_to_le32(sq->tail); > > > > > > > > > - pci_dma_write(pci, sq->db_addr, &sq->tail, sizeof(sq= ->tail)); > > > > > + pci_dma_write(pci, sq->db_addr, &v, sizeof(sq->tail)= ); > > > > > > > > This and similar cases hurts my eyes. > > > > > > > > Why we pass address of v here, but use sizeof(sq->tail) ? > > > > > > > > Yes, I know both in theory should be of the same size, but heck, > > > > this is puzzling at best, and confusing in a regular case. > > > > > > > > Dunno how it slipped in the review, it instantly catched my eye > > > > in a row of applied patches.. > > > > > > > > Also, why v is computed a few lines before it is used, with > > > > some expressions between the assignment and usage? > > > > > > > > How about the following patch: > > > > > > If you're going to change this, better to take the approach > > > Philippe suggested in review of using stl_le_pci_dma(). > > > > > > https://lore.kernel.org/qemu-devel/376e5e45-a3e7-0029-603a-b7ad9673fa= c4@linaro.org/ > > > > > > > Yup, that was my plan for next. But the original patch was already > > verified on hardware and mutiple testes, so wanted to go with that for > > the "fix". > > > > But yes, I will refactor into the much nicer stl/ldl api. >=20 > FWIW, I don't think this bug fix was so urgent that we > needed to go with a quick fix and a followup -- we're > not yet that close to 8.1 release. >=20 Alright, noted ;) I will spin this into the other fix I have under review. --B7RTa1C57hXLz3IK Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEUigzqnXi3OaiR2bATeGvMW1PDekFAmS49oAACgkQTeGvMW1P DemeqAf9FZT84mAQ22KFLTcmSi5JaSU23R+2XrDBFvjq8Fg07KZv7wbAKwfaMsJL AfZ0dmepD8DoglMaLuZGUBBEYrC+HQy3+vXC1i3CxdwWwCYqiywRl7P4+KX7G5+h 6kTE82AHEHGQI4PlrDVgyMXrfOuDoymseiKEIOLIq4jBS/+Tiwl1uNaG73WDDuZj C5EK8XaP/NfVbDbrWo4Ubw+mWQlBLotVxfIUIPF8u2Zz2PRGbUrk5ozi7jXjMhfg nqZ4KIDjrB+4hWha9adiJb/k8O7gLkfdKNGlM2bHM93qafGf07a08rw4tBhhZQzT eNX9r8ZznqQoMydsQfwFZMkRFDuGQg== =1VME -----END PGP SIGNATURE----- --B7RTa1C57hXLz3IK--