From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: [PATCH] x86/PCI: fix guest_io_read() when pci_cfg_ok() denies access Date: Thu, 21 Jun 2012 17:25:25 +0100 Message-ID: References: <4FE32D13020000780008B134@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4FE32D13020000780008B134@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich , xen-devel List-Id: xen-devel@lists.xenproject.org On 21/06/2012 13:17, "Jan Beulich" wrote: > For a multi-byte aligned read, this so far resulted in 0x00ff to be > put in the guest's register rather than 0xffff or 0xffffffff, which in > turn could confuse bus scanning functions (which, when reading vendor > and/or device IDs, expect to get back all zeroes or all ones). > > As the value gets masked to the read width when merging back into the > full result, setting the initial value to all ones should not harm any > or the other cases. > > Signed-off-by: Jan Beulich Acked-by: Keir Fraser > --- a/xen/arch/x86/traps.c > +++ b/xen/arch/x86/traps.c > @@ -1717,7 +1717,7 @@ static uint32_t guest_io_read( > while ( bytes != 0 ) > { > unsigned int size = 1; > - uint32_t sub_data = 0xff; > + uint32_t sub_data = ~0; > > if ( (port == 0x42) || (port == 0x43) || (port == 0x61) ) > { > > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel