From patchwork Tue Jul 13 19:24:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Klaus Jensen X-Patchwork-Id: 12374771 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5499FC07E95 for ; Tue, 13 Jul 2021 19:29:17 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 9607F6044F for ; Tue, 13 Jul 2021 19:29:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9607F6044F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=irrelevant.dk Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:36028 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3O5j-0001rK-FT for qemu-devel@archiver.kernel.org; Tue, 13 Jul 2021 15:29:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51698) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3O1G-0007Nl-8y; Tue, 13 Jul 2021 15:24:38 -0400 Received: from new4-smtp.messagingengine.com ([66.111.4.230]:48301) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3O1E-0003NL-3g; Tue, 13 Jul 2021 15:24:37 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.nyi.internal (Postfix) with ESMTP id 02ED15808A5; Tue, 13 Jul 2021 15:24:34 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Tue, 13 Jul 2021 15:24:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irrelevant.dk; h=from:to:cc:subject:date:message-id:content-type:mime-version :content-transfer-encoding; s=fm3; bh=K8m6lW/5tkPx53yhFl2kYS/nTK NP0OZ8YcKud68i4ck=; b=Yi0EIaKu/ty6x1LrPtWFxYQl4/r5jMlPmVQRy1Xkup seqwADAT7gO2FHHfL1uuKcBiVemMUKTtDbFl7kJ4lobG3UOvIxR45LQa3vCUTKOf NaVWqcnSy4dQDlCwxyiwLm1CnD8s7KVjSbqXgFbN5rasefLb/29dhLvggLHdRqPN xseupxBF293Mf3MDCI5QhR7PrKrO9rP7sMExtnulMmImL11tkqDxZPwRI2KfRmj8 yvISQW0Az+yG76xHFQ99UnxGmWEyH+RPQFEUgu0vpryhV/zLq3shYeYDZ1U0ZHlL nZW2BDeP2p/e0evT8U0eqyLgxmdIYgKf7HrBFMSZIDBg== 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=K8m6lW /5tkPx53yhFl2kYS/nTKNP0OZ8YcKud68i4ck=; b=cLA2E2MEw4LjdGeIeUXyc7 4jZhLvPT0TYSnSX0Xxh3NjbudVAhp5AEFTTdUsW71qDibFCVQjTF56AIbAQa/f/l BE6I6cvc3ClIgp/6+XbHEK8WPvzyb2Un8ICtIOXdUbf7szNLaywfGQZh/XsPzvJu 86//MEjMMS328OYwScbdEdx+RyD9So/IrClV2p2F5wZfsZwvMO4oU9afLBItpoU6 KqWE/yxpAerA9GGGz5ZsgOcQrf7Kj++P+SCFqwHM4DrYnlHattXFtokRc061Jpgz w9Xn604nLPbNBOBPjiYi+tT7enX1RUz0WqHRJbasqcazjo1lrpynLc0068h9cVXQ == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudehgdduvdehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffotggggfesthhqredtredtjeenucfhrhhomhepmfhlrghushcu lfgvnhhsvghnuceoihhtshesihhrrhgvlhgvvhgrnhhtrdgukheqnecuggftrfgrthhtvg hrnhephfegveekiefgkeevvdetjeejkeekudfgvdehieejfffgkeffvdevlefftedvgefh necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepihhtsh esihhrrhgvlhgvvhgrnhhtrdgukh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 13 Jul 2021 15:24:30 -0400 (EDT) From: Klaus Jensen To: qemu-devel@nongnu.org Subject: [PATCH v2 0/5] hw/nvme: fix mmio read Date: Tue, 13 Jul 2021 21:24:23 +0200 Message-Id: <20210713192428.950160-1-its@irrelevant.dk> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Received-SPF: pass client-ip=66.111.4.230; envelope-from=its@irrelevant.dk; helo=new4-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 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Fam Zheng , Thomas Huth , qemu-block@nongnu.org, Peter Maydell , Laurent Vivier , Klaus Jensen , Gollu Appalanaidu , Max Reitz , Keith Busch , Stefan Hajnoczi , Klaus Jensen , Paolo Bonzini Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Klaus Jensen 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. 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 | 58 +++++-- hw/nvme/ctrl.c | 366 +++++++++++++++++++++++----------------- tests/qtest/nvme-test.c | 26 +++ 3 files changed, 276 insertions(+), 174 deletions(-)