Compare commits

...

53 Commits

Author SHA1 Message Date
Michael Young
84def05900 add patch to allow xen-blkback to build as module 2011-03-15 20:52:00 +00:00
Michael Young
eb7b2f0ac9 switch to single diff for pcifront.next-2.6.38.patch
build new xen-blkback as a module
2011-03-15 20:09:04 +00:00
Michael Young
b65e52f040 Merge branch 'master' into rawhide/user/myoung/xendom0
Conflicts:
	kernel.spec
2011-03-15 19:06:47 +00:00
Michael Young
823c8f14d4 get updated devel/next-2.6.38 2011-02-28 23:18:20 +00:00
Michael Young
521056633b Merge branch 'master' into rawhide/user/myoung/xendom0
Conflicts:
	kernel.spec
2011-02-28 21:42:52 +00:00
Michael Young
194b65895b fix date in changelog 2011-02-23 19:09:04 +00:00
Michael Young
b9db6f4241 update devel/next-2.6.38 and fix a mis-edit 2011-02-22 23:41:02 +00:00
Michael Young
0309dd5d1d Merge branch 'master' into rawhide/user/myoung/xendom0
Conflicts:
	kernel.spec
2011-02-22 20:43:38 +00:00
Michael Young
34a9f813eb Update devel/next-2.6.38 2011-02-20 18:11:18 +00:00
Michael Young
8ffcefc566 Merge branch 'master' into rawhide/user/myoung/xendom0
Conflicts:
	kernel.spec
2011-02-19 20:44:50 +00:00
Michael Young
ddb95b3a12 Merge branch 'master' into rawhide/user/myoung/xendom0
Conflicts:
	kernel.spec
2011-02-16 23:01:27 +00:00
Michael Young
9ff52fdd33 Try Konrad's devel/next-2.6.38 instead of Jeremy's xen/next-2.6.38 2011-02-11 22:27:09 +00:00
Michael Young
7a2f6e2c11 Merge branch 'master' into rawhide/user/myoung/xendom0
Conflicts:
	kernel.spec
2011-02-11 20:14:14 +00:00
Michael Young
dab147f999 throw away the xen/trace stuff in xen.next-2.6.38.patch as it looks buggy 2011-02-09 21:24:28 +00:00
Michael Young
08e6a00037 unmangle a patch in xen.next-2.6.38.patch 2011-02-09 20:45:10 +00:00
Michael Young
c59de48dcf Update xen.next-2.6.38 to get updated net backend code 2011-02-09 19:55:07 +00:00
Michael Young
685bfa9afb Merge branch 'master' into rawhide/user/myoung/xendom0
Conflicts:
	kernel.spec
2011-02-08 21:20:39 +00:00
Michael Young
f50d2873c3 Update xen.next-2.6.38 and xen.pvhvm.fixes patches 2011-02-01 23:08:28 +00:00
Michael Young
b88607f8f0 Merge branch 'master' into rawhide/user/myoung/xendom0
Conflicts:
	kernel.spec
2011-02-01 22:17:55 +00:00
Michael Young
58d1f03183 Remove an upstream patch from xen.pvhvm.fixes.patch 2011-01-26 20:59:51 +00:00
Michael Young
65d0c257a6 Actually include xen.pvhvm.fixes.patch 2011-01-26 20:22:37 +00:00
Michael Young
0bd53dc564 Merge branch 'master' into rawhide/user/myoung/xendom0
Conflicts:
	kernel.spec
2011-01-26 20:20:10 +00:00
Michael Young
83389cd990 restore xen.pvhvm.fixes.patch , don't build non-pae debug kernel on i686 2011-01-26 00:03:03 +00:00
Michael Young
abab315534 Remove a patch from xen.pvhvm.fixes.patch which might break i686 compile 2011-01-25 22:57:25 +00:00
Michael Young
1f6c23a1b7 Switch to xen/next-2.6.38 which adds net and pci backends
add some memory fixes
2011-01-25 21:25:53 +00:00
Michael Young
caa69bbc91 Merge branch 'master' into rawhide/user/myoung/xendom0 2011-01-25 18:56:13 +00:00
Michael Young
d8422afbce Merge branch 'master' into rawhide/user/myoung/xendom0
Conflicts:
	kernel.spec
2011-01-25 00:05:34 +00:00
Michael Young
09bc1b50b1 Update to 2.6.38-rc, test a crash-on-boot patch 2011-01-24 22:54:25 +00:00
Michael Young
890c8ce6ae Merge branch 'rawhide/user/kyle/kernel-git' into rawhide/user/myoung/xendom0
Conflicts:
	config-x86-generic
	config-x86_64-generic
	kernel.spec
2011-01-24 21:47:01 +00:00
Michael Young
f5f5f6a81c reorganize xen.pcifront.fixes.patch and add in some KMS fixes 2011-01-09 21:26:22 +00:00
Michael Young
28fc538cef Merge branch 'master' into rawhide/user/myoung/xendom0
Conflicts:
	kernel.spec
2011-01-09 20:15:36 +00:00
Michael Young
3e91389000 Don't build docs as it is unreliable. 2011-01-05 20:45:00 +00:00
Michael Young
fcb3c76eb5 IRQ fixes from stable/bug-fixes branch 2011-01-05 18:56:34 +00:00
Michael Young
14fd9886f2 Merge branch 'master' into rawhide/user/myoung/xendom0
Conflicts:
	kernel.spec
2011-01-05 18:45:40 +00:00
Michael Young
2ce28c32d2 update pvops to add some xenbus patches 2011-01-01 22:33:54 +00:00
Michael Young
1e71a89379 Merge branch 'master' into rawhide/user/myoung/xendom0
Conflicts:
	kernel.spec
2011-01-01 21:28:03 +00:00
Michael Young
a9d2ae6c02 test an irq patch in xen.pcifront.fixes.patch 2010-12-14 21:51:11 +00:00
Michael Young
8807475c83 Merge branch 'master' into rawhide/user/myoung/xendom0
Conflicts:
	kernel.spec
2010-12-14 20:06:47 +00:00
Michael Young
1ad57fd01b Update the xen/next-2.6.37 patch and rebuild for rc5 2010-12-08 13:14:30 +00:00
Michael Young
ed706b65af Merge branch 'rawhide/user/kyle/kernel-git' into rawhide/user/myoung/xendom0
Conflicts:
	kernel.spec
2010-12-08 11:19:52 +00:00
Michael Young
85b5730b7e Update the xen/next-2.6.37 patch and rebuild for rc4-git1
drop upstream xen-pcifront-fixes patch
2010-12-02 16:44:00 +00:00
Michael Young
9e46bf6efa Merge branch 'rawhide/user/kyle/kernel-git' into rawhide/user/myoung/xendom0
Conflicts:
	kernel.spec
