Skip to content

Commit b2dc13d

Browse files
chejianjwenlingz
authored andcommitted
dm: virtio: use the correct register size
movb is used for registers STATUS and CFGGENERATION whose size is 1 byte. Previously hv cannot report the correct MMIO trap size for movb and virtio hard coded their size to 4 as a workaround. hv fixed movb instruction emulation and MMIO size can be reported correctly. This patch removes those workaround. commit 9df8790 ("hv: Fix two minor issues in instruction emulation code") Tracked-On: #1449 Signed-off-by: Jian Jun Chen <jian.jun.chen@intel.com> Acked-by: Yin Fengwei <fengwei.yin@intel.com>
1 parent 790d8a5 commit b2dc13d

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

devicemodel/hw/pci/virtio/virtio.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -569,14 +569,8 @@ static struct config_reg modern_config_regs[] = {
569569
{ VIRTIO_COMMON_GF, 4, 0, "GF" },
570570
{ VIRTIO_COMMON_MSIX, 2, 0, "MSIX" },
571571
{ VIRTIO_COMMON_NUMQ, 2, 1, "NUMQ" },
572-
573-
/*
574-
* TODO: change size to 1 for the below 2 registers when
575-
* HV can report corret size
576-
*/
577-
{ VIRTIO_COMMON_STATUS, 4, 0, "STATUS" },
578-
{ VIRTIO_COMMON_CFGGENERATION, 4, 1, "CFGGENERATION" },
579-
572+
{ VIRTIO_COMMON_STATUS, 1, 0, "STATUS" },
573+
{ VIRTIO_COMMON_CFGGENERATION, 1, 1, "CFGGENERATION" },
580574
{ VIRTIO_COMMON_Q_SELECT, 2, 0, "Q_SELECT" },
581575
{ VIRTIO_COMMON_Q_SIZE, 2, 0, "Q_SIZE" },
582576
{ VIRTIO_COMMON_Q_MSIX, 2, 0, "Q_MSIX" },

0 commit comments

Comments
 (0)