All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Jones <drjones@redhat.com>
To: kvm@vger.kernel.org
Cc: pbonzini@redhat.com, rkrcmar@redhat.com, peterx@redhat.com
Subject: [PATCH kvm-unit-tests 1/5] x86/intel-iommu: make edu_dev global
Date: Mon, 16 Jan 2017 16:32:11 +0100	[thread overview]
Message-ID: <20170116153215.6033-2-drjones@redhat.com> (raw)
In-Reply-To: <20170116153215.6033-1-drjones@redhat.com>

We'll need to access the edu_dev struct from the ISR, so make it
global.

Cc: Peter Xu <peterx@redhat.com>
Signed-off-by: Andrew Jones <drjones@redhat.com>
---
 x86/intel-iommu.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/x86/intel-iommu.c b/x86/intel-iommu.c
index 5a65232f5ad4..fa77914524b5 100644
--- a/x86/intel-iommu.c
+++ b/x86/intel-iommu.c
@@ -18,8 +18,11 @@
 #define VTD_TEST_IR_MSI ("IR MSI")
 #define VTD_TEST_IR_IOAPIC ("IR IOAPIC")
 
-void vtd_test_dmar(struct pci_edu_dev *dev)
+static struct pci_edu_dev edu_dev;
+
+static void vtd_test_dmar(void)
 {
+	struct pci_edu_dev *dev = &edu_dev;
 	void *page = alloc_page();
 
 	report_prefix_push("vtd_dmar");
@@ -66,10 +69,11 @@ static void edu_isr(isr_regs_t *regs)
 	eoi();
 }
 
-static void vtd_test_ir(struct pci_edu_dev *dev)
+static void vtd_test_ir(void)
 {
 #define VTD_TEST_VECTOR_IOAPIC (0xed)
 #define VTD_TEST_VECTOR_MSI (0xee)
+	struct pci_edu_dev *dev = &edu_dev;
 	struct pci_dev *pci_dev = &dev->pci_dev;
 
 	report_prefix_push("vtd_ir");
@@ -127,8 +131,6 @@ static void vtd_test_ir(struct pci_edu_dev *dev)
 
 int main(int argc, char *argv[])
 {
-	struct pci_edu_dev dev;
-
 	vtd_init();
 
 	report_prefix_push("vtd_init");
@@ -145,15 +147,15 @@ int main(int argc, char *argv[])
 
 	report_prefix_pop();
 
-	if (!edu_init(&dev)) {
+	if (!edu_init(&edu_dev)) {
 		printf("Please specify \"-device edu\" to do "
 		       "further IOMMU tests.\n");
 		report_skip(VTD_TEST_DMAR_4B);
 		report_skip(VTD_TEST_IR_IOAPIC);
 		report_skip(VTD_TEST_IR_MSI);
 	} else {
-		vtd_test_dmar(&dev);
-		vtd_test_ir(&dev);
+		vtd_test_dmar();
+		vtd_test_ir();
 	}
 
 	return report_summary();
-- 
2.9.3


  reply	other threads:[~2017-01-16 15:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-16 15:32 [PATCH kvm-unit-tests 0/5] x86/intel-iommu: couple fixups Andrew Jones
2017-01-16 15:32 ` Andrew Jones [this message]
2017-01-16 15:32 ` [PATCH kvm-unit-tests 2/5] x86/intel-iommu: properly ack edu interrupt Andrew Jones
2017-01-16 15:32 ` [PATCH kvm-unit-tests 3/5] lib/pci: generalize pci_cap_walk Andrew Jones
2017-01-16 15:32 ` [PATCH kvm-unit-tests 4/5] lib/pci: expose pci_dev_print Andrew Jones
2017-01-16 15:32 ` [PATCH kvm-unit-tests 5/5] lib/pci: reduce library noise Andrew Jones
2017-01-18  8:47 ` [PATCH kvm-unit-tests 0/5] x86/intel-iommu: couple fixups Peter Xu
2017-01-20 17:35 ` Radim Krčmář

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=20170116153215.6033-2-drjones@redhat.com \
    --to=drjones@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=rkrcmar@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.