2010-12-02 14:14:04 +00:00
Michael Young
b4d2cea8c1 Fix date in changelog 2010-11-22 23:16:58 +00:00
Michael Young
08f2df54cb Update the xen/next-2.6.37 patch and rebuild for rc3 2010-11-22 23:12:51 +00:00
Michael Young
88f689255e Merge branch 'rawhide/user/kyle/kernel-git' into rawhide/user/myoung/xendom0
Conflicts:
	kernel.spec
2010-11-22 21:46:41 +00:00
Michael Young
4ec8ad3e2b Update the xen/next-2.6.37 and xen-pcifront-fixes patches 2010-11-16 22:01:22 +00:00
Michael Young
c43c10888a Merge branch 'rawhide/user/kyle/kernel-git' into rawhide/user/myoung/xendom0
Conflicts:
	kernel.spec
2010-11-16 19:36:23 +00:00
Michael Young
0e092ef29b Try again with xen patches from xen/next-2.6.37 2010-11-13 17:37:42 +00:00
Michael Young
672010d920 experiment with patch format by adding various xen bugfixes 2010-11-11 21:38:35 +00:00
Michael Young
0da8aa1003 Merge branch 'rawhide/user/kyle/kernel-git' into rawhide/user/myoung/xendom0 2010-11-09 20:02:47 +00:00
Michael Young
25c1e5d0ec add "xendom0" tag
don't build non-PAE i686 kernel as it won't work as a xen dom0
2010-11-06 23:33:09 +00:00
Michael Young
f867de69f5 Fix linux-2.6-utrace-ptrace.patch so it applies and builds
remove a duplicate entry from config-generic
2010-11-06 23:21:37 +00:00
Michael Young
1d350f5695 Merge remote branch 'remotes/origin/rawhide/user/kyle/kernel-git' into rawhide/user/myoung/xendom0 2010-11-06 23:16:20 +00:00
7 changed files with 53121 additions and 1 deletions

View File

@ -1,2 +1,8 @@
# This file is intentionally left empty in the stock kernel. Its a nicety
# added for those wanting to do custom rebuilds with altered config opts.
CONFIG_XEN_NETDEV_BACKEND=m
CONFIG_XEN_PCIDEV_BACKEND=m
CONFIG_XEN_PCIDEV_BE_DEBUG=n
CONFIG_XEN_DEBUG=n
CONFIG_XEN_GRANT_DEV_ALLOC=m
CONFIG_XEN_BLKDEV_BACKEND=m

View File

