Message ID | 20210719200733.28502-1-its@irrelevant.dk |
---|---|
Headers | show
Return-Path: <qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=irrelevant.dk header.i=@irrelevant.dk header.a=rsa-sha256 header.s=fm3 header.b=dwAGjQJA; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=CURnhIl4; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 4GTCsQ3sC7z9sS8 for <incoming@patchwork.ozlabs.org>; Tue, 20 Jul 2021 06:20:57 +1000 (AEST) Received: from localhost ([::1]:47324 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>) id 1m5Zl1-0004bs-4l for incoming@patchwork.ozlabs.org; Mon, 19 Jul 2021 16:20:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48834) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <its@irrelevant.dk>) id 1m5ZYF-00014S-N1; Mon, 19 Jul 2021 16:07:43 -0400 Received: from new1-smtp.messagingengine.com ([66.111.4.221]:37305) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <its@irrelevant.dk>) id 1m5ZYD-0001U6-BU; Mon, 19 Jul 2021 16:07:43 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailnew.nyi.internal (Postfix) with ESMTP id 6B41C58165C; Mon, 19 Jul 2021 16:07:39 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Mon, 19 Jul 2021 16:07:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irrelevant.dk; h=from:to:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=fm3; bh=GTZ4EFcE18KimFQmsUxbae3nfz mykYr1HT9wDwZ+NO0=; b=dwAGjQJAJ9gVpJ9BmXDSmZ3Fj9Exqny1Szbf553BsA LD64/fVJHoNoTMIl6fp6HWGS5a4qxKGubtAJnSYgOuGzJkRgruVbdfGk+cS4AdvQ vOOQTHUj5wyjM1F5xFQ2U1aKMmdQXahQI6KSNBTtVsar2YFt0SNF/x588J/mlc2C PmwI58/uxfglLU/X7cDuZxqC2nGmfVvPT7emNqgMOGGyrWTzf0Hny6VJ5u+ZVPqM VDI5EZd5T8wVk0ENumP8iWA6MovPVSGZXcejuIeyN3/KOrq9GZyFwthaB0C7x60B g8PRJfOnTfS1HRdutoSL61IKPhMyNEnl9otWoKM/G49w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=GTZ4EF cE18KimFQmsUxbae3nfzmykYr1HT9wDwZ+NO0=; b=CURnhIl4IWacD0NNHoVdKv hWNj0CEVtq+Qe7enYpfOTnpS+Y5P/QVTp5ndOSmSvf6BaJ/d8Tc8I5qPvI8KMZ7z nER657kckPphYrF+bUsB/SbQu0uqIAF97i6Hr6omFHacZCcXBFs9/Lt5Y5qEyRBT hsLxYCATu+jjhDU6E0i7ucBAmqdOqMFkFZzaCJr1ibUa5ndC/gEfpRp+iRM6eUI4 b3onsS4bqvibwz02R6A+VBzU6GNJFPHqB85jJvlyVZ80pfskvBAsFYqpZ3KjCPxs vphCIk7PyWxuIwpmELfnF1KRYdWSJSGVjiyO/WWE9mRoQDYdIGJ0fRcz34Ha0CXQ == X-ME-Sender: <xms:itv1YN20eKZERMU63rFUtW4pjrsi2-5v5d78EQTjImd4pfCbN4IVag> <xme:itv1YEGslf1n2L2ziTiz5TXBIZrCyksoqR8iT620GPW2ie315iPiXnqsiWzYU98qA __5Tyz9k0fzwmIXmtA> X-ME-Received: <xmr:itv1YN4VyZLsOotlO8qwzthF2ZQ5uNpq9xt1Q-FtkVDdXiY4Qa34DFR2Cjs9_Ou-LWm0cj34jcQnktiyB63_CwDmw6hnmXcH-lV5rIcpyA> X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrfedtgddugedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffogggtgfesthhqredtredtjeenucfhrhhomhepmfhlrghushcu lfgvnhhsvghnuceoihhtshesihhrrhgvlhgvvhgrnhhtrdgukheqnecuggftrfgrthhtvg hrnhepfeduheefudfghfdutdetffefleeutddttefgudeludduudfguefhleeuueeugffg necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepihhtsh esihhrrhgvlhgvvhgrnhhtrdgukh X-ME-Proxy: <xmx:itv1YK0vzxrNwN5FrL6b_zDCJLtr7jRqfT0Yx6RacTJxhd8QhPCmgg> <xmx:itv1YAF_zMTQYLzpmkYickJP_cERY0xEGYIYsdTR8XMoh0Oh7K6Hjg> <xmx:itv1YL-V__h2h-XJULcs0pwzSWyvoFUAbiW_SRSE-GLr0scud2AXuQ> <xmx:i9v1YEH2Tpn9pL5L4VNn4bn8f-FlttuVmyiiqnJuNuh4h1mvElTisQ> Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 19 Jul 2021 16:07:36 -0400 (EDT) From: Klaus Jensen <its@irrelevant.dk> To: qemu-devel@nongnu.org Subject: [PATCH v4 0/5] hw/nvme: fix mmio read Date: Mon, 19 Jul 2021 22:07:28 +0200 Message-Id: <20210719200733.28502-1-its@irrelevant.dk> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=66.111.4.221; envelope-from=its@irrelevant.dk; helo=new1-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, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-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.23 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: Laurent Vivier <lvivier@redhat.com>, Peter Maydell <peter.maydell@linaro.org>, Thomas Huth <thuth@redhat.com>, qemu-block@nongnu.org, Klaus Jensen <k.jensen@samsung.com>, Gollu Appalanaidu <anaidu.gollu@samsung.com>, Max Reitz <mreitz@redhat.com>, Klaus Jensen <its@irrelevant.dk>, Stefan Hajnoczi <stefanha@redhat.com>, Keith Busch <kbusch@kernel.org>, Paolo Bonzini <pbonzini@redhat.com>, Fam Zheng <fam@euphon.net>, Kevin Wolf <kwolf@redhat.com>, =?utf-8?q?Philip?= =?utf-8?q?pe_Mathieu-Daud=C3=A9?= <philmd@redhat.com> Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org> |
Series | hw/nvme: fix mmio read | expand |
From: Klaus Jensen <k.jensen@samsung.com> Fix mmio read issues on big-endian hosts. The core issue is that values in the BAR is not stored in little endian as required. Fix that and add a regression test for this. This required a bit of cleanup, so it blew up into a series. v4: * "hw/nvme: split pmrmsc register into upper and lower" - Fix missing left-shift (Peter) * "hw/nvme: fix mmio read" - Remove unnecessary masking (Peter) - Keep existing behaviour and do not zero the register fields doing initialization (Peter) v3: * "hw/nvme: use symbolic names for registers" Use offsetof(NvmeBar, reg) instead of explicit offsets (Philippe) * "hw/nvme: fix mmio read" Use the st/ld API instead of cpu_to_X (Philippe) Klaus Jensen (5): hw/nvme: split pmrmsc register into upper and lower hw/nvme: use symbolic names for registers hw/nvme: fix out-of-bounds reads hw/nvme: fix mmio read tests/qtest/nvme-test: add mmio read test include/block/nvme.h | 60 +++++-- hw/nvme/ctrl.c | 352 ++++++++++++++++++++++------------------ tests/qtest/nvme-test.c | 26 +++ 3 files changed, 265 insertions(+), 173 deletions(-)