qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Ryan Harper <ryanh@us.ibm.com>
To: Stefan Weil <weil@mail.berlios.de>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] pci: Fix function pci_default_write_config
Date: Fri, 13 Nov 2009 16:58:58 -0600	[thread overview]
Message-ID: <20091113225858.GM11154@us.ibm.com> (raw)
In-Reply-To: <1258151187-10003-1-git-send-email-weil@mail.berlios.de>

* Stefan Weil <weil@mail.berlios.de> [2009-11-13 16:29]:
> Change 260c0cd3d985e51b15870ff47e17b7b930efbda1
> (pci: use range helper functions) introduced a
> bug which made pci cirrus vga on mips malta
> (and maybe other pci devices) fail.
> 
> Don't change addr - its original value is needed
> by ranges_overlap() and range_covers().
> 
> Signed-off-by: Stefan Weil <weil@mail.berlios.de>

This fixes the fedora 9 boot from dvd issue I've seen.

Acked-by: Ryan Harper <ryanh@us.ibm.com>

> ---
>  hw/pci.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/hw/pci.c b/hw/pci.c
> index a326930..6864339 100644
> --- a/hw/pci.c
> +++ b/hw/pci.c
> @@ -856,9 +856,9 @@ void pci_default_write_config(PCIDevice *d, uint32_t addr, uint32_t val, int l)
>      int i;
>      uint32_t config_size = pci_config_size(d);
> 
> -    for(i = 0; i < l && addr < config_size; val >>= 8, ++i, ++addr) {
> -        uint8_t wmask = d->wmask[addr];
> -        d->config[addr] = (d->config[addr] & ~wmask) | (val & wmask);
> +    for (i = 0; i < l && addr + i < config_size; val >>= 8, ++i) {
> +        uint8_t wmask = d->wmask[addr + i];
> +        d->config[addr + i] = (d->config[addr + i] & ~wmask) | (val & wmask);
>      }
>      if (ranges_overlap(addr, l, PCI_BASE_ADDRESS_0, 24) ||
>          ranges_overlap(addr, l, PCI_ROM_ADDRESS, 4) ||
> -- 
> 1.5.6.5
> 
> 

-- 
Ryan Harper
Software Engineer; Linux Technology Center
IBM Corp., Austin, Tx
ryanh@us.ibm.com

      reply	other threads:[~2009-11-13 22:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-13 22:26 [Qemu-devel] [PATCH] pci: Fix function pci_default_write_config Stefan Weil
2009-11-13 22:58 ` Ryan Harper [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091113225858.GM11154@us.ibm.com \
    --to=ryanh@us.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=weil@mail.berlios.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).