From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37204) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xvtuh-0007Ga-8V for qemu-devel@nongnu.org; Tue, 02 Dec 2014 15:19:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xvtub-0003RX-JD for qemu-devel@nongnu.org; Tue, 02 Dec 2014 15:19:11 -0500 Received: from mail-wg0-x22a.google.com ([2a00:1450:400c:c00::22a]:53577) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xvtub-0003RK-Dh for qemu-devel@nongnu.org; Tue, 02 Dec 2014 15:19:05 -0500 Received: by mail-wg0-f42.google.com with SMTP id z12so18055793wgg.1 for ; Tue, 02 Dec 2014 12:19:03 -0800 (PST) Sender: Paolo Bonzini Message-ID: <547E1EB3.2090601@redhat.com> Date: Tue, 02 Dec 2014 21:18:59 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <20141127143921.3485a93d@kryten> In-Reply-To: <20141127143921.3485a93d@kryten> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] nvme: 64kB page size fixes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anton Blanchard , Keith Busch , Kevin Wolf , Stefan Hajnoczi Cc: qemu-devel@nongnu.org On 27/11/2014 04:39, Anton Blanchard wrote: > Initialise our maximum page size capability to 64kB and increase > the page_size variable from 16 to 32 bits. > > Signed-off-by: Anton Blanchard > -- > > diff --git a/hw/block/nvme.c b/hw/block/nvme.c > index 1327658..aa1ed98 100644 > --- a/hw/block/nvme.c > +++ b/hw/block/nvme.c > @@ -811,6 +811,7 @@ static int nvme_init(PCIDevice *pci_dev) > NVME_CAP_SET_AMS(n->bar.cap, 1); > NVME_CAP_SET_TO(n->bar.cap, 0xf); > NVME_CAP_SET_CSS(n->bar.cap, 1); > + NVME_CAP_SET_MPSMAX(n->bar.cap, 4); > > n->bar.vs = 0x00010001; > n->bar.intmc = n->bar.intms = 0; > diff --git a/hw/block/nvme.h b/hw/block/nvme.h > index 993c511..b6ccb65 100644 > --- a/hw/block/nvme.h > +++ b/hw/block/nvme.h > @@ -688,7 +688,7 @@ typedef struct NvmeCtrl { > NvmeBar bar; > BlockConf conf; > > - uint16_t page_size; > + uint32_t page_size; > uint16_t page_bits; > uint16_t max_prp_ents; > uint16_t cqe_size; > > This should probably be a property of the device instead. If you want to change the default, you need to preserve a backwards-compatible value for pre-2.3 machine types (-M pc-i440fx-2.2, -M pc-i440fx-2.1 etc.). Paolo