]> git.proxmox.com Git - mirror_qemu.git/commit - hw/core/machine.c
hw/block/nvme: change controller pci id
authorKlaus Jensen <k.jensen@samsung.com>
Fri, 27 Sep 2019 09:43:12 +0000 (11:43 +0200)
committerKlaus Jensen <k.jensen@samsung.com>
Tue, 27 Oct 2020 06:24:47 +0000 (07:24 +0100)
commit6eb7a071292a2f11065127ac152fa24248806021
tree2883ca1a286800a71f72e08965c0b2cacb101061
parentc1e18246618b3401ba1769bf88d2bcdf49e947aa
hw/block/nvme: change controller pci id

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 9d6459d21a6e ("nvme: fix write zeroes offset and count").

Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>
hw/block/nvme.c
hw/block/nvme.h
hw/core/machine.c