qemu-e2k/hw/nvme
Łukasz Gieryk 3bfcc51737 hw/nvme: Remove reg_size variable and update BAR0 size calculation
The n->reg_size parameter unnecessarily splits the BAR0 size calculation
in two phases; removed to simplify the code.

With all the calculations done in one place, it seems the pow2ceil,
applied originally to reg_size, is unnecessary. The rounding should
happen as the last step, when BAR size includes Nvme registers, queue
registers, and MSIX-related space.

Finally, the size of the mmio memory region is extended to cover the 1st
4KiB padding (see the map below). Access to this range is handled as
interaction with a non-existing queue and generates an error trace, so
actually nothing changes, while the reg_size variable is no longer needed.

    --------------------
    |      BAR0        |
    --------------------
    [Nvme Registers    ]
    [Queues            ]
    [power-of-2 padding] - removed in this patch
    [4KiB padding (1)  ]
    [MSIX TABLE        ]
    [4KiB padding (2)  ]
    [MSIX PBA          ]
    [power-of-2 padding]

Signed-off-by: Łukasz Gieryk <lukasz.gieryk@linux.intel.com>
Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
2022-06-23 23:24:29 +02:00
..
Kconfig
ctrl.c hw/nvme: Remove reg_size variable and update BAR0 size calculation 2022-06-23 23:24:29 +02:00
dif.c hw/nvme: add new command abort case 2022-06-03 21:48:24 +02:00
dif.h hw/nvme: 64-bit pi support 2022-03-03 09:30:21 +01:00
meson.build
ns.c hw/nvme: Add support for Secondary Controller List 2022-06-23 23:24:28 +02:00
nvme.h hw/nvme: Remove reg_size variable and update BAR0 size calculation 2022-06-23 23:24:29 +02:00
subsys.c hw/nvme: Add support for Secondary Controller List 2022-06-23 23:24:28 +02:00
trace-events hw/nvme: Implement the Function Level Reset 2022-06-23 23:24:28 +02:00
trace.h