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 5D623C07E95 for ; Mon, 19 Jul 2021 22:50:48 +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 059D16100C for ; Mon, 19 Jul 2021 22:50:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 059D16100C 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]:42954 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m5c61-000318-Ru for qemu-devel@archiver.kernel.org; Mon, 19 Jul 2021 18:50:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43098) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5c2L-0000Ie-VQ; Mon, 19 Jul 2021 18:46:57 -0400 Received: from new1-smtp.messagingengine.com ([66.111.4.221]:43211) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5c2K-0005K4-2i; Mon, 19 Jul 2021 18:46:57 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.nyi.internal (Postfix) with ESMTP id 50BA4580A64; Mon, 19 Jul 2021 18:46:54 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Mon, 19 Jul 2021 18:46:54 -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=XTUs60lT3stFI+YkMgVa6AzY8p PlKe9aVeGM98bNywM=; b=W8dcLrHKvO9AQLPXTkHcmZkcJNEZTIt1L8MGsFBKB5 Od8+OW9LspgrLaheTjmR/DjXqRbRDsHtBEvbCiZ4inpgjc66NS3N5Qpo7x8KK9WF zFHS4QIKN4xRSZazklfwvPKV6nFBrv1VFgmWnDpftObfYdOn4pgrOiZtrYC97rDY 0FWaV39zWKMKbHFbZQ+yHkIK87o1dfUpVUifp02ER4BtbitX3ZcMjV1PYPx4mZ8B 1gj9id6n1Nl+91srJtlwvpY2qusPlofkFog0gmtVksJfsgH+7sc6wulqzAkbq9OR 86v+RtGphjWBPFFWinqLdF+b0U/5war5zGDBAnjUnxNw== 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=XTUs60 lT3stFI+YkMgVa6AzY8pPlKe9aVeGM98bNywM=; b=h5C0hrpTNUZqmBhsy5wSuw ewqAIfpBBLzG1xPk0QepuaQLjAnAZlfsvLJS9ZtquaXGTKtl7E6B99GDq8coNOHP AiDjXC0vDEe3YaiWJm5P6dUwI0Pzn2ZzW/R2l34SLngT8jYDeQEJ4Xliwp6g79Qz 3HJC1+K8CQ8jPrA3f5hcCA7o++pN4tDPMJjKmcniZZe1KPTIA1L+OdjFWrI++wR+ cWhe02ifctPMfYa9zq/FXEn/cD6zcxRXSZnos9uOMuxcgYTl+0w/Wb9aMNiQhmZ0 Y8Jcde1jYM8CpfB54LNwLrL6AkbmFjRwJ1kIw6s253MBgR+TFuyJmNfumueGg/NA == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrfedugddtkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofggtgfgsehtqhertdertdejnecuhfhrohhmpefmlhgruhhsucfl vghnshgvnhcuoehithhssehirhhrvghlvghvrghnthdrughkqeenucggtffrrghtthgvrh hnpeefudehfedugffhuddttefffeeluedttdetgfduleduuddugfeuhfelueeuuefggfen ucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehithhsse hirhhrvghlvghvrghnthdrughk X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 19 Jul 2021 18:46:50 -0400 (EDT) From: Klaus Jensen To: qemu-devel@nongnu.org Subject: [PATCH v5 0/5] hw/nvme: fix mmio read Date: Tue, 20 Jul 2021 00:46:42 +0200 Message-Id: <20210719224647.68559-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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Peter Maydell , Thomas Huth , qemu-block@nongnu.org, Laurent Vivier , Klaus Jensen , Gollu Appalanaidu , Max Reitz , Klaus Jensen , Stefan Hajnoczi , Keith Busch , Paolo Bonzini , Kevin Wolf , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Klaus Jensen =0D Fix mmio read issues on big-endian hosts. The core issue is that values=0D in the BAR is not stored in little endian as required.=0D =0D Fix that and add a regression test for this. This required a bit of=0D cleanup, so it blew up into a series.=0D =0D v5:=0D * "hw/nvme: fix mmio read"=0D - Hurried the changes a bit. Fixed.=0D =0D v4:=0D * "hw/nvme: split pmrmsc register into upper and lower"=0D - Fix missing left-shift (Peter)=0D =0D * "hw/nvme: fix mmio read"=0D - Remove unnecessary masking (Peter)=0D - Keep existing behaviour and do not zero the register fields doing=0D initialization (Peter)=0D =0D v3:=0D =0D * "hw/nvme: use symbolic names for registers"=0D Use offsetof(NvmeBar, reg) instead of explicit offsets (Philippe)=0D =0D * "hw/nvme: fix mmio read"=0D Use the st/ld API instead of cpu_to_X (Philippe)=0D =0D Klaus Jensen (5):=0D hw/nvme: split pmrmsc register into upper and lower=0D hw/nvme: use symbolic names for registers=0D hw/nvme: fix out-of-bounds reads=0D hw/nvme: fix mmio read=0D tests/qtest/nvme-test: add mmio read test=0D =0D include/block/nvme.h | 60 +++++--=0D hw/nvme/ctrl.c | 352 ++++++++++++++++++++++------------------=0D tests/qtest/nvme-test.c | 26 +++=0D 3 files changed, 265 insertions(+), 173 deletions(-)=0D =0D -- =0D 2.32.0=0D =0D