* [PATCH 3/3] KVM: pci passthrough un-page-aligned mmio device on machines w/o VT-d
@ 2008-12-15 15:01 刘晓建
2008-12-16 5:19 ` Zhang, Xiantao
0 siblings, 1 reply; 2+ messages in thread
From: 刘晓建 @ 2008-12-15 15:01 UTC (permalink / raw)
To: kvm
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* RE: [PATCH 3/3] KVM: pci passthrough un-page-aligned mmio device on machines w/o VT-d
2008-12-15 15:01 [PATCH 3/3] KVM: pci passthrough un-page-aligned mmio device on machines w/o VT-d 刘晓建
@ 2008-12-16 5:19 ` Zhang, Xiantao
0 siblings, 0 replies; 2+ messages in thread
From: Zhang, Xiantao @ 2008-12-16 5:19 UTC (permalink / raw)
To: 刘晓建, kvm@vger.kernel.org
Xiaojian,
For generating the patches for kvm module, you needs to use kvm.git as development tree instead of kvm's release tarball. The source files in release tarball have been hacked before release out, and maybe different with kernel's. So please clone kvm.git through git.kernel.org first and re-create the patchset.
Xiantao
刘晓建 wrote:
> 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-12-16 5:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-15 15:01 [PATCH 3/3] KVM: pci passthrough un-page-aligned mmio device on machines w/o VT-d 刘晓建
2008-12-16 5:19 ` Zhang, Xiantao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox