On 22.05.2024 11:28, Roger Pau Monné wrote: > On Fri, May 17, 2024 at 01:06:12PM -0400, Stewart Hildebrand wrote: >> @@ -754,9 +774,23 @@ static int cf_check init_header(struct pci_dev *pdev) >> return -EOPNOTSUPP; >> } >> >> - /* Setup a handler for the command register. */ >> - rc = vpci_add_register(pdev->vpci, vpci_hw_read16, cmd_write, >> PCI_COMMAND, >> - 2, header); >> + /* >> + * Setup a handler for the command register. >> + * >> + * TODO: If support for emulated bits is added, re-visit how to handle >> + * PCI_COMMAND_PARITY, PCI_COMMAND_SERR, and PCI_COMMAND_FAST_BACK. >> + */ >> + rc = vpci_add_register_mask(pdev->vpci, >> + is_hwdom ? vpci_hw_read16 : guest_cmd_read, >> + cmd_write, PCI_COMMAND, 2, header, 0, 0, >> + PCI_COMMAND_RSVDP_MASK | >> + (is_hwdom ? 0 >> + : PCI_COMMAND_IO | >> + PCI_COMMAND_PARITY | >> + PCI_COMMAND_WAIT | >> + PCI_COMMAND_SERR | >> + PCI_COMMAND_FAST_BACK), > > We want to allow full access to the hw domain and only apply the > PCI_COMMAND_RSVDP_MASK when !is_hwdom in order to keep the current > behavior for dom0. > > I don't think it makes a difference in practice, but we are very lax > in explicitly not applying any of such restrictions to dom0. > > With that fixed: > > Reviewed-by: Roger Pau Monné <[email protected]>
Makes sense to me, so please feel free to retain my R-b with that adjustment. Jan
