mirror of
https://github.com/xemu-project/xemu.git
synced 2024-11-23 11:39:53 +00:00
hw/nvme: fix missing check for PMR capability
Qiang Liu reported that an access on an unknown address is triggered in
memory_region_set_enabled because a check on CAP.PMRS is missing for the
PMRCTL register write when no PMR is configured.
Cc: qemu-stable@nongnu.org
Fixes: 75c3c9de96
("hw/block/nvme: disable PMR at boot up")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/362
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
This commit is contained in:
parent
eeef43290d
commit
2b02aabc9d
@ -5860,6 +5860,10 @@ static void nvme_write_bar(NvmeCtrl *n, hwaddr offset, uint64_t data,
|
||||
"invalid write to PMRCAP register, ignored");
|
||||
return;
|
||||
case 0xe04: /* PMRCTL */
|
||||
if (!NVME_CAP_PMRS(n->bar.cap)) {
|
||||
return;
|
||||
}
|
||||
|
||||
n->bar.pmrctl = data;
|
||||
if (NVME_PMRCTL_EN(data)) {
|
||||
memory_region_set_enabled(&n->pmr.dev->mr, true);
|
||||
|
Loading…
Reference in New Issue
Block a user