On Fri, Jul 21, 2023 at 12:50:23PM +0200, Jan Beulich wrote: > On 21.07.2023 12:36, Rahul Singh wrote: > >> On 20 Jul 2023, at 1:32 am, Volodymyr Babchuk <[email protected]> > >> wrote: > >> @@ -599,34 +681,50 @@ static int cf_check init_bars(struct pci_dev *pdev) > >> bars[i].size = size; > >> bars[i].prefetchable = val & PCI_BASE_ADDRESS_MEM_PREFETCH; > > > > I think there is a need to set the BAR mem type and prefetchable bit to the > > guest_reg also to avoid mismatch when Guest kernel initially read the BAR’s. > > Perhaps more generally: Shouldn't r/o bits be handed through in almost > all cases?
I remember in an earlier version suggesting to store the guest address, instead of the guest BAR register value. Then the flags would be unconditionally added in guest_bar_read() and we wouldn't need to worry about initializing the register. Thanks, Roger.
