From patchwork Thu Dec 19 13:09:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Klaus Jensen X-Patchwork-Id: 11303689 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AB187138D for ; Thu, 19 Dec 2019 14:09:57 +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 7FD5920663 for ; Thu, 19 Dec 2019 14:09:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="N5EeoiAC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7FD5920663 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=samsung.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:42180 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihwV2-0005mE-6K for patchwork-qemu-devel@patchwork.kernel.org; Thu, 19 Dec 2019 09:09:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36205) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihvZE-0001xy-7w for qemu-devel@nongnu.org; Thu, 19 Dec 2019 08:10:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihvZC-0007WX-6M for qemu-devel@nongnu.org; Thu, 19 Dec 2019 08:10:11 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:56030) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ihvZA-00077r-P0 for qemu-devel@nongnu.org; Thu, 19 Dec 2019 08:10:09 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20191219130951euoutp02d79c121f5ecc1c99efc67b0c02e90c15~hx8SFKxcM0697606976euoutp02c for ; Thu, 19 Dec 2019 13:09:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20191219130951euoutp02d79c121f5ecc1c99efc67b0c02e90c15~hx8SFKxcM0697606976euoutp02c DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1576760991; bh=JSHPvLNtx7G+B0/+Jvm7M8JS310fB0IfwpO9b9Vnmdo=; h=From:To:CC:Subject:Date:In-Reply-To:References:From; b=N5EeoiACuLaBRL3eLzgwW+Y55c76YykIofgsHgm7heNJVp0EXwaOJZFZp+b9RB1l1 fkFVM3jOixOY+3GkTeV1dyRv5f37E+80dnzoq5dvcN9xKC3GxXutcvdJRObcj3Elwh Nj/LyZuQWCa23PDskGv0bkxAyB1L++bdMuc5d30A= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20191219130951eucas1p27f1a357b37fca17752489632d9411629~hx8R4Tur11986019860eucas1p2U; Thu, 19 Dec 2019 13:09:51 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id C5.00.61286.F967BFD5; Thu, 19 Dec 2019 13:09:51 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20191219130950eucas1p14932d144e3e12fb98a6ec685cf616701~hx8RjpczZ1260812608eucas1p1q; Thu, 19 Dec 2019 13:09:50 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20191219130950eusmtrp2ad69a17dfc74bb9cc10555ace1ea1dac~hx8RjHPy03120131201eusmtrp2g; Thu, 19 Dec 2019 13:09:50 +0000 (GMT) X-AuditID: cbfec7f2-ef1ff7000001ef66-80-5dfb769f1e74 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 80.5D.08375.E967BFD5; Thu, 19 Dec 2019 13:09:50 +0000 (GMT) Received: from CAMSVWEXC01.scsc.local (unknown [106.1.227.71]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20191219130950eusmtip2284512c395b6cfc6cdb45d33ad71d3ea~hx8RcSxrT3240732407eusmtip28; Thu, 19 Dec 2019 13:09:50 +0000 (GMT) Received: from CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01:e347) by CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01:e347) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Thu, 19 Dec 2019 13:09:50 +0000 Received: from apples.local (106.110.32.41) by CAMSVWEXC01.scsc.local (106.1.227.71) with Microsoft SMTP Server id 15.0.1320.4 via Frontend Transport; Thu, 19 Dec 2019 13:09:49 +0000 From: Klaus Jensen To: Subject: [PATCH v4 24/24] nvme: make lba data size configurable Date: Thu, 19 Dec 2019 14:09:21 +0100 Message-ID: <20191219130921.309264-25-k.jensen@samsung.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191219130921.309264-1-k.jensen@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA01SbUhTYRjl3d2ud6PJdQo+aSHMDBPSpIhFUoYFI1AK/0mrpt6muU3b3NSC sDRnhtP8o5uRoqJhOND5sdmQvIXDL8TSJdMySmgVmrNWiSvbdif575znOec854WXwASNnCgi X1lMqZRSuRDnsQfHNmcOt2i3JEe8s7jIXKdDogbagUQds5TosTNWZFzT4SJ7rYWdiov7uu/j 4iWHDRevOMws8beRefwCO4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kcHMIC 9hLvFmuB1LAIqEoc3nWHCcTmFbCWmHllHxvEanmJrd8+sYLYnEDxLb23wc4TErCSePzzIwtE vaDEyZlPwGxmoPrmrbOZIWwJiYMvXjBPYBSehaRsFpKyWUjKFjAyr2IUSS0tzk3PLTbUK07M LS7NS9dLzs/dxAiMsG3Hfm7ewXhpY/AhRgEORiUe3pfJv2OFWBPLiitzDzFKcDArifDe7vgZ K8SbklhZlVqUH19UmpNafIjRFOi5icxSosn5wOjPK4k3NDU0t7A0NDc2NzazUBLn7RA4GCMk kJ5YkpqdmlqQWgTTx8TBKdXAOPXmtCmGT/mffWaT9/TvMBHvmXmpuHvKRr51b1bbnFvR1+IQ No399P3bW9qt3/HfufTk5UGjd6fUPL0bfAXnmjfa3fBkTXQsal+xb1tRXeLllNYjSr/eSntF T7dsvuS0cc9y2+sHv6aXWlz6dauM00/4+Pzd82MtlxlsK3mbsOHB/buHL6Y9ZFJiKc5INNRi LipOBAA0SgTyxgIAAA== X-CMS-MailID: 20191219130950eucas1p14932d144e3e12fb98a6ec685cf616701 X-Msg-Generator: CA X-RootMTR: 20191219130950eucas1p14932d144e3e12fb98a6ec685cf616701 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20191219130950eucas1p14932d144e3e12fb98a6ec685cf616701 References: <20191219130921.309264-1-k.jensen@samsung.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 210.118.77.12 X-Mailman-Approved-At: Thu, 19 Dec 2019 08:56:47 -0500 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 , Beata Michalska , qemu-devel@nongnu.org, Max Reitz , Keith Busch , Javier Gonzalez Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Klaus Jensen --- hw/block/nvme-ns.c | 2 +- hw/block/nvme-ns.h | 4 +++- hw/block/nvme.c | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/block/nvme-ns.c b/hw/block/nvme-ns.c index 36deedee07a6..dc7e63b01037 100644 --- a/hw/block/nvme-ns.c +++ b/hw/block/nvme-ns.c @@ -18,7 +18,7 @@ static int nvme_ns_init(NvmeNamespace *ns) { NvmeIdNs *id_ns = &ns->id_ns; - id_ns->lbaf[0].ds = BDRV_SECTOR_BITS; + id_ns->lbaf[0].ds = ns->params.lbads; id_ns->nuse = id_ns->ncap = id_ns->nsze = cpu_to_le64(nvme_ns_nlbas(ns)); diff --git a/hw/block/nvme-ns.h b/hw/block/nvme-ns.h index b564bac25f6d..f1fe4db78b41 100644 --- a/hw/block/nvme-ns.h +++ b/hw/block/nvme-ns.h @@ -7,10 +7,12 @@ #define DEFINE_NVME_NS_PROPERTIES(_state, _props) \ DEFINE_PROP_DRIVE("drive", _state, blk), \ - DEFINE_PROP_UINT32("nsid", _state, _props.nsid, 0) + DEFINE_PROP_UINT32("nsid", _state, _props.nsid, 0), \ + DEFINE_PROP_UINT8("lbads", _state, _props.lbads, BDRV_SECTOR_BITS) typedef struct NvmeNamespaceParams { uint32_t nsid; + uint8_t lbads; } NvmeNamespaceParams; typedef struct NvmeNamespace { diff --git a/hw/block/nvme.c b/hw/block/nvme.c index 0ebb9aabbeb2..a7d32b230ad7 100644 --- a/hw/block/nvme.c +++ b/hw/block/nvme.c @@ -2605,6 +2605,7 @@ static void nvme_realize(PCIDevice *pci_dev, Error **errp) if (n->namespace.blk) { ns = &n->namespace; ns->params.nsid = 1; + ns->params.lbads = BDRV_SECTOR_BITS; if (nvme_ns_setup(n, ns, &local_err)) { error_propagate_prepend(errp, local_err, "nvme_ns_setup: ");