public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: 刘晓建 <zjliu@nudt.edu.cn>
To: kvm@vger.kernel.org
Subject: [PATCH 3/3] KVM: pci passthrough un-page-aligned mmio device on machines w/o VT-d
Date: Mon, 15 Dec 2008 23:01:23 +0800	[thread overview]
Message-ID: <429353283.11759@nudt.edu.cn> (raw)

the KVM79 doesn't support the case of running pci passthrough on a machine w/o
VT-d. The following fixes it
---
diff -uNr kvm-79/kernel/x86/kvm_main.c kvm-79-fixed/kernel/x86/kvm_main.c
--- kvm-79/kernel/x86/kvm_main.c 2008-11-12 20:24:04.000000000 +0800
+++ kvm-79-fixed/kernel/x86/kvm_main.c 2008-12-12 15:56:19.000000000 +0800
@@ -1059,11 +1061,22 @@
 struct page *gfn_to_page(struct kvm *kvm, gfn_t gfn)
 {
  pfn_t pfn;
+ pfn_t reserved_top = 0;
 
  pfn = gfn_to_pfn(kvm, gfn);
  if (!kvm_is_mmio_pfn(pfn))
  return pfn_to_page(pfn);
 
+#ifdef CONFIG_RESERVE_PHYSICAL_START
+ reserved_top = __PHYSICAL_START>>PAGE_SHIFT;
+#else
+#warning   if you want to use pci passthrough w/o mechanisms like VT-d,
+#warning   please define CONFIG_RESERVE_PHYSICAL_START and __PHYSICAL_START, 
+#warning   when compiling your linux kernel!
+#endif
+ if(pfn < reserved_top)
+     return pfn_to_page(pfn);
+
  WARN_ON(kvm_is_mmio_pfn(pfn));
 
  get_page(bad_page);


Xiaojian Liu



             reply	other threads:[~2008-12-15 15:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-15 15:01 刘晓建 [this message]
2008-12-16  5:19 ` [PATCH 3/3] KVM: pci passthrough un-page-aligned mmio device on machines w/o VT-d Zhang, Xiantao

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=429353283.11759@nudt.edu.cn \
    --to=zjliu@nudt.edu.cn \
    --cc=kvm@vger.kernel.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