From patchwork Mon Nov 23 06:59:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Klaus Jensen X-Patchwork-Id: 1404644 Return-Path: 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=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=irrelevant.dk 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=fm1 header.b=Tn9yM92f; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm1 header.b=i/fRNhRV; 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 4CfdPs3wKLz9sSf for ; Mon, 23 Nov 2020 18:02:25 +1100 (AEDT) Received: from localhost ([::1]:36298 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kh5rj-0005Ln-Ee for incoming@patchwork.ozlabs.org; Mon, 23 Nov 2020 02:02:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52952) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kh5p3-0005JP-8Z; Mon, 23 Nov 2020 01:59:37 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:33219) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kh5p0-00072m-8q; Mon, 23 Nov 2020 01:59:37 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 08AC35C00E4; Mon, 23 Nov 2020 01:59:31 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 23 Nov 2020 01:59:31 -0500 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=fm1; bh=ZUgSVPSEd0z/S/wWgNvnXe7xw1 fAhtdtCISV/MSawpU=; b=Tn9yM92fsKlu/JWDEHTrMmy8jSJUvQsrHihWb6tMzG 7Ha2AgUiZSkeVxst4+5tp2b0Lt1do3+1hadTCm8yqxrp6vn2TF9aSVRty8K7YQPa y5KFgB1547H1ZPyaES5M0oToBtwtjiLN7Sz0gT54yiZqpXcqkDVEzmrbS0ORrdlw FzX4fNrX3u5YadUbu+GzHqur2iLfZARyTuh6IaZXkYTGeytYSnGu3ehqzcKHWMb4 GRCgpN5xPURrJoL8K01JK9AKxz4A/phpvcQw6QnGTMgGMEtvACiP0+FYKt4lHcSx BwgF/SkK54pTDVDnFS+f4hGW5Acfpn9mcZXMk1nY9PRA== 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=fm1; bh=ZUgSVP SEd0z/S/wWgNvnXe7xw1fAhtdtCISV/MSawpU=; b=i/fRNhRVVNPIJV81s85Jdd 1KkZOGMGDLMkIUMtruxRbQ52q1GW69VEbeLAff8giO1NwhfjSEojkYI2+XGhcXcF IL+gujyrOIuSgcDxBWkSHaFh6+7EwU4sSr+vIkmZ+0uDwdEyK988lqWrt8x9Gazk iJEJ8XPobBO0kD+uWZMDm/mPOeyhj2LdxYkUkOAGybKqRTC8qrZQKEn6sE1EWn9f dvgnHaAvaaf7PPijSaKSklVbO90dccaqdneXMzpcIn80ZMFtLHu8PYju49H7Jr74 N6EjSW/D4iHCjJujxY0qep1HpQ8jn1BeJ2X1o/B2xnbbc5bjt7Mxf3RqhgsUknDw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrudeghedgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffotggggfesthhqredtredtjeenucfhrhhomhepmfhlrghushcu lfgvnhhsvghnuceoihhtshesihhrrhgvlhgvvhgrnhhtrdgukheqnecuggftrfgrthhtvg hrnhepveetleefgeekhfelkedvffduleefvdefgeejjeehfeevtdeulefhudetgffgtdfg necuffhomhgrihhnpehkvghrnhgvlhdrohhrghenucfkphepkedtrdduieejrdelkedrud eltdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehi thhssehirhhrvghlvghvrghnthdrughk X-ME-Proxy: Received: from apples.local (80-167-98-190-cable.dk.customer.tdc.net [80.167.98.190]) by mail.messagingengine.com (Postfix) with ESMTPA id 2AD113280064; Mon, 23 Nov 2020 01:59:29 -0500 (EST) From: Klaus Jensen To: qemu-devel@nongnu.org Subject: [PATCH 0/3] hw/block/nvme: allow cmb and pmr to coexist Date: Mon, 23 Nov 2020 07:59:24 +0100 Message-Id: <20201123065927.108923-1-its@irrelevant.dk> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Received-SPF: pass client-ip=66.111.4.28; envelope-from=its@irrelevant.dk; helo=out4-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.01, RCVD_IN_MSPIKE_WL=-0.01, 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 , qemu-block@nongnu.org, Klaus Jensen , Max Reitz , Klaus Jensen , Andrzej Jakowski , Keith Busch Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Klaus Jensen This is a resurrection of Andrzej's series[1] from back July. Andrzej's main patch basically moved the the CMB from BAR 2 into an offset in BAR 4 (located after the MSI-X table and PBA). Having an offset on the CMB causes a bunch of calculations related to address mapping to change. So, since I couldn't get the patch to apply cleanly I took a stab at implementing the suggestion I originally came up with: simply move the MSI-X table and PBA from BAR 4 into BAR 0 (up-aligned to a 4 KiB boundary, after the main NVMe controller registers). This way we can keep the CMB at offset zero in its own BAR and free up BAR 4 for use by PMR. This makes the patch simpler and does not impact any of the existing address mapping code. Andrzej, I would prefer an Ack from you, since I pretty much voided your main patch. [1]: https://lore.kernel.org/qemu-devel/20200729220107.37758-1-andrzej.jakowski@linux.intel.com/ CC: Andrzej Jakowski Andrzej Jakowski (1): hw/block/nvme: indicate CMB support through controller capabilities register Klaus Jensen (2): hw/block/nvme: move msix table and pba to BAR 0 hw/block/nvme: allow cmb and pmr to coexist hw/block/nvme.h | 1 + include/block/nvme.h | 10 +++++++--- hw/block/nvme.c | 42 +++++++++++++++++++++++++++++++----------- 3 files changed, 39 insertions(+), 14 deletions(-)