xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xend: handle extended PCI configuration space when saving state
@ 2013-08-30 23:40 Matt Wilson
  2013-09-02  9:53 ` George Dunlap
  2013-09-03 16:33 ` [PATCH] xend: handle extended PCI configuration space when saving state Ian Campbell
  0 siblings, 2 replies; 49+ messages in thread
From: Matt Wilson @ 2013-08-30 23:40 UTC (permalink / raw)
  To: xen-devel
  Cc: Steven Noonan, Ian Jackson, Ian Campbell, Matt Wilson,
	Stefano Stabellini

From: Steven Noonan <snoonan@amazon.com>

Newer PCI standards (e.g., PCI-X 2.0 and PCIe) introduce extended
configuration space which is larger than 256 bytes. This patch uses
stat() to determine the amount of space used to correctly save all of
the PCI configuration space. Resets handled by the xen-pciback driver
don't have this problem, as that code correctly handles saving
extended configuration space.

Signed-off-by: Steven Noonan <snoonan@amazon.com>
Reviewed-by: Matt Wilson <msw@amazon.com>
[msw: adjusted commit message]
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Matt Wilson <msw@amazon.com>
---
 tools/python/xen/util/pci.py |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/python/xen/util/pci.py b/tools/python/xen/util/pci.py
index 792fb69..adeca4b 100644
--- a/tools/python/xen/util/pci.py
+++ b/tools/python/xen/util/pci.py
@@ -521,8 +521,9 @@ def save_pci_conf_space(devs_string):
         pci_path = sysfs_mnt + SYSFS_PCI_DEVS_PATH + '/' + pci_str + \
                 SYSFS_PCI_DEV_CONFIG_PATH
         fd = os.open(pci_path, os.O_RDONLY)
+        size = os.fstat(fd).st_size
         configs = []
-        for i in range(0, 256, 4):
+        for i in range(0, size, 4):
             configs = configs + [os.read(fd,4)]
         os.close(fd)
         pci_list = pci_list + [pci_path]
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 49+ messages in thread

end of thread, other threads:[~2013-11-05 14:45 UTC | newest]

Thread overview: 49+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-30 23:40 [PATCH] xend: handle extended PCI configuration space when saving state Matt Wilson
2013-09-02  9:53 ` George Dunlap
2013-09-02 20:32   ` xend deprecation [Was: Re: [PATCH] xend: handle extended PCI configuration space when saving state] Matt Wilson
2013-09-03  8:03     ` Ian Campbell
2013-09-04  6:06       ` xend deprecation Matt Wilson
2013-09-04  7:29         ` Ian Campbell
2013-09-04 14:04           ` Konrad Rzeszutek Wilk
2013-09-04 15:18             ` George Dunlap
2013-09-04 15:34               ` Ian Campbell
2013-09-04 15:43                 ` Ian Jackson
2013-09-12 10:02                   ` Ian Campbell
2013-09-12 10:15                     ` Processed: " xen
2013-09-12 11:10                     ` Ian Jackson
2013-09-04 15:49                 ` Tim Deegan
2013-09-04 16:17                   ` Ian Jackson
2013-09-04 16:24                     ` Ian Campbell
2013-09-04 16:33                 ` Konrad Rzeszutek Wilk
2013-09-05  9:12                   ` George Dunlap
2013-09-06 13:36                     ` Konrad Rzeszutek Wilk
2013-09-06 13:49                       ` Ian Campbell
2013-09-06 14:01                         ` Jan Beulich
2013-09-06 14:15                           ` Ian Campbell
2013-09-05 10:18                   ` Fabio Fantoni
2013-09-05 10:27                     ` George Dunlap
2013-09-05 10:46                 ` George Dunlap
2013-09-04 16:29               ` Konrad Rzeszutek Wilk
2013-09-12 12:52             ` [PATCH] xl: print runtime info in "xl list -l" Ian Campbell
2013-09-25 17:41               ` Konrad Rzeszutek Wilk
2013-09-25 17:56                 ` Ian Campbell
2013-09-25 18:25                   ` Konrad Rzeszutek Wilk
2013-09-25 17:59                 ` Ian Campbell
2013-09-25 18:27                   ` Konrad Rzeszutek Wilk
2013-10-28 15:51                     ` Wei Liu
2013-09-12 14:02             ` xend deprecation Ian Campbell
2013-10-21 14:09             ` Wei Liu
2013-10-21 15:13               ` Zhigang Wang
2013-10-21 15:33               ` Ian Campbell
2013-10-21 15:35               ` Ian Campbell
2013-09-04 12:57         ` Stefano Stabellini
2013-09-12  9:50     ` Support for xm create -F (sxp configuration files) Ian Campbell
2013-09-12 10:00       ` Processed: " xen
2013-09-16 16:49       ` Matt Wilson
2013-11-05 14:39         ` Ian Campbell
2013-11-05 14:45           ` Processed: " xen
2013-09-03 16:33 ` [PATCH] xend: handle extended PCI configuration space when saving state Ian Campbell
2013-09-04  6:12   ` Matt Wilson
2013-09-04  6:47     ` Noonan, Steven
2013-09-04  7:30       ` Ian Campbell
2013-09-04 10:14   ` Ian Jackson

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).