From: Matt Wilson <msw@linux.com>
To: xen-devel@lists.xenproject.org
Cc: Steven Noonan <snoonan@amazon.com>,
Ian Jackson <ian.jackson@eu.citrix.com>,
Ian Campbell <ian.campbell@citrix.com>,
Matt Wilson <msw@amazon.com>,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [PATCH] xend: handle extended PCI configuration space when saving state
Date: Fri, 30 Aug 2013 16:40:42 -0700 [thread overview]
Message-ID: <1377906042-12816-1-git-send-email-msw@linux.com> (raw)
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
next reply other threads:[~2013-08-30 23:41 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-30 23:40 Matt Wilson [this message]
2013-09-02 9:53 ` [PATCH] xend: handle extended PCI configuration space when saving state 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
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=1377906042-12816-1-git-send-email-msw@linux.com \
--to=msw@linux.com \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=msw@amazon.com \
--cc=snoonan@amazon.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=xen-devel@lists.xenproject.org \
/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).