All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Avi Kivity <avi@redhat.com>, Marcelo Tosatti <mtosatti@redhat.com>
Cc: kvm@vger.kernel.org, "Michael S. Tsirkin" <mst@redhat.com>,
	Alex Williamson <alex.williamson@redhat.com>
Subject: Re: [PATCH v3 7/7] qemu-kvm: Resolve PCI upstream diffs
Date: Wed, 24 Aug 2011 14:38:51 +0200	[thread overview]
Message-ID: <4E54F0DB.8080400@siemens.com> (raw)
In-Reply-To: <dc709c3428c36ba9cd7509c9c812043bbdbfa6b9.1314120782.git.jan.kiszka@siemens.com>

On 2011-08-23 19:33, Jan Kiszka wrote:
> Device assignment no longer peeks into config_map, so we can drop all
> the related changes and sync the PCI core with upstream.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>  hw/pci.c |   29 +++++++++++++++--------------
>  hw/pci.h |    7 +++++--
>  2 files changed, 20 insertions(+), 16 deletions(-)
> 
> diff --git a/hw/pci.c b/hw/pci.c
> index 5c87a62..0225888 100644
> --- a/hw/pci.c
> +++ b/hw/pci.c
> @@ -806,7 +806,7 @@ static void pci_config_alloc(PCIDevice *pci_dev)
>      pci_dev->cmask = g_malloc0(config_size);
>      pci_dev->wmask = g_malloc0(config_size);
>      pci_dev->w1cmask = g_malloc0(config_size);
> -    pci_dev->config_map = g_malloc0(config_size);
> +    pci_dev->used = g_malloc0(config_size);
>  }
>  
>  static void pci_config_free(PCIDevice *pci_dev)
> @@ -815,7 +815,7 @@ static void pci_config_free(PCIDevice *pci_dev)
>      g_free(pci_dev->cmask);
>      g_free(pci_dev->wmask);
>      g_free(pci_dev->w1cmask);
> -    g_free(pci_dev->config_map);
> +    g_free(pci_dev->used);
>  }
>  
>  /* -1 for devfn means auto assign */
> @@ -846,8 +846,6 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus,
>      pci_dev->irq_state = 0;
>      pci_config_alloc(pci_dev);
>  
> -    memset(pci_dev->config_map, 0xff, PCI_CONFIG_HEADER_SIZE);
> -
>      pci_config_set_vendor_id(pci_dev->config, info->vendor_id);
>      pci_config_set_device_id(pci_dev->config, info->device_id);
>      pci_config_set_revision(pci_dev->config, info->revision);
> @@ -1887,7 +1885,7 @@ static int pci_find_space(PCIDevice *pdev, uint8_t size)
>      int offset = PCI_CONFIG_HEADER_SIZE;
>      int i;
>      for (i = PCI_CONFIG_HEADER_SIZE; i < config_size; ++i)
> -        if (pdev->config_map[i])
> +        if (pdev->used[i])
>              offset = i + 1;
>          else if (i - offset + 1 == size)
>              return offset;
> @@ -2062,13 +2060,13 @@ int pci_add_capability(PCIDevice *pdev, uint8_t cap_id,
>          int i;
>  
>          for (i = offset; i < offset + size; i++) {
> -            if (pdev->config_map[i]) {
> +            if (pdev->used[i]) {
>                  fprintf(stderr, "ERROR: %04x:%02x:%02x.%x "
>                          "Attempt to add PCI capability %x at offset "
>                          "%x overlaps existing capability %x at offset %x\n",
>                          pci_find_domain(pdev->bus), pci_bus_num(pdev->bus),
>                          PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn),
> -                        cap_id, offset, pdev->config_map[i], i);
> +                        cap_id, offset, pdev->used[i], i);
>                  return -EINVAL;

This hunk is actually not equivalent. So the whole patch should be
skipped for now. I'll post a new version once upstreaming and merging
back of that error detection is done.

Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux

  reply	other threads:[~2011-08-24 12:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-23 17:32 [PATCH v3 0/7] qemu-kvm: device assignment cleanups and upstream diff reductions Jan Kiszka
2011-08-23 17:32 ` [PATCH v3 1/7] pci-assign: Fix kvm_deassign_irq handling in assign_irq Jan Kiszka
2011-08-23 17:32 ` [PATCH v3 2/7] pci-assign: Update legacy interrupts only if used Jan Kiszka
2011-08-23 17:32 ` [PATCH v3 3/7] pci-assign: Drop libpci header dependency Jan Kiszka
2011-08-23 17:33 ` [PATCH v3 4/7] pci-assign: Refactor calc_assigned_dev_id Jan Kiszka
2011-08-23 17:33 ` [PATCH v3 5/7] pci-assign: Track MSI/MSI-X capability position, clean up related code Jan Kiszka
2011-08-23 17:33 ` [PATCH v3 6/7] pci-assign: Generic config space access management Jan Kiszka
2011-08-23 17:33 ` [PATCH v3 7/7] qemu-kvm: Resolve PCI upstream diffs Jan Kiszka
2011-08-24 12:38   ` Jan Kiszka [this message]
2011-08-23 22:28 ` [PATCH v3 0/7] qemu-kvm: device assignment cleanups and upstream diff reductions Alex Williamson
2011-08-24 17:12 ` Marcelo Tosatti

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=4E54F0DB.8080400@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=alex.williamson@redhat.com \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=mtosatti@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.