Added support for following different LBA formats.

    1) The follwoing formats are supported for each namespace:
       LBA0: LBADS=9, MS=0,         LBA8: LBADS=11, MS=0,
       LBA1: LBADS=9, MS=8,         LBA9: LBADS=11, MS=8,
       LBA2: LBADS=9, MS=64,        LBA10: LBADS=11, MS=64,
       LBA3: LBADS=9, MS=128,       LBA11: LBADS=11, MS=128,
       LBA4: LBADS=10, MS=0,        LBA12: LBADS=12, MS=0,
       LBA5: LBADS=10, MS=8,        LBA13: LBADS=12, MS=8,
       LBA6: LBADS=10, MS=64,       LBA14: LBADS=12, MS=64,
       LBA7: LBADS=10, MS=128,      LBA15: LBADS=12, MS=128.
    2) Setting Idenitfy.DPS = 0x00, allowing it to be set using FormatNVM cmd.
    3) Updated adm_cmd_format_nvm cmd to resize meta disks.
       Added logic in adm_cmd_format_nvm to update meta disk
       based on the LBA format specified.

    Review Board Link:
    http://dcgshare.lm.intel.com/reviews/r/1312/
Adopt a more efficient handling of doorbell rings.

This is a problem more efficient method of handling the action of doorbell
rings.
Bug fix in adm_cmd_format_nvm().

    A specific combination of formatting namespace resulted in ummap
    being call instead or realloate. Using the previous meta buffer
    allocated instead of just the meta size covers all these scenarios.

    Review Board Link:
    http://dcgshare.lm.intel.com/reviews/r/1320/
Bugfix: Flush cmd must check illegal NSID values.

As of NVMe spec rev 1.0b "All NVM cmds use the CMD.DW1 (NSID) field".
Thus all NVM cmd set cmds must check for illegal namespaces up front.
So for a future reference an NVM cmd added to function nvme_io_command()
must be added after the NSID field check, or risk introducing this bug
again.
QEMU NVMe: Format NVM enhancements

Added checks for all possible protection information and meta-data settings
that can be set in the format command.
Simplified the format changes by closing and opening the namespace's disk.
Added interleaved meta data handling when the disk is opened.
Set controller MDTS to a non-zero value.
Set CAP.MQES for 1024 queue depth.

Signed-off-by: Keith Busch <keith.busch@intel.com>
QEMU NVMe: Fix compile error from print message
Ignoring meta ptr when no meta data is set.

    Changed IO cmds to ignore any meta ptr in the cmd when
    the namespace is formatted to be a BARE namspc.
Bugfix: Do not issue error upon non-zero MPTR.

Spec states that non-zero meta data buffers shall be ignored, i.e. no
error reported, when the DW4&5 (MPTR) field of the command is not in use.
However, there should be an error when the MPTR == NULL and it should be in use.
Added dataset mgmt cmd.

The NVM dataset mgmt set cmd has been added as a NOP. It is reported as
supported, checks for illegal namespaces, but essentially does nothing.
Added NVM dataset management cmd.

    QEMU now supports the dataset management cmd for dealloc
    attribute. The user can issue dataset mangement to deallocate
    LBA's specified in Range definition for 256 ranges or
    deallocate entire namespace cap by using 1 range.

Reviewboard link:
    http://dcgshare.lm.intel.com/reviews/r/1571/
Cherry picked "Save firmware slot info" commit.

    SHA1 ID: 416d79882119c0873d91e42bfdc040eaa7217c14
    1) nvme: Save firmware slot info
    2) Fix merge issues for GetLogPage Cmd from master.

    Conflicts:

	hw/nvme.c
	hw/nvme.h
	hw/nvme_adm.c

    After cherry picking the getlogpage update from master brach,
    had to manually fix few merge issues.
QEMU NVMe: fix log page command numd calculation

Signed-off-by: Keith Busch <keith.busch@intel.com>

Conflicts:

	hw/nvme_adm.c
QEMU NVMe: set cmd specific error for invalid log page

Signed-off-by: Keith Busch <keith.busch@intel.com>
Updated adm_cmd_smart_info to check for lpa.

   In function adm_cmd_smart_info(hw/nvme_adm.c), added idtfy_ctrl->lpa
   bit checking and return failure if used incorrectly.

Reviewboard review no: 1851
QEMU NVMe: transfer log pages up to request length

If the requested transfer is less than the size of the log page, transfer
the log page up to that requested length.

Signed-off-by: Keith Busch <keith.busch@intel.com>

Conflicts:

	hw/nvme_adm.c
QEMU NVMe: cq doorbell write, interrupts

Trigger an interrupt if the completion queue head is updated but there
are still completion entries to be processed.

Signed-off-by: Keith Busch <keith.busch@intel.com>

Conflicts:

	hw/nvme.c
QEMU NVMe: Updation of README

Upated README file with description of additional bootup params.
Signed-off-by: Nisheeth Bhat <nisheeth.bhat@intel.com>
QEMU NVMe: Updation to README

Removed invalid QEMU boot-up params.
Signed-off-by: Nisheeth Bhat <nisheeth.bhat@intel.com>
QEMU NVMe: Get log page NUMD field is zero based

Spec 1.0c clarified the NUMD field in the command is zero based.

Signed-off-by: Keith Busch <keith.busch@intel.com>
Added async event masking logic

    Async event subsequent events are masked until the host
    clears that event by calling Get log page for the corresponing
    event.

Signed-off-by: Sravan Kumar Thokala <sravan.kumar.thokala@intel.com>