@ -24,6 +24,7 @@ Summary: The Linux kernel
# (Uncomment the '#' and both spaces below to set the buildid.)
#
# % define buildid .local
%define buildid .xendom0
###################################################################
# The buildid can also be specified on the rpmbuild command line
@ -130,7 +131,7 @@ Summary: The Linux kernel
%define doc_build_fail true
%endif
%define rawhide_skip_docs 0
%define rawhide_skip_docs 1
%if 0%{?rawhide_skip_docs}
%define with_doc 0
%define doc_build_fail true
@ -422,6 +423,11 @@ Summary: The Linux kernel
%define with_pae_debug %{with_debug}
%endif
%ifarch i686
%define with_up 0
%define with_debug 0
%endif
#
# Three sets of minimum package version requirements in the form of Conflicts:
# to versions below the minimum
@ -732,6 +738,18 @@ Patch12303: dmar-disable-when-ricoh-multifunction.patch
Patch12421: fs-call-security_d_instantiate-in-d_obtain_alias.patch
# Xen patches
# git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen.git branches
#Patch20000: xen.next-2.6.38.patch
#Patch20001: xen.upstream.core.patch
# git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git branches
#Patch20005: xen.pcifront.fixes.patch
Patch20006: xen.pcifront.next-2.6.38.patch
# build fix
Patch20007: p2mfix.patch
# git://xenbits.xen.org/people/sstabellini/linux-pvhvm branches
#Patch20010: xen.pvhvm.fixes.patch
%endif
BuildRoot: %{_tmppath}/kernel-%{KVERREL}-root
@ -1362,6 +1380,14 @@ ApplyPatch dmar-disable-when-ricoh-multifunction.patch
# rhbz#662344,600690
ApplyPatch fs-call-security_d_instantiate-in-d_obtain_alias.patch
# Xen patches
#ApplyPatch xen.next-2.6.38.patch
#ApplyPatch xen.upstream.core.patch
#ApplyPatch xen.pcifront.fixes.patch
ApplyPatch xen.pcifront.next-2.6.38.patch
ApplyPatch p2mfix.patch
#ApplyPatch xen.pvhvm.fixes.patch
# END OF PATCH APPLICATIONS
%endif
@ -1970,6 +1996,13 @@ fi
# and build.
%changelog
* Tue Mar 15 2011 Michael Young <m.a.young@durham.ac.uk>
- switch to single diff for pcifront.next-2.6.38.patch
for ease of maintenance
patch is git diff v2.6.38...3d67ff0c8f180f2cc4ade645f6f9571b26816e5a
- set new xen-blkback to be a module CONFIG_XEN_BLKDEV_BACKEND=m
- add patch to allow xen-blkback to build as module
* Tue Mar 15 2011 Adam Jackson <ajax@redhat.com>
- drm-intel-big-hammer.patch: Drop.
@ -2019,6 +2052,9 @@ fi
* Tue Mar 01 2011 Kyle McMartin <kmcmartin@redhat.com> 2.6.38-0.rc7.git0.1
- Linux 2.6.38-rc7
* Mon Feb 28 2011 Michael Young <m.a.young@durham.ac.uk>
- get updated devel/next-2.6.38
* Fri Feb 25 2011 Chuck Ebbert <cebbert@redhat.com> 2.6.38-0.rc6.git6.1
- Linux 2.6.38-rc6-git6
- Build in virtio_pci driver so virtio_console will be built-in (#677713)
@ -2036,6 +2072,9 @@ fi
* Wed Feb 23 2011 Ben Skeggs <bskeggs@redhat.com> 2.6.38-0.rc6.git0.2
- nouveau: nv4x pciegart fixes, nvc0 accel improvements
* Tue Feb 22 2011 Michael Young <m.a.young@durham.ac.uk>
- update devel/next-2.6.38 and fix a mis-edit
* Tue Feb 22 2011 Kyle McMartin <kmcmartin@redhat.com> 2.6.38-0.rc6.git0.1
- Linux 2.6.38-rc6
@ -2045,6 +2084,9 @@ fi
* Mon Feb 21 2011 Dave Jones <davej@redhat.com> 2.6.38-0.rc5.git6.1
- Linux 2.6.38-rc5-git6
* Sun Feb 20 2011 Michael Young <m.a.young@durham.ac.uk>
- Update devel/next-2.6.38
* Sat Feb 19 2011 Chuck Ebbert <cebbert@redhat.com> 2.6.38-0.rc5.git5.1
- Linux 2.6.38-rc5-git5
@ -2064,9 +2106,17 @@ fi
- Linux 2.6.38-rc4-git6
- Fix memory corruption caused by bug in bridge code.
* Fri Feb 11 2011 Michael Young <m.a.young@durham.ac.uk>
- Try Konrad's devel/next-2.6.38 instead of Jeremy's xen/next-2.6.38
which didn't boot last time
- Set options added by the switch XEN_DEBUG=n and XEN_GRANT_DEV_ALLOC=m
* Thu Feb 10 2011 Chuck Ebbert <cebbert@redhat.com> 2.6.38-0.rc4.git3.1
- Linux 2.6.38-rc4-git3
* Wed Feb 09 2011 Michael Young <m.a.young@durham.ac.uk>
- Update xen.next-2.6.38 to get updated net backend code
* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.6.38-0.rc4.git0.2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
@ -2090,6 +2140,9 @@ fi
* Wed Feb 02 2011 Chuck Ebbert <cebbert@redhat.com>
- Fix autoload of atl1c driver for latest hardware (#607499)
* Tue Feb 02 2011 Michael Young <m.a.young@durham.ac.uk>
- Update xen.next-2.6.38 and xen.pvhvm.fixes patches
* Tue Feb 01 2011 Chuck Ebbert <cebbert@redhat.com> 2.6.38-0.rc3.git0.1
- Linux 2.6.38-rc3
- Try to fix some obvious bugs in hfsplus mount failure handling (#673857)
@ -2114,9 +2167,21 @@ fi
- Linux 2.6.38-rc2-git5
- [x86] Re-enable TRANSPARENT_HUGEPAGE, should be fixed by cacf061c.
* Tue Jan 25 2011 Michael Young <m.a.young@durham.ac.uk>
- Actually include xen.pvhvm.fixes.patch
- Remove an upstream patch from xen.pvhvm.fixes.patch
* Tue Jan 25 2011 Kyle McMartin <kmcmartin@redhat.com> 2.6.38-0.rc2.git3.2
- [x86] Disable TRANSPARENT_HUGEPAGE for now, there be dragons there.
* Tue Jan 25 2011 Michael Young <m.a.young@durham.ac.uk>
- Switch from xen/next-2.6.37 to xen/next-2.6.38
which adds XEN_NETDEV_BACKEND and XEN_PCIDEV_BACKEND
- comment out xen.pcifront.fixes.patch (patches are in next-2.6.38)
- put 2.6.38-rc1-memory-fixes branch in xen.pvhvm.fixes.patch
for some memory fixes including a later version of the crash on boot patch
- don't build non-PAE debug kernel for i686
* Tue Jan 25 2011 Kyle McMartin <kmcmartin@redhat.com> 2.6.38-0.rc2.git3.1
- Linux 2.6.38-rc2-git3
- perf-gcc460-build-fixes.patch: fix context from [9486aa38]
@ -2138,6 +2203,12 @@ fi
- perf-gcc460-build-fixes.patch: fix build issues with warn-unused-but-set
in gcc 4.6.0
* Mon Jan 24 2011 Michael Young <m.a.young@durham.ac.uk>
- update to 2.6.38-rc
- Strip out upstream or conflicting patches from xen.next-2.6.37.patch
and xen.pcifront.fixes.patch
- Add a test patch to fix a crash on boot to xen.pcifront.fixes.patch
* Sat Jan 22 2011 Kyle McMartin <kmcmartin@redhat.com> 2.6.38-0.rc2.git0.1
- Linux 2.6.38-rc2
- linux-2.6-serial-460800.patch, drivers/serial => drivers/tty/serial
@ -2213,10 +2284,20 @@ fi
CAN_SLCAN=m
SCHED_AUTOGROUP=n
* Sun Jan 09 2011 Michael Young <m.a.young@durham.ac.uk>
- reorganize xen.pcifront.fixes.patch to be a combination of
stable/bug-fixes stable/generic and stable/irq.rework for fixes
in the previous stable/bug-fixes plus other fixes
also devel/ttm.pci-api.v3 for some KMS fixes
* Fri Jan 07 2011 Kyle McMartin <kmcmartin@redhat.com> 2.6.37-2
- drm_i915-check-eDP-encoder-correctly-when-setting-modes.patch reported to
fix HP/Sony eDP issues by adamw and airlied.
* Wed Jan 05 2011 Michael Young <m.a.young@durham.ac.uk>
- update xen.pcifront.fixes.patch with IRQ fixes from stable/bug-fixes branch
- skip docs - it seems to cause build failures at random points the moment.
* Wed Jan 05 2011 Dennis Gilmore <dennis@ausil.us>
- build sparc headers on sparcv9
@ -2230,6 +2311,9 @@ fi
- Linux 2.6.37-rc8-git3
- Merged acpi battery notification patch and -rc8.
* Tue Jan 01 2011 Michael Young <m.a.young@durham.ac.uk>
- update pvops to add some xenbus patches
* Thu Dec 23 2010 Kyle McMartin <kyle@redhat.com>
- Pull in flexcop procfs rename patch since it's still not upstream. (#664852)
@ -2267,6 +2351,9 @@ fi
* Wed Dec 15 2010 Kyle McMartin <kyle@redhat.com> 2.6.37-0.rc5.git5.1
- 2.6.37-rc5-git5
* Tue Dec 14 2010 Michael Young <m.a.young@durham.ac.uk>
- test an irq patch in xen.pcifront.fixes.patch
* Fri Dec 10 2010 Kyle McMartin <kyle@redhat.com>
- Another patch from mjg59: Set _OSC supported field correctly (#638912)
@ -2284,6 +2371,9 @@ fi
- sched-cure-more-NO_HZ-load-average-woes.patch: fix some of the complaints
in 2.6.35+ about load average with dynticks. (rhbz#650934)
* Wed Dec 08 2010 Michael Young <m.a.young@durham.ac.uk>
- Update the xen/next-2.6.37 patch and rebuild for rc5
* Tue Dec 07 2010 Kyle McMartin <kyle@redhat.com> 2.6.37-0.rc5.git0.1
- Linux 2.6.37-rc5
@ -2302,6 +2392,10 @@ fi
* Thu Dec 02 2010 Kyle McMartin <kyle@redhat.com>
- Grab some of Mel's fixes from -mmotm to hopefully sort out #649694.
* Thu Dec 02 2010 Michael Young <m.a.young@durham.ac.uk>
- Update the xen/next-2.6.37 patch and rebuild for rc4-git1
- xen-pcifront-fixes patch is now upstream
* Wed Dec 01 2010 Kyle McMartin <kyle@redhat.com> 2.6.37-0.rc4.git1.1
- Linux 2.6.37-rc4-git1
- Pull in DRM fixes that are queued for -rc5 [3074adc8]
@ -2334,6 +2428,9 @@ fi
* Wed Nov 24 2010 Kyle McMartin <kyle@redhat.com> 2.6.37-0.rc3.git1.1
- Linux 2.6.37-rc3-git1
* Mon Nov 22 2010 Michael Young <m.a.young@durham.ac.uk>
- Update the xen/next-2.6.37 patch and rebuild for rc3
* Mon Nov 22 2010 Kyle McMartin <kyle@redhat.com> 2.6.37-0.rc3.git0.1
- Linux 2.6.37-rc3
@ -2358,6 +2455,9 @@ fi
- Make vmlinuz/System.map root read-write only by default. You can just
chmod 644 them later if you (unlikely) need them without root.
* Tue Nov 16 2010 Michael Young <m.a.young@durham.ac.uk>
- Update the xen/next-2.6.37 and xen-pcifront-fixes patches
* Mon Nov 15 2010 Kyle McMartin <kyle@redhat.com> 2.6.37-0.1.rc2.git0
- Linux 2.6.37-rc2
@ -2368,6 +2468,13 @@ fi
you may use the kernel.dmesg_restrict sysctl.
- linux-2.6-bluetooth-autosuspend.patch: merged upstream.
* Fri Nov 12 2010 Michael Young <m.a.young@durham.ac.uk>
- Try again with xen patches from xen/next-2.6.37
- Build new XEN_GNTDEV option as a module
* Thu Nov 11 2010 Michael Young <m.a.young@durham.ac.uk>
- experiment with patch format by adding various xen bugfixes
* Tue Nov 09 2010 Kyle McMartin <kyle@redhat.com> 2.6.37-0.1.rc1.git7
- Linux 2.6.37-rc1-git7

18
p2mfix.patch Normal file
View File

@ -0,0 +1,18 @@
--- linux-2.6.38.x86_64/arch/x86/xen/p2m.c.orig 2011-03-15 19:51:44.000000000 +0000
+++ linux-2.6.38.x86_64/arch/x86/xen/p2m.c 2011-03-15 20:38:38.000000000 +0000
@@ -557,6 +557,7 @@
return 0;
}
+EXPORT_SYMBOL_GPL(m2p_add_override);
int m2p_remove_override(struct page *page, bool clear_pte)
{
@@ -594,6 +595,7 @@
return 0;
}
+EXPORT_SYMBOL_GPL(m2p_remove_override);
struct page *m2p_find_override(unsigned long mfn)
{

36944
xen.next-2.6.38.patch Normal file

File diff suppressed because it is too large Load Diff

688
xen.pcifront.fixes.patch Normal file
View File

@ -0,0 +1,688 @@
From 25c95c6ab7b9e257a60ac3eac73fa1acb120c692 Mon Sep 17 00:00:00 2001
From: Kenji Wakamiya <wkenji@jp.fujitsu.com>
Date: Tue, 14 Dec 2010 14:31:36 +0900
Subject: [PATCH 2/6] xen/manage: fix "xm save -c" issue
When using 'xm save -c' (which checkpoints the guest) on PV
guests, the dpms_resume_end() should be surpressed. It is OK
to make this call when doing 'xm save'.
Signed-off-by: Kenji Wakamiya <wkenji@jp.fujitsu.com>
Signed-off-by: Kazuhiro Suzuki <kaz@jp.fujitsu.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
drivers/xen/manage.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c
index db8c4c4..e32b9c0 100644
--- a/drivers/xen/manage.c
+++ b/drivers/xen/manage.c
@@ -145,11 +145,10 @@ out_resume:
if (!cancelled) {
xen_arch_resume();
xs_resume();
+ dpm_resume_end(PMSG_RESUME);
} else
xs_suspend_cancel();
- dpm_resume_end(PMSG_RESUME);
-
/* Make sure timer events get retriggered on all CPUs */
clock_was_set();
--
1.7.3.4
From 105aad363797212fbd2a4c887b723407c5851175 Mon Sep 17 00:00:00 2001
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date: Thu, 9 Dec 2010 15:01:11 -0500
Subject: [PATCH 2/2] xen/irq: Don't fall over when nr_irqs_gsi > nr_irqs.
This scenario where the nr_irq_gsi is greater than nr_irqs
is rather strange but lets still try to survive. Make sure
to print a warning so the user wouldn't be surprised in case
things don't work.
Solves a bootup-crash when booting Xen and Linux under QEMU.
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
drivers/xen/events.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index 4d4a23d..98b7220 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -411,6 +411,7 @@ static int find_unbound_irq(void)
if (bottom == nr_irqs)
goto no_irqs;
+retry:
/* This loop starts from the top of IRQ space and goes down.
* We need this b/c if we have a PCI device in a Xen PV guest
* we do not have an IO-APIC (though the backend might have them)
@@ -434,6 +435,14 @@ static int find_unbound_irq(void)
goto no_irqs;
res = irq_alloc_desc_at(irq, -1);
+ if (res == -EEXIST) {
+ top--;
+ if (bottom > top)
+ printk(KERN_ERR "Eating in GSI/MSI space (%d)!" \
+ " Your PCI device might not work!\n", top);
+ if (top > NR_IRQS_LEGACY)
+ goto retry;
+ }
if (WARN_ON(res != irq))
return -1;
--
1.7.3.4
From 3c6613fb55517f444358d07d2da9d39352d080d9 Mon Sep 17 00:00:00 2001
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date: Mon, 29 Nov 2010 13:52:18 -0500
Subject: [PATCH 1/5] ttm: Introduce a placeholder for DMA (bus) addresses.
This is right now limited to only non-pool constructs.
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
drivers/gpu/drm/ttm/ttm_page_alloc.c | 9 ++++++---
drivers/gpu/drm/ttm/ttm_tt.c | 10 ++++++++--
include/drm/ttm/ttm_bo_driver.h | 2 ++
include/drm/ttm/ttm_page_alloc.h | 8 ++++++--
4 files changed, 22 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c
index b1e02ff..6859288 100644
--- a/drivers/gpu/drm/ttm/ttm_page_alloc.c
+++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c
@@ -38,6 +38,7 @@
#include <linux/mm.h>
#include <linux/seq_file.h> /* for seq_printf */
#include <linux/slab.h>
+#include <linux/dma-mapping.h>
#include <asm/atomic.h>
@@ -662,7 +663,8 @@ out:
* cached pages.
*/
int ttm_get_pages(struct list_head *pages, int flags,
- enum ttm_caching_state cstate, unsigned count)
+ enum ttm_caching_state cstate, unsigned count,
+ dma_addr_t *dma_address)
{
struct ttm_page_pool *pool = ttm_get_pool(flags, cstate);
struct page *p = NULL;
@@ -720,7 +722,7 @@ int ttm_get_pages(struct list_head *pages, int flags,
printk(KERN_ERR TTM_PFX
"Failed to allocate extra pages "
"for large request.");
- ttm_put_pages(pages, 0, flags, cstate);
+ ttm_put_pages(pages, 0, flags, cstate, NULL);
return r;
}
}
@@ -731,7 +733,8 @@ int ttm_get_pages(struct list_head *pages, int flags,
/* Put all pages in pages list to correct pool to wait for reuse */
void ttm_put_pages(struct list_head *pages, unsigned page_count, int flags,
- enum ttm_caching_state cstate)
+ enum ttm_caching_state cstate,
+ dma_addr_t *dma_address)
{
unsigned long irq_flags;
struct ttm_page_pool *pool = ttm_get_pool(flags, cstate);
diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c
index af789dc..0d39001 100644
--- a/drivers/gpu/drm/ttm/ttm_tt.c
+++ b/drivers/gpu/drm/ttm/ttm_tt.c
@@ -49,12 +49,16 @@ static int ttm_tt_swapin(struct ttm_tt *ttm);
static void ttm_tt_alloc_page_directory(struct ttm_tt *ttm)
{
ttm->pages = drm_calloc_large(ttm->num_pages, sizeof(*ttm->pages));
+ ttm->dma_address = drm_calloc_large(ttm->num_pages,
+ sizeof(*ttm->dma_address));
}
static void ttm_tt_free_page_directory(struct ttm_tt *ttm)
{
drm_free_large(ttm->pages);
ttm->pages = NULL;
+ drm_free_large(ttm->dma_address);
+ ttm->dma_address = NULL;
}
static void ttm_tt_free_user_pages(struct ttm_tt *ttm)
@@ -105,7 +109,8 @@ static struct page *__ttm_tt_get_page(struct ttm_tt *ttm, int index)
INIT_LIST_HEAD(&h);
- ret = ttm_get_pages(&h, ttm->page_flags, ttm->caching_state, 1);
+ ret = ttm_get_pages(&h, ttm->page_flags, ttm->caching_state, 1,
+ &ttm->dma_address[index]);
if (ret != 0)
return NULL;
@@ -298,7 +303,8 @@ static void ttm_tt_free_alloced_pages(struct ttm_tt *ttm)
count++;
}
}
- ttm_put_pages(&h, count, ttm->page_flags, ttm->caching_state);
+ ttm_put_pages(&h, count, ttm->page_flags, ttm->caching_state,
+ ttm->dma_address);
ttm->state = tt_unpopulated;
ttm->first_himem_page = ttm->num_pages;
ttm->last_lomem_page = -1;
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h
index 8e0c848..6dc4fcc 100644
--- a/include/drm/ttm/ttm_bo_driver.h
+++ b/include/drm/ttm/ttm_bo_driver.h
@@ -149,6 +149,7 @@ enum ttm_caching_state {
* @swap_storage: Pointer to shmem struct file for swap storage.
* @caching_state: The current caching state of the pages.
* @state: The current binding state of the pages.
+ * @dma_address: The DMA (bus) addresses of the pages (if TTM_PAGE_FLAG_DMA32)
*
* This is a structure holding the pages, caching- and aperture binding
* status for a buffer object that isn't backed by fixed (VRAM / AGP)
@@ -173,6 +174,7 @@ struct ttm_tt {
tt_unbound,
tt_unpopulated,
} state;
+ dma_addr_t *dma_address;
};
#define TTM_MEMTYPE_FLAG_FIXED (1 << 0) /* Fixed (on-card) PCI memory */
diff --git a/include/drm/ttm/ttm_page_alloc.h b/include/drm/ttm/ttm_page_alloc.h
index 1168214..8062890 100644
--- a/include/drm/ttm/ttm_page_alloc.h
+++ b/include/drm/ttm/ttm_page_alloc.h
@@ -36,11 +36,13 @@
* @flags: ttm flags for page allocation.
* @cstate: ttm caching state for the page.
* @count: number of pages to allocate.
+ * @dma_address: The DMA (bus) address of pages (if TTM_PAGE_FLAG_DMA32 set).
*/
int ttm_get_pages(struct list_head *pages,
int flags,
enum ttm_caching_state cstate,
- unsigned count);
+ unsigned count,
+ dma_addr_t *dma_address);
/**
* Put linked list of pages to pool.
*
@@ -49,11 +51,13 @@ int ttm_get_pages(struct list_head *pages,
* count.
* @flags: ttm flags for page allocation.
* @cstate: ttm caching state.
+ * @dma_address: The DMA (bus) address of pages (if TTM_PAGE_FLAG_DMA32 set).
*/
void ttm_put_pages(struct list_head *pages,
unsigned page_count,
int flags,
- enum ttm_caching_state cstate);
+ enum ttm_caching_state cstate,
+ dma_addr_t *dma_address);
/**
* Initialize pool allocator.
*/
--
1.7.3.4
From 6ea9ff7ffcfce13d16110c85e002f07b57c8894e Mon Sep 17 00:00:00 2001
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date: Mon, 29 Nov 2010 14:03:30 -0500
Subject: [PATCH 2/5] tm: Utilize the dma_addr_t array for pages that are to in DMA32 pool.
We only use the "if (pool == NULL)" path for right now.
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
drivers/gpu/drm/ttm/ttm_page_alloc.c | 26 +++++++++++++++++++++++---
1 files changed, 23 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c
index 6859288..5d09677 100644
--- a/drivers/gpu/drm/ttm/ttm_page_alloc.c
+++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c
@@ -683,14 +683,22 @@ int ttm_get_pages(struct list_head *pages, int flags,
gfp_flags |= GFP_HIGHUSER;
for (r = 0; r < count; ++r) {
- p = alloc_page(gfp_flags);
+ if ((flags & TTM_PAGE_FLAG_DMA32) && dma_address) {
+ void *addr;
+ addr = dma_alloc_coherent(NULL, PAGE_SIZE,
+ &dma_address[r],
+ gfp_flags);
+ if (addr == NULL)
+ return -ENOMEM;
+ p = virt_to_page(addr);
+ } else
+ p = alloc_page(gfp_flags);
if (!p) {
printk(KERN_ERR TTM_PFX
"Unable to allocate page.");
return -ENOMEM;
}
-
list_add(&p->lru, pages);
}
return 0;
@@ -739,12 +747,24 @@ void ttm_put_pages(struct list_head *pages, unsigned page_count, int flags,
unsigned long irq_flags;
struct ttm_page_pool *pool = ttm_get_pool(flags, cstate);
struct page *p, *tmp;
+ unsigned r;
if (pool == NULL) {
/* No pool for this memory type so free the pages */
+ r = page_count-1;
list_for_each_entry_safe(p, tmp, pages, lru) {
- __free_page(p);
+ if ((flags & TTM_PAGE_FLAG_DMA32) && dma_address) {
+ void *addr = page_address(p);
+ WARN_ON(!addr || !dma_address[r]);
+ if (addr)
+ dma_free_coherent(NULL, PAGE_SIZE,
+ addr,
+ dma_address[r]);
+ dma_address[r] = 0;
+ } else
+ __free_page(p);
+ r--;
}
/* Make the pages list empty */
INIT_LIST_HEAD(pages);
--
1.7.3.4
From f6d1461c3203cad0655d97674104547f2cc7a624 Mon Sep 17 00:00:00 2001
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date: Thu, 2 Dec 2010 10:24:13 -0500
Subject: [PATCH 3/5] ttm: Expand (*populate) to support an array of DMA addresses.
We pass in the array of ttm pages to be populated in the GART/MM
of the card (or AGP). Patch titled: "ttm: Utilize the dma_addr_t array
for pages that are to in DMA32 pool." uses the DMA API to make those
pages have a proper DMA addresses (in the situation where
page_to_phys or virt_to_phys do not give use the DMA (bus) address).
Since we are using the DMA API on those pages, we should pass in the
DMA address to this function so it can save it in its proper fields
(later patches use it).
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
drivers/gpu/drm/nouveau/nouveau_sgdma.c | 3 ++-
drivers/gpu/drm/radeon/radeon_ttm.c | 3 ++-
drivers/gpu/drm/ttm/ttm_agp_backend.c | 3 ++-
drivers/gpu/drm/ttm/ttm_tt.c | 2 +-
drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c | 3 ++-
include/drm/ttm/ttm_bo_driver.h | 4 +++-
6 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/nouveau_sgdma.c b/drivers/gpu/drm/nouveau/nouveau_sgdma.c
index 288baca..edc140a 100644
--- a/drivers/gpu/drm/nouveau/nouveau_sgdma.c
+++ b/drivers/gpu/drm/nouveau/nouveau_sgdma.c
@@ -20,7 +20,8 @@ struct nouveau_sgdma_be {
static int
nouveau_sgdma_populate(struct ttm_backend *be, unsigned long num_pages,
- struct page **pages, struct page *dummy_read_page)
+ struct page **pages, struct page *dummy_read_page,
+ dma_addr_t *dma_addrs)
{
struct nouveau_sgdma_be *nvbe = (struct nouveau_sgdma_be *)be;
struct drm_device *dev = nvbe->dev;
diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
index 01c2c73..6f156e9 100644
--- a/drivers/gpu/drm/radeon/radeon_ttm.c
+++ b/drivers/gpu/drm/radeon/radeon_ttm.c
@@ -655,7 +655,8 @@ struct radeon_ttm_backend {
static int radeon_ttm_backend_populate(struct ttm_backend *backend,
unsigned long num_pages,
struct page **pages,
- struct page *dummy_read_page)
+ struct page *dummy_read_page,
+ dma_addr_t *dma_addrs)
{
struct radeon_ttm_backend *gtt;
diff --git a/drivers/gpu/drm/ttm/ttm_agp_backend.c b/drivers/gpu/drm/ttm/ttm_agp_backend.c
index f999e36..1c4a72f 100644
--- a/drivers/gpu/drm/ttm/ttm_agp_backend.c
+++ b/drivers/gpu/drm/ttm/ttm_agp_backend.c
@@ -47,7 +47,8 @@ struct ttm_agp_backend {
static int ttm_agp_populate(struct ttm_backend *backend,
unsigned long num_pages, struct page **pages,
- struct page *dummy_read_page)
+ struct page *dummy_read_page,
+ dma_addr_t *dma_addrs)
{
struct ttm_agp_backend *agp_be =
container_of(backend, struct ttm_agp_backend, backend);
diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c
index 0d39001..86d5b17 100644
--- a/drivers/gpu/drm/ttm/ttm_tt.c
+++ b/drivers/gpu/drm/ttm/ttm_tt.c
@@ -169,7 +169,7 @@ int ttm_tt_populate(struct ttm_tt *ttm)
}
be->func->populate(be, ttm->num_pages, ttm->pages,
- ttm->dummy_read_page);
+ ttm->dummy_read_page, ttm->dma_address);
ttm->state = tt_unbound;
return 0;
}
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c b/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c
index 80bc37b..87e43e0 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c
@@ -102,7 +102,8 @@ struct vmw_ttm_backend {
static int vmw_ttm_populate(struct ttm_backend *backend,
unsigned long num_pages, struct page **pages,
- struct page *dummy_read_page)
+ struct page *dummy_read_page,
+ dma_addr_t *dma_addrs)
{
struct vmw_ttm_backend *vmw_be =
container_of(backend, struct vmw_ttm_backend, backend);
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h
index 6dc4fcc..ebcd3dd 100644
--- a/include/drm/ttm/ttm_bo_driver.h
+++ b/include/drm/ttm/ttm_bo_driver.h
@@ -50,13 +50,15 @@ struct ttm_backend_func {
* @pages: Array of pointers to ttm pages.
* @dummy_read_page: Page to be used instead of NULL pages in the
* array @pages.
+ * @dma_addrs: Array of DMA (bus) address of the ttm pages.
*
* Populate the backend with ttm pages. Depending on the backend,
* it may or may not copy the @pages array.
*/
int (*populate) (struct ttm_backend *backend,
unsigned long num_pages, struct page **pages,
- struct page *dummy_read_page);
+ struct page *dummy_read_page,
+ dma_addr_t *dma_addrs);
/**
* struct ttm_backend_func member clear
*
--
1.7.3.4
From 2c88605f61ea99179e67e341f0ba4c8e8f356542 Mon Sep 17 00:00:00 2001
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date: Thu, 2 Dec 2010 11:04:29 -0500
Subject: [PATCH 4/5] radeon/ttm/PCIe: Use dma_addr if TTM has set it.
If the TTM layer has used the DMA API to setup pages that are
TTM_PAGE_FLAG_DMA32 (look at patch titled: "ttm: Utilize the dma_addr_t
array for pages that are to in DMA32 pool."), lets use it
when programming the GART in the PCIe type cards.
This patch skips doing the pci_map_page (and pci_unmap_page) if
there is a DMA addresses passed in for that page. If the dma_address
is zero (or DMA_ERROR_CODE), then we continue on with our old
behaviour.
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
drivers/gpu/drm/radeon/radeon.h | 4 ++-
drivers/gpu/drm/radeon/radeon_gart.c | 36 ++++++++++++++++++++++++---------
drivers/gpu/drm/radeon/radeon_ttm.c | 5 +++-
3 files changed, 33 insertions(+), 12 deletions(-)
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index 73f600d..c9bbab9 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -317,6 +317,7 @@ struct radeon_gart {
union radeon_gart_table table;
struct page **pages;
dma_addr_t *pages_addr;
+ bool *ttm_alloced;
bool ready;
};
@@ -329,7 +330,8 @@ void radeon_gart_fini(struct radeon_device *rdev);
void radeon_gart_unbind(struct radeon_device *rdev, unsigned offset,
int pages);
int radeon_gart_bind(struct radeon_device *rdev, unsigned offset,
- int pages, struct page **pagelist);
+ int pages, struct page **pagelist,
+ dma_addr_t *dma_addr);
/*
diff --git a/drivers/gpu/drm/radeon/radeon_gart.c b/drivers/gpu/drm/radeon/radeon_gart.c
index e65b903..4a5ac4b 100644
--- a/drivers/gpu/drm/radeon/radeon_gart.c
+++ b/drivers/gpu/drm/radeon/radeon_gart.c
@@ -149,8 +149,9 @@ void radeon_gart_unbind(struct radeon_device *rdev, unsigned offset,
p = t / (PAGE_SIZE / RADEON_GPU_PAGE_SIZE);
for (i = 0; i < pages; i++, p++) {
if (rdev->gart.pages[p]) {
- pci_unmap_page(rdev->pdev, rdev->gart.pages_addr[p],
- PAGE_SIZE, PCI_DMA_BIDIRECTIONAL);
+ if (!rdev->gart.ttm_alloced[p])
+ pci_unmap_page(rdev->pdev, rdev->gart.pages_addr[p],
+ PAGE_SIZE, PCI_DMA_BIDIRECTIONAL);
rdev->gart.pages[p] = NULL;
rdev->gart.pages_addr[p] = rdev->dummy_page.addr;
page_base = rdev->gart.pages_addr[p];
@@ -165,7 +166,7 @@ void radeon_gart_unbind(struct radeon_device *rdev, unsigned offset,
}
int radeon_gart_bind(struct radeon_device *rdev, unsigned offset,
- int pages, struct page **pagelist)
+ int pages, struct page **pagelist, dma_addr_t *dma_addr)
{
unsigned t;
unsigned p;
@@ -180,15 +181,22 @@ int radeon_gart_bind(struct radeon_device *rdev, unsigned offset,
p = t / (PAGE_SIZE / RADEON_GPU_PAGE_SIZE);
for (i = 0; i < pages; i++, p++) {
- /* we need to support large memory configurations */
- /* assume that unbind have already been call on the range */
- rdev->gart.pages_addr[p] = pci_map_page(rdev->pdev, pagelist[i],
+ /* On TTM path, we only use the DMA API if TTM_PAGE_FLAG_DMA32
+ * is requested. */
+ if (dma_addr[i] != DMA_ERROR_CODE) {
+ rdev->gart.ttm_alloced[p] = true;
+ rdev->gart.pages_addr[p] = dma_addr[i];
+ } else {
+ /* we need to support large memory configurations */
+ /* assume that unbind have already been call on the range */
+ rdev->gart.pages_addr[p] = pci_map_page(rdev->pdev, pagelist[i],
0, PAGE_SIZE,
PCI_DMA_BIDIRECTIONAL);
- if (pci_dma_mapping_error(rdev->pdev, rdev->gart.pages_addr[p])) {
- /* FIXME: failed to map page (return -ENOMEM?) */
- radeon_gart_unbind(rdev, offset, pages);
- return -ENOMEM;
+ if (pci_dma_mapping_error(rdev->pdev, rdev->gart.pages_addr[p])) {
+ /* FIXME: failed to map page (return -ENOMEM?) */
+ radeon_gart_unbind(rdev, offset, pages);
+ return -ENOMEM;
+ }
}
rdev->gart.pages[p] = pagelist[i];
page_base = rdev->gart.pages_addr[p];
@@ -251,6 +259,12 @@ int radeon_gart_init(struct radeon_device *rdev)
radeon_gart_fini(rdev);
return -ENOMEM;
}
+ rdev->gart.ttm_alloced = kzalloc(sizeof(bool) *
+ rdev->gart.num_cpu_pages, GFP_KERNEL);
+ if (rdev->gart.ttm_alloced == NULL) {
+ radeon_gart_fini(rdev);
+ return -ENOMEM;
+ }
/* set GART entry to point to the dummy page by default */
for (i = 0; i < rdev->gart.num_cpu_pages; i++) {
rdev->gart.pages_addr[i] = rdev->dummy_page.addr;
@@ -267,6 +281,8 @@ void radeon_gart_fini(struct radeon_device *rdev)
rdev->gart.ready = false;
kfree(rdev->gart.pages);
kfree(rdev->gart.pages_addr);
+ kfree(rdev->gart.ttm_alloced);
rdev->gart.pages = NULL;
rdev->gart.pages_addr = NULL;
+ rdev->gart.ttm_alloced = NULL;
}
diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
index 6f156e9..ca04505 100644
--- a/drivers/gpu/drm/radeon/radeon_ttm.c
+++ b/drivers/gpu/drm/radeon/radeon_ttm.c
@@ -647,6 +647,7 @@ struct radeon_ttm_backend {
unsigned long num_pages;
struct page **pages;
struct page *dummy_read_page;
+ dma_addr_t *dma_addrs;
bool populated;
bool bound;
unsigned offset;
@@ -662,6 +663,7 @@ static int radeon_ttm_backend_populate(struct ttm_backend *backend,
gtt = container_of(backend, struct radeon_ttm_backend, backend);
gtt->pages = pages;
+ gtt->dma_addrs = dma_addrs;
gtt->num_pages = num_pages;
gtt->dummy_read_page = dummy_read_page;
gtt->populated = true;
@@ -674,6 +676,7 @@ static void radeon_ttm_backend_clear(struct ttm_backend *backend)
gtt = container_of(backend, struct radeon_ttm_backend, backend);
gtt->pages = NULL;
+ gtt->dma_addrs = NULL;
gtt->num_pages = 0;
gtt->dummy_read_page = NULL;
gtt->populated = false;
@@ -694,7 +697,7 @@ static int radeon_ttm_backend_bind(struct ttm_backend *backend,
gtt->num_pages, bo_mem, backend);
}
r = radeon_gart_bind(gtt->rdev, gtt->offset,
- gtt->num_pages, gtt->pages);
+ gtt->num_pages, gtt->pages, gtt->dma_addrs);
if (r) {
DRM_ERROR("failed to bind %lu pages at 0x%08X\n",
gtt->num_pages, gtt->offset);
--
1.7.3.4
From b5f054f501d394d6e6064c9227db2927a3014d06 Mon Sep 17 00:00:00 2001
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date: Thu, 2 Dec 2010 11:36:24 -0500
Subject: [PATCH 5/5] nouveau/ttm/PCIe: Use dma_addr if TTM has set it.
If the TTM layer has used the DMA API to setup pages that are
TTM_PAGE_FLAG_DMA32 (look at patch titled: "ttm: Utilize the dma_addr_t
array for pages that are to in DMA32 pool."), lets use it
when programming the GART in the PCIe type cards.
This patch skips doing the pci_map_page (and pci_unmap_page) if
there is a DMA addresses passed in for that page. If the dma_address
is zero (or DMA_ERROR_CODE), then we continue on with our old
behaviour.
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
drivers/gpu/drm/nouveau/nouveau_sgdma.c | 28 +++++++++++++++++++++-------
1 files changed, 21 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/nouveau_sgdma.c b/drivers/gpu/drm/nouveau/nouveau_sgdma.c
index edc140a..bbdd982 100644
--- a/drivers/gpu/drm/nouveau/nouveau_sgdma.c
+++ b/drivers/gpu/drm/nouveau/nouveau_sgdma.c
@@ -12,6 +12,7 @@ struct nouveau_sgdma_be {
struct drm_device *dev;
dma_addr_t *pages;
+ bool *ttm_alloced;
unsigned nr_pages;
unsigned pte_start;
@@ -35,15 +36,25 @@ nouveau_sgdma_populate(struct ttm_backend *be, unsigned long num_pages,
if (!nvbe->pages)
return -ENOMEM;
+ nvbe->ttm_alloced = kmalloc(sizeof(bool) * num_pages, GFP_KERNEL);
+ if (!nvbe->ttm_alloced)
+ return -ENOMEM;
+
nvbe->nr_pages = 0;
while (num_pages--) {
- nvbe->pages[nvbe->nr_pages] =
- pci_map_page(dev->pdev, pages[nvbe->nr_pages], 0,
+ if (dma_addrs[nvbe->nr_pages] != DMA_ERROR_CODE) {
+ nvbe->pages[nvbe->nr_pages] =
+ dma_addrs[nvbe->nr_pages];
+ nvbe->ttm_alloced[nvbe->nr_pages] = true;
+ } else {
+ nvbe->pages[nvbe->nr_pages] =
+ pci_map_page(dev->pdev, pages[nvbe->nr_pages], 0,
PAGE_SIZE, PCI_DMA_BIDIRECTIONAL);
- if (pci_dma_mapping_error(dev->pdev,
- nvbe->pages[nvbe->nr_pages])) {
- be->func->clear(be);
- return -EFAULT;
+ if (pci_dma_mapping_error(dev->pdev,
+ nvbe->pages[nvbe->nr_pages])) {
+ be->func->clear(be);
+ return -EFAULT;
+ }
}
nvbe->nr_pages++;
@@ -66,11 +77,14 @@ nouveau_sgdma_clear(struct ttm_backend *be)
be->func->unbind(be);
while (nvbe->nr_pages--) {
- pci_unmap_page(dev->pdev, nvbe->pages[nvbe->nr_pages],
+ if (!nvbe->ttm_alloced[nvbe->nr_pages])
+ pci_unmap_page(dev->pdev, nvbe->pages[nvbe->nr_pages],
PAGE_SIZE, PCI_DMA_BIDIRECTIONAL);
}
kfree(nvbe->pages);
+ kfree(nvbe->ttm_alloced);
nvbe->pages = NULL;
+ nvbe->ttm_alloced = NULL;
nvbe->nr_pages = 0;
}
}
--
1.7.3.4
--- a/arch/x86/xen/setup.c 2011-01-05 00:50:19.000000000 +0000
+++ b/arch/x86/xen/setup.c 2011-01-24 20:29:23.000000000 +0000
@@ -179,7 +179,10 @@
e820.nr_map = 0;
xen_extra_mem_start = mem_end;
for (i = 0; i < memmap.nr_entries; i++) {
- unsigned long long end = map[i].addr + map[i].size;
+ unsigned long long end;
+ if (map[i].type == E820_RAM)
+ map[i].size &= ~(PAGE_SIZE-1);
+ end = map[i].addr + map[i].size;
if (map[i].type == E820_RAM && end > mem_end) {
/* RAM off the end - may be partially included */

15284
xen.pcifront.next-2.6.38.patch Normal file

File diff suppressed because it is too large Load Diff

73
xen.pvhvm.fixes.patch Normal file
View File

@ -0,0 +1,73 @@
From 20fddbd4510f3a3888cccc64f89862168a2b7528 Mon Sep 17 00:00:00 2001
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date: Fri, 14 Jan 2011 17:55:44 -0500
Subject: [PATCH 1/4] m2p: No need to catch exceptions when we know that there is no RAM
.. beyound what we think is the end of memory. However there might
be more System RAM - but assigned to a guest. Hence jump to the
M2P override check and consult.
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
arch/x86/include/asm/xen/page.h | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/arch/x86/include/asm/xen/page.h b/arch/x86/include/asm/xen/page.h
index f25bdf2..74a8559 100644
--- a/arch/x86/include/asm/xen/page.h
+++ b/arch/x86/include/asm/xen/page.h
@@ -77,6 +77,10 @@ static inline unsigned long mfn_to_pfn(unsigned long mfn)
if (xen_feature(XENFEAT_auto_translated_physmap))
return mfn;
+ if (unlikely((mfn >> machine_to_phys_order) != 0)) {
+ pfn = ~0;
+ goto try_override;
+ }
pfn = 0;
/*
* The array access can fail (e.g., device space beyond end of RAM).
@@ -84,7 +88,7 @@ static inline unsigned long mfn_to_pfn(unsigned long mfn)
* but we must handle the fault without crashing!
*/
__get_user(pfn, &machine_to_phys_mapping[mfn]);
-
+try_override:
/*
* If this appears to be a foreign mfn (because the pfn
* doesn't map back to the mfn), then check the local override
--
1.7.3.5
From a89d6bd5cfa1ba3b27d7ba2dc664975a0560fb15 Mon Sep 17 00:00:00 2001
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Tue, 25 Jan 2011 12:05:11 +0000
Subject: [PATCH 3/4] When destroying mappings between _brk_end and _end, do not go over _end
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
arch/x86/mm/init.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
index 947f42a..c7263c9 100644
--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -291,10 +291,11 @@ unsigned long __init_refok init_memory_mapping(unsigned long start,
* located on different 2M pages. cleanup_highmap(), however,
* can only consider _end when it runs, so destroy any
* mappings beyond _brk_end here.
+ * Be careful not to go over _end.
*/
pud = pud_offset(pgd_offset_k(_brk_end), _brk_end);
pmd = pmd_offset(pud, _brk_end - 1);
- while (++pmd <= pmd_offset(pud, (unsigned long)_end - 1))
+ while (++pmd < pmd_offset(pud, (unsigned long)_end))
pmd_clear(pmd);
}
#endif
--
1.7.3.5