* [PATCH] qemu-kvm: Resolve PCI upstream diffs
@ 2011-09-08 10:48 Jan Kiszka
2011-09-09 5:01 ` Michael S. Tsirkin
2011-09-09 17:01 ` Marcelo Tosatti
0 siblings, 2 replies; 3+ messages in thread
From: Jan Kiszka @ 2011-09-08 10:48 UTC (permalink / raw)
To: Avi Kivity, Marcelo Tosatti; +Cc: kvm, Michael S. Tsirkin
Resolve all unneeded deviations from upstream code. No functional
changes.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
hw/pci.c | 11 +++++++----
hw/pci.h | 5 ++++-
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/hw/pci.c b/hw/pci.c
index e4c166a..4d8845c 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -2106,8 +2106,6 @@ int pci_add_capability(PCIDevice *pdev, uint8_t cap_id,
memset(pdev->wmask + offset, 0, size);
/* Check capability by default */
memset(pdev->cmask + offset, 0xFF, size);
-
-
return offset;
}
@@ -2125,9 +2123,14 @@ void pci_del_capability(PCIDevice *pdev, uint8_t cap_id, uint8_t size)
memset(pdev->cmask + offset, 0, size);
memset(pdev->used + offset, 0, size);
- if (!pdev->config[PCI_CAPABILITY_LIST]) {
+ if (!pdev->config[PCI_CAPABILITY_LIST])
pdev->config[PCI_STATUS] &= ~PCI_STATUS_CAP_LIST;
- }
+}
+
+/* Reserve space for capability at a known offset (to call after load). */
+void pci_reserve_capability(PCIDevice *pdev, uint8_t offset, uint8_t size)
+{
+ memset(pdev->used + offset, 0xff, size);
}
uint8_t pci_find_capability(PCIDevice *pdev, uint8_t cap_id)
diff --git a/hw/pci.h b/hw/pci.h
index da0c2d2..70fcd9c 100644
--- a/hw/pci.h
+++ b/hw/pci.h
@@ -147,7 +147,7 @@ struct PCIDevice {
/* Used to implement RW1C(Write 1 to Clear) bytes */
uint8_t *w1cmask;
- /* Used to allocate config space and track capabilities. */
+ /* Used to allocate config space for capabilities. */
uint8_t *used;
/* the following fields are read only */
@@ -230,8 +230,11 @@ int pci_add_capability(PCIDevice *pdev, uint8_t cap_id,
void pci_del_capability(PCIDevice *pci_dev, uint8_t cap_id, uint8_t cap_size);
+void pci_reserve_capability(PCIDevice *pci_dev, uint8_t offset, uint8_t size);
+
uint8_t pci_find_capability(PCIDevice *pci_dev, uint8_t cap_id);
+
uint32_t pci_default_read_config(PCIDevice *d,
uint32_t address, int len);
void pci_default_write_config(PCIDevice *d,
--
1.7.3.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] qemu-kvm: Resolve PCI upstream diffs
2011-09-08 10:48 [PATCH] qemu-kvm: Resolve PCI upstream diffs Jan Kiszka
@ 2011-09-09 5:01 ` Michael S. Tsirkin
2011-09-09 17:01 ` Marcelo Tosatti
1 sibling, 0 replies; 3+ messages in thread
From: Michael S. Tsirkin @ 2011-09-09 5:01 UTC (permalink / raw)
To: Jan Kiszka; +Cc: Avi Kivity, Marcelo Tosatti, kvm
On Thu, Sep 08, 2011 at 12:48:02PM +0200, Jan Kiszka wrote:
> Resolve all unneeded deviations from upstream code. No functional
> changes.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
> ---
> hw/pci.c | 11 +++++++----
> hw/pci.h | 5 ++++-
> 2 files changed, 11 insertions(+), 5 deletions(-)
>
> diff --git a/hw/pci.c b/hw/pci.c
> index e4c166a..4d8845c 100644
> --- a/hw/pci.c
> +++ b/hw/pci.c
> @@ -2106,8 +2106,6 @@ int pci_add_capability(PCIDevice *pdev, uint8_t cap_id,
> memset(pdev->wmask + offset, 0, size);
> /* Check capability by default */
> memset(pdev->cmask + offset, 0xFF, size);
> -
> -
> return offset;
> }
>
> @@ -2125,9 +2123,14 @@ void pci_del_capability(PCIDevice *pdev, uint8_t cap_id, uint8_t size)
> memset(pdev->cmask + offset, 0, size);
> memset(pdev->used + offset, 0, size);
>
> - if (!pdev->config[PCI_CAPABILITY_LIST]) {
> + if (!pdev->config[PCI_CAPABILITY_LIST])
> pdev->config[PCI_STATUS] &= ~PCI_STATUS_CAP_LIST;
> - }
> +}
> +
> +/* Reserve space for capability at a known offset (to call after load). */
> +void pci_reserve_capability(PCIDevice *pdev, uint8_t offset, uint8_t size)
> +{
> + memset(pdev->used + offset, 0xff, size);
> }
>
> uint8_t pci_find_capability(PCIDevice *pdev, uint8_t cap_id)
> diff --git a/hw/pci.h b/hw/pci.h
> index da0c2d2..70fcd9c 100644
> --- a/hw/pci.h
> +++ b/hw/pci.h
> @@ -147,7 +147,7 @@ struct PCIDevice {
> /* Used to implement RW1C(Write 1 to Clear) bytes */
> uint8_t *w1cmask;
>
> - /* Used to allocate config space and track capabilities. */
> + /* Used to allocate config space for capabilities. */
> uint8_t *used;
>
> /* the following fields are read only */
> @@ -230,8 +230,11 @@ int pci_add_capability(PCIDevice *pdev, uint8_t cap_id,
>
> void pci_del_capability(PCIDevice *pci_dev, uint8_t cap_id, uint8_t cap_size);
>
> +void pci_reserve_capability(PCIDevice *pci_dev, uint8_t offset, uint8_t size);
> +
> uint8_t pci_find_capability(PCIDevice *pci_dev, uint8_t cap_id);
>
> +
> uint32_t pci_default_read_config(PCIDevice *d,
> uint32_t address, int len);
> void pci_default_write_config(PCIDevice *d,
> --
> 1.7.3.4
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] qemu-kvm: Resolve PCI upstream diffs
2011-09-08 10:48 [PATCH] qemu-kvm: Resolve PCI upstream diffs Jan Kiszka
2011-09-09 5:01 ` Michael S. Tsirkin
@ 2011-09-09 17:01 ` Marcelo Tosatti
1 sibling, 0 replies; 3+ messages in thread
From: Marcelo Tosatti @ 2011-09-09 17:01 UTC (permalink / raw)
To: Jan Kiszka; +Cc: Avi Kivity, kvm, Michael S. Tsirkin
On Thu, Sep 08, 2011 at 12:48:02PM +0200, Jan Kiszka wrote:
> Resolve all unneeded deviations from upstream code. No functional
> changes.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
> hw/pci.c | 11 +++++++----
> hw/pci.h | 5 ++++-
> 2 files changed, 11 insertions(+), 5 deletions(-)
Applied, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-09-09 18:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-08 10:48 [PATCH] qemu-kvm: Resolve PCI upstream diffs Jan Kiszka
2011-09-09 5:01 ` Michael S. Tsirkin
2011-09-09 17:01 ` Marcelo Tosatti
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox