- 29 6月, 2021 2 次提交
-
-
由 Heinrich Schuchardt 提交于
The EUI-64 field is the only identifier for NVMe namespaces in UEFI device paths. Add a new namespace property "eui64", that provides the user the option to specify the EUI-64. Signed-off-by: NHeinrich Schuchardt <xypron.glpk@gmx.de> Acked-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NKlaus Jensen <k.jensen@samsung.com>
-
由 Niklas Cassel 提交于
In the Zoned Namespace Command Set Specification, chapter 2.5.1 Managing resources "The controller may transition zones in the ZSIO:Implicitly Opened state to the ZSC:Closed state for resource management purposes." The word may in this sentence means that automatically transitioning an implicitly opened zone to closed is completely optional. Add a new parameter so that the user can control if this automatic transitioning should be performed or not. Being able to control this can help with verifying that e.g. a user-space program behaves properly even without this optional ZNS feature. The default value is set to true, in order to not change the existing behavior. Signed-off-by: NNiklas Cassel <niklas.cassel@wdc.com> [k.jensen: moved parameter to controller] Signed-off-by: NKlaus Jensen <k.jensen@samsung.com>
-
- 17 5月, 2021 8 次提交
-
-
由 Klaus Jensen 提交于
With the introduction of the nvme-subsystem device we are really cluttering up the hw/block directory. As suggested by Philippe previously, move the nvme emulation to hw/nvme. Suggested-by: NPhilippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NKeith Busch <kbusch@kernel.org>
-
由 Klaus Jensen 提交于
The NvmeCtrl num_namespaces member is just an indirection for the NVME_MAX_NAMESPACES constant. Remove the indirection. Signed-off-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NKeith Busch <kbusch@kernel.org>
-
由 Klaus Jensen 提交于
Streamline namespace array indexing such that both the subsystem and controller namespaces arrays are 1-indexed. Signed-off-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NKeith Busch <kbusch@kernel.org>
-
由 Klaus Jensen 提交于
Add an nvme_moff() helper. Signed-off-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NKeith Busch <kbusch@kernel.org>
-
由 Klaus Jensen 提交于
There is no need to look up the lba size and metadata size in the LBA Format structure everytime we want to use it. And we use it a lot. Cache the values in the NvmeNamespace and update them if the namespace is formatted. Signed-off-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NKeith Busch <kbusch@kernel.org>
-
由 Klaus Jensen 提交于
The inline nvme_ns_status() helper only has a single call site. Remove it from the header file and inline it for real. Signed-off-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NKeith Busch <kbusch@kernel.org>
-
由 Klaus Jensen 提交于
Remove non-shared defines from the shared header. Signed-off-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NKeith Busch <kbusch@kernel.org>
-
由 Klaus Jensen 提交于
In preparation for moving the nvme device into its own subtree, merge the header files into one. Also add missing copyright notice and add list of authors with substantial contributions. Signed-off-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NKeith Busch <kbusch@kernel.org>
-
- 07 4月, 2021 3 次提交
-
-
由 Klaus Jensen 提交于
Prior to this patch, if a private nvme-ns device (that is, a namespace that is not linked to a subsystem) is wired up to an nvme-subsys linked nvme controller device, the device fails to verify that the namespace id is unique within the subsystem. NVM Express v1.4b, Section 6.1.6 ("NSID and Namespace Usage") states that because the device supports Namespace Management, "NSIDs *shall* be unique within the NVM subsystem". Additionally, prior to this patch, private namespaces are not known to the subsystem and the namespace is considered exclusive to the controller with which it is initially wired up to. However, this is not the definition of a private namespace; per Section 1.6.33 ("private namespace"), a private namespace is just a namespace that does not support multipath I/O or namespace sharing, which means "that it is only able to be attached to one controller at a time". Fix this by always allocating namespaces in the subsystem (if one is linked to the controller), regardless of the shared/private status of the namespace. Whether or not the namespace is shareable is controlled by a new `shared` nvme-ns parameter. Finally, this fix allows the nvme-ns `subsys` parameter to be removed, since the `shared` parameter now serves the purpose of attaching the namespace to all controllers in the subsystem upon device realization. It is invalid to have an nvme-ns namespace device with a linked subsystem without the parent nvme controller device also being linked to one and since the nvme-ns devices will unconditionally be "attached" (in QEMU terms that is) to an nvme controller device through an NvmeBus, the nvme-ns namespace device can always get a reference to the subsystem of the controller it is explicitly (using 'bus=' parameter) or implicitly attaching to. Fixes: e5707685 ("hw/block/nvme: support for shared namespace in subsystem") Cc: Minwoo Im <minwoo.im.dev@gmail.com> Signed-off-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NGollu Appalanaidu <anaidu.gollu@samsung.com> Reviewed-by: NKeith Busch <kbusch@kernel.org> Reviewed-by: NMinwoo Im <minwoo.im.dev@gmail.com>
-
由 Klaus Jensen 提交于
Remove the unused BlockConf from the controller structure and remove the noop constraint checking. Device works just fine with both legacy drive parameter namespace and nvme-ns namespace definitions. Signed-off-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NGollu Appalanaidu <anaidu.gollu@samsung.com>
-
由 Klaus Jensen 提交于
Add the missing nvme_adm_opc_str entry for the Namespace Attachment command. Signed-off-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NGollu Appalanaidu <anaidu.gollu@samsung.com> Reviewed-by: NKeith Busch <kbusch@kernel.org>
-
- 18 3月, 2021 5 次提交
-
-
由 Minwoo Im 提交于
Format NVM admin command can make a namespace or namespaces to be with different LBA size and metadata size with protection information types. This patch introduces Format NVM command with LBA format, Metadata, and Protection Information for the device. The secure erase operation things and support for formatting zoned namespaces are yet to be added. The parameter checks inside of this patch has been referred from Keith's old branch. Signed-off-by: NMinwoo Im <minwoo.im@samsung.com> [anaidu.gollu: rebased on e2e] Signed-off-by: NGollu Appalanaidu <anaidu.gollu@samsung.com> [k.jensen: rebased for reworked aio tracking] Signed-off-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NKeith Busch <kbusch@kernel.org>
-
由 Klaus Jensen 提交于
Verify is not subject to MDTS, so a single Verify command may result in excessive amounts of allocated memory. Impose a limit on the data size by adding support for TP 4040 ("Non-MDTS Command Size Limits"). Signed-off-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NKeith Busch <kbusch@kernel.org>
-
由 Gollu Appalanaidu 提交于
See NVM Express 1.4, section 6.14 ("Verify Command"). Signed-off-by: NGollu Appalanaidu <anaidu.gollu@samsung.com> [k.jensen: rebased, refactored for e2e] Signed-off-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NKeith Busch <kbusch@kernel.org>
-
由 Klaus Jensen 提交于
Add support for namespaces formatted with protection information. The type of end-to-end data protection (i.e. Type 1, Type 2 or Type 3) is selected with the `pi` nvme-ns device parameter. If the number of metadata bytes is larger than 8, the `pil` nvme-ns device parameter may be used to control the location of the 8-byte DIF tuple. The default `pil` value of '0', causes the DIF tuple to be transferred as the last 8 bytes of the metadata. Set to 1 to store this in the first eight bytes instead. Co-authored-by: NGollu Appalanaidu <anaidu.gollu@samsung.com> Signed-off-by: NGollu Appalanaidu <anaidu.gollu@samsung.com> Signed-off-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NKeith Busch <kbusch@kernel.org>
-
由 Klaus Jensen 提交于
Coverity complains about a possible memory corruption in the nvme_ns_attach and _detach functions. While we should not (famous last words) be able to reach this function without nsid having previously been validated, this is still an open door for future misuse. Make Coverity and maintainers happy by asserting that the index into the array is valid. Also, while not detected by Coverity (yet), add an assert in nvme_subsys_ns and nvme_subsys_register_ns as well since a similar issue is exists there. Fixes: 037953b5 ("hw/block/nvme: support namespace detach") Fixes: CID 1450757 Fixes: CID 1450758 Cc: Minwoo Im <minwoo.im.dev@gmail.com> Signed-off-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NPhilippe Mathieu-Daudé <philmd@redhat.com>
-
- 09 3月, 2021 10 次提交
-
-
由 Minwoo Im 提交于
If namespace inventory is changed due to some reasons (e.g., namespace attachment/detachment), controller can send out event notifier to the host to manage namespaces. This patch sends out the AEN to the host after either attach or detach namespaces from controllers. To support clear of the event from the controller, this patch also implemented Get Log Page command for Changed Namespace List log type. To return namespace id list through the command, when namespace inventory is updated, id is added to the per-controller list (changed_ns_list). To indicate the support of this async event, this patch set OAES(Optional Asynchronous Events Supported) in Identify Controller data structure. Signed-off-by: NMinwoo Im <minwoo.im.dev@gmail.com> Reviewed-by: NKeith Busch <kbusch@kernel.org> Reviewed-by: NKlaus Jensen <k.jensen@samsung.com> Tested-by: NKlaus Jensen <k.jensen@samsung.com> Signed-off-by: NKlaus Jensen <k.jensen@samsung.com>
-
由 Minwoo Im 提交于
This patch supports Namespace Attachment command for the pre-defined nvme-ns device nodes. Of course, attach/detach namespace should only be supported in case 'subsys' is given. This is because if we detach a namespace from a controller, somebody needs to manage the detached, but allocated namespace in the NVMe subsystem. As command effect for the namespace attachment command is registered, the host will be notified that namespace inventory is changed so that host will rescan the namespace inventory after this command. For example, kernel driver manages this command effect via passthru IOCTL. Signed-off-by: NMinwoo Im <minwoo.im.dev@gmail.com> Reviewed-by: NKeith Busch <kbusch@kernel.org> Reviewed-by: NKlaus Jensen <k.jensen@samsung.com> Tested-by: NKlaus Jensen <k.jensen@samsung.com> [k.jensen: rebased for dma refactor] Signed-off-by: NKlaus Jensen <k.jensen@samsung.com>
-
由 Minwoo Im 提交于
Expand allocated namespace list (subsys->namespaces) to have 256 entries which is a value lager than at least NVME_MAX_NAMESPACES which is for attached namespace list in a controller. Allocated namespace list should at least larger than attached namespace list. n->num_namespaces = NVME_MAX_NAMESPACES; The above line will set the NN field by id->nn so that the subsystem should also prepare at least this number of namespace list entries. Signed-off-by: NMinwoo Im <minwoo.im.dev@gmail.com> Reviewed-by: NKeith Busch <kbusch@kernel.org> Reviewed-by: NKlaus Jensen <k.jensen@samsung.com> Tested-by: NKlaus Jensen <k.jensen@samsung.com> Signed-off-by: NKlaus Jensen <k.jensen@samsung.com>
-
由 Minwoo Im 提交于
Given that now we have nvme-subsys device supported, we can manage namespace allocated, but not attached: detached. This patch introduced a parameter for nvme-ns device named 'detached'. This parameter indicates whether the given namespace device is detached from a entire NVMe subsystem('subsys' given case, shared namespace) or a controller('bus' given case, private namespace). - Allocated namespace 1) Shared ns in the subsystem 'subsys0': -device nvme-ns,id=ns1,drive=blknvme0,nsid=1,subsys=subsys0,detached=true 2) Private ns for the controller 'nvme0' of the subsystem 'subsys0': -device nvme-subsys,id=subsys0 -device nvme,serial=foo,id=nvme0,subsys=subsys0 -device nvme-ns,id=ns1,drive=blknvme0,nsid=1,bus=nvme0,detached=true 3) (Invalid case) Controller 'nvme0' has no subsystem to manage ns: -device nvme,serial=foo,id=nvme0 -device nvme-ns,id=ns1,drive=blknvme0,nsid=1,bus=nvme0,detached=true Signed-off-by: NMinwoo Im <minwoo.im.dev@gmail.com> Reviewed-by: NKeith Busch <kbusch@kernel.org> Signed-off-by: NKlaus Jensen <k.jensen@samsung.com>
-
由 Klaus Jensen 提交于
Introduce NvmeSg and try to deal with that pesky qsg/iov duality that haunts all the memory-related functions. Signed-off-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NKeith Busch <kbusch@kernel.org>
-
由 Gollu Appalanaidu 提交于
Dataset Management is not subject to MDTS, but exceeded a certain size per range causes internal looping. Report this limit (DMRSL) in the NVM command set specific identify controller data structure. Signed-off-by: NGollu Appalanaidu <anaidu.gollu@samsung.com> Signed-off-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NKeith Busch <kbusch@kernel.org>
-
由 Klaus Jensen 提交于
ZASL (Zone Append Size Limit) is defined exactly like MDTS (Maximum Data Transfer Size), that is, it is a value in units of the minimum memory page size (CAP.MPSMIN) and is reported as a power of two. The 'mdts' nvme device parameter is specified as in the spec, but the 'zoned.append_size_limit' parameter is specified in bytes. This is suboptimal for a number of reasons: 1. It is just plain confusing wrt. the definition of mdts. 2. There is a lot of complexity involved in validating the value; it must be a power of two, it should be larger than 4k, if it is zero we set it internally to mdts, but still report it as zero. 3. While "hw/block/nvme: improve invalid zasl value reporting" slightly improved the handling of the parameter, the validation is still wrong; it does not depend on CC.MPS, it depends on CAP.MPSMIN. And we are not even checking that it is actually less than or equal to MDTS, which is kinda the *one* condition it must satisfy. Fix this by defining zasl exactly like mdts and checking the one thing that it must satisfy (that it is less than or equal to mdts). Also, change the default value from 128KiB to 0 (aka, whatever mdts is). Signed-off-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NKeith Busch <kbusch@kernel.org>
-
由 Klaus Jensen 提交于
Add support for TP 4065a ("Simple Copy Command"), v2020.05.04 ("Ratified"). The implementation uses a bounce buffer to first read in the source logical blocks, then issue a write of that bounce buffer. The default maximum number of source logical blocks is 128, translating to 512 KiB for 4k logical blocks which aligns with the default value of MDTS. Signed-off-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NKeith Busch <kbusch@kernel.org>
-
由 Minwoo Im 提交于
We have nvme-subsys and nvme devices mapped together. To support multi-controller scheme to this setup, controller identifier(id) has to be managed. Earlier, cntlid(controller id) used to be always 0 because we didn't have any subsystem scheme that controller id matters. This patch introduced 'cntlid' attribute to the nvme controller instance(NvmeCtrl) and make it allocated by the nvme-subsys device mapped to the controller. If nvme-subsys is not given to the controller, then it will always be 0 as it was. Added 'ctrls' array in the nvme-subsys instance to manage attached controllers to the subsystem with a limit(32). This patch didn't take list for the controllers to make it seamless with nvme-ns device. Signed-off-by: NMinwoo Im <minwoo.im.dev@gmail.com> Tested-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NKeith Busch <kbusch@kernel.org> Signed-off-by: NKlaus Jensen <k.jensen@samsung.com>
-
由 Minwoo Im 提交于
nvme controller(nvme) can be mapped to a NVMe subsystem(nvme-subsys). This patch maps a controller to a subsystem by adding a parameter 'subsys' to the nvme device. To map a controller to a subsystem, we need to put nvme-subsys first and then maps the subsystem to the controller: -device nvme-subsys,id=subsys0 -device nvme,serial=foo,id=nvme0,subsys=subsys0 If 'subsys' property is not given to the nvme controller, then subsystem NQN will be created with serial (e.g., 'foo' in above example), Otherwise, it will be based on subsys id (e.g., 'subsys0' in above example). Signed-off-by: NMinwoo Im <minwoo.im.dev@gmail.com> Tested-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NKeith Busch <kbusch@kernel.org> Signed-off-by: NKlaus Jensen <k.jensen@samsung.com>
-
- 09 2月, 2021 8 次提交
-
-
由 Padmakar Kalghatgi 提交于
Implement v1.4 logic for configuring the Controller Memory Buffer. By default, the v1.4 scheme will be used (CMB must be explicitly enabled by the host), so drivers that only support v1.3 will not be able to use the CMB anymore. To retain the v1.3 behavior, set the boolean 'legacy-cmb' nvme device parameter. Reviewed-by: NKeith Busch <kbusch@kernel.org> Reviewed-by: NMinwoo Im <minwoo.im.dev@gmail.com> Signed-off-by: NPadmakar Kalghatgi <p.kalghatgi@samsung.com> Signed-off-by: NKlaus Jensen <k.jensen@samsung.com>
-
由 Naveen Nagar 提交于
Add support for the PMRMSCL and PMRMSCU MMIO registers. This allows adding RDS/WDS support for PMR as well. Reviewed-by: NKeith Busch <kbusch@kernel.org> Signed-off-by: NNaveen Nagar <naveen.n1@samsung.com> Signed-off-by: NKlaus Jensen <k.jensen@samsung.com>
-
由 Klaus Jensen 提交于
In the interest of supporting both CMB and PMR to be enabled on the same device, move the MSI-X table and pending bit array out of BAR 4 and into BAR 0. This is a simplified version of the patch contributed by Andrzej Jakowski (see [1]). Leaving the CMB at offset 0 removes the need for changes to CMB address mapping code. [1]: https://lore.kernel.org/qemu-devel/20200729220107.37758-3-andrzej.jakowski@linux.intel.com/Reviewed-by: NMinwoo Im <minwoo.im.dev@gmail.com> Tested-by: NMinwoo Im <minwoo.im.dev@gmail.com> Reviewed-by: NKeith Busch <kbusch@kernel.org> Signed-off-by: NKlaus Jensen <k.jensen@samsung.com>
-
由 zhenwei pi 提交于
There is a very low probability that hitting physical NVMe disk hardware critical warning case, it's hard to write & test a monitor agent service. For debugging purposes, add a new 'smart_critical_warning' property to emulate this situation. The orignal version of this change is implemented by adding a fixed property which could be initialized by QEMU command line. Suggested by Philippe & Klaus, rework like current version. Test with this patch: 1, change smart_critical_warning property for a running VM: #virsh qemu-monitor-command nvme-upstream '{ "execute": "qom-set", "arguments": { "path": "/machine/peripheral-anon/device[0]", "property": "smart_critical_warning", "value":16 } }' 2, run smartctl in guest #smartctl -H -l error /dev/nvme0n1 === START OF SMART DATA SECTION === SMART overall-health self-assessment test result: FAILED! - volatile memory backup device has failed Reviewed-by: NPhilippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Nzhenwei pi <pizhenwei@bytedance.com> Signed-off-by: NKlaus Jensen <k.jensen@samsung.com>
-
由 Minwoo Im 提交于
Volatile Write Cache(VWC) feature is set in nvme_ns_setup() in the initial time. This feature is related to block device backed, but this feature is controlled in controller level via Set/Get Features command. This patch removed dependency between nvme and nvme-ns to manage the VWC flag value. Also, it open coded the Get Features for VWC to check all namespaces attached to the controller, and if false detected, return directly false. Signed-off-by: NMinwoo Im <minwoo.im.dev@gmail.com> [k.jensen: report write cache preset if present on ANY namespace] Signed-off-by: NKlaus Jensen <k.jensen@samsung.com>
-
由 Klaus Jensen 提交于
Add missing string representations for a couple of new commands. Signed-off-by: NKlaus Jensen <k.jensen@samsung.com> Tested-by: NDmitry Fomichev <dmitry.fomichev@wdc.com> Reviewed-by: NDmitry Fomichev <dmitry.fomichev@wdc.com>
-
由 Dmitry Fomichev 提交于
The emulation code has been changed to advertise NVM Command Set when "zoned" device property is not set (default) and Zoned Namespace Command Set otherwise. Define values and structures that are needed to support Zoned Namespace Command Set (NVMe TP 4053) in PCI NVMe controller emulator. Define trace events where needed in newly introduced code. In order to improve scalability, all open, closed and full zones are organized in separate linked lists. Consequently, almost all zone operations don't require scanning of the entire zone array (which potentially can be quite large) - it is only necessary to enumerate one or more zone lists. Handlers for three new NVMe commands introduced in Zoned Namespace Command Set specification are added, namely for Zone Management Receive, Zone Management Send and Zone Append. Device initialization code has been extended to create a proper configuration for zoned operation using device properties. Read/Write command handler is modified to only allow writes at the write pointer if the namespace is zoned. For Zone Append command, writes implicitly happen at the write pointer and the starting write pointer value is returned as the result of the command. Write Zeroes handler is modified to add zoned checks that are identical to those done as a part of Write flow. Subsequent commits in this series add ZDE support and checks for active and open zone limits. Signed-off-by: NNiklas Cassel <niklas.cassel@wdc.com> Signed-off-by: NHans Holmberg <hans.holmberg@wdc.com> Signed-off-by: NAjay Joshi <ajay.joshi@wdc.com> Signed-off-by: NChaitanya Kulkarni <chaitanya.kulkarni@wdc.com> Signed-off-by: NMatias Bjorling <matias.bjorling@wdc.com> Signed-off-by: NAravind Ramesh <aravind.ramesh@wdc.com> Signed-off-by: NShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com> Signed-off-by: NAdam Manzanares <adam.manzanares@wdc.com> Signed-off-by: NDmitry Fomichev <dmitry.fomichev@wdc.com> Reviewed-by: NNiklas Cassel <Niklas.Cassel@wdc.com> Reviewed-by: NKeith Busch <kbusch@kernel.org> Signed-off-by: NKlaus Jensen <k.jensen@samsung.com>
-
由 Klaus Jensen 提交于
Add support for the Dataset Management command and the Deallocate attribute. Deallocation results in discards being sent to the underlying block device. Whether of not the blocks are actually deallocated is affected by the same factors as Write Zeroes (see previous commit). format | discard | dsm (512B) dsm (4KiB) dsm (64KiB) -------------------------------------------------------- qcow2 ignore n n n qcow2 unmap n n y raw ignore n n n raw unmap n y y Again, a raw format and 4KiB LBAs are preferable. In order to set the Namespace Preferred Deallocate Granularity and Alignment fields (NPDG and NPDA), choose a sane minimum discard granularity of 4KiB. If we are using a passthru device supporting discard at a 512B granularity, user should set the discard_granularity property explicitly. NPDG and NPDA will also account for the cluster_size of the block driver if required (i.e. for QCOW2). See NVM Express 1.3d, Section 6.7 ("Dataset Management command"). Signed-off-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NKeith Busch <kbusch@kernel.org>
-
- 27 10月, 2020 4 次提交
-
-
由 Klaus Jensen 提交于
There are two reasons for changing this: 1. The nvme device currently uses an internal Intel device id. 2. Since commits "nvme: fix write zeroes offset and count" and "nvme: support multiple namespaces" the controller device no longer has the quirks that the Linux kernel think it has. As the quirks are applied based on pci vendor and device id, change them to get rid of the quirks. To keep backward compatibility, add a new 'use-intel-id' parameter to the nvme device to force use of the Intel vendor and device id. This is off by default but add a compat property to set this for 5.1 machines and older. If a 5.1 machine is booted (or the use-intel-id parameter is explicitly set to true), the Linux kernel will just apply these unnecessary quirks: 1. NVME_QUIRK_IDENTIFY_CNS which says that the device does not support anything else than values 0x0 and 0x1 for CNS (Identify Namespace and Identify Namespace). With multiple namespace support, this just means that the kernel will "scan" namespaces instead of using "Active Namespace ID list" (CNS 0x2). 2. NVME_QUIRK_DISABLE_WRITE_ZEROES. The nvme device started out with a broken Write Zeroes implementation which has since been fixed in commit 9d6459d2 ("nvme: fix write zeroes offset and count"). Signed-off-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NKeith Busch <kbusch@kernel.org> Reviewed-by: NMaxim Levitsky <mlevitsk@redhat.com>
-
由 Klaus Jensen 提交于
This adds support for multiple namespaces by introducing a new 'nvme-ns' device model. The nvme device creates a bus named from the device name ('id'). The nvme-ns devices then connect to this and registers themselves with the nvme device. This changes how an nvme device is created. Example with two namespaces: -drive file=nvme0n1.img,if=none,id=disk1 -drive file=nvme0n2.img,if=none,id=disk2 -device nvme,serial=deadbeef,id=nvme0 -device nvme-ns,drive=disk1,bus=nvme0,nsid=1 -device nvme-ns,drive=disk2,bus=nvme0,nsid=2 The drive property is kept on the nvme device to keep the change backward compatible, but the property is now optional. Specifying a drive for the nvme device will always create the namespace with nsid 1. Signed-off-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NKeith Busch <kbusch@kernel.org> Reviewed-by: NMinwoo Im <minwoo.im.dev@gmail.com>
-
由 Klaus Jensen 提交于
This pulls block layer aio submission/completion to common functions. For completions, additionally map an AIO error to the Unrecovered Read and Write Fault status codes. Signed-off-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NKeith Busch <kbusch@kernel.org>
-
由 Klaus Jensen 提交于
Add the symbolic command name to the pci_nvme_{io,admin}_cmd and pci_nvme_rw trace events. Signed-off-by: NKlaus Jensen <k.jensen@samsung.com> Reviewed-by: NPhilippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: NKeith Busch <kbusch@kernel.org>
-