Keir Fraser [Mon, 29 Oct 2007 17:43:33 +0000 (17:43 +0000)]
cpufreq: Xen support for the ondemand governor in Linux dom0
Modify the cpufreq ondemand governor so that it can get idle and
total nsecs from the Xen hypervisor. Xen uses nsecs to measure
idle time, while Linux uses ticks. Other than accounting for
that difference, use the same algorithm to calculate idle time.
Signed-off-by: Mark Langsdorf <mark.langsdorf@amd.com>
Keir Fraser [Thu, 25 Oct 2007 15:15:18 +0000 (16:15 +0100)]
linux: panic/shutdown handling adjustments
Prevent interrupts (and hence possibly scheduler operations) from
occuring on (against) a CPU after removing it from cpu_online_map
during panic/shutdown.
(Background: I found it quite annoying to see scheduler related
badness or BUG messages after a panic, eventually even leading to
important information scrolling off the screen.)
Keir Fraser [Wed, 24 Oct 2007 16:17:09 +0000 (17:17 +0100)]
linux/x86: use sysenter/syscall for 32-bit apps on 64-bit Xen
for both 32-bit apps on 64-bit kernels and 32bit kernels.
Also removing the needless re-enabling of events on x86-64's 64-bit
syscall path as well as it's 32-bit int80 path (the latter accompanied
by telling Xen not to disable them in the first place).
Signed-off-by: Jan Beulich <jbeulich@novell.com> Signed-off-by: Keir Fraser <keir@xensource.com>
Ian Campbell [Wed, 17 Oct 2007 08:24:03 +0000 (09:24 +0100)]
xfs: eagerly remove vmap mappings to avoid upsetting Xen
XFS leaves stray mappings around when it vmaps memory to make it
virtually contigious. This upsets Xen if one of those pages is being
recycled into a pagetable, since it finds an extra writable mapping of
the page.
This patch solves the problem in a brute force way, by making XFS
always eagerly unmap its mappings. David Chinner says this shouldn't
have any performance impact on filesystems with default block sizes;
it will only affect filesystems with large block sizes.
Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com> Acked-by: David Chinner <dgc@sgi.com> Cc: Nick Piggin <nickpiggin@yahoo.com.au> Cc: XFS masters <xfs-masters@oss.sgi.com> Cc: Stable kernel <stable@kernel.org> Cc: Morten =?utf-8?q?B=C3=B8geskov?= <xen-users@morten.bogeskov.dk> Cc: Mark Williamson <mark.williamson@cl.cam.ac.uk>
---
fs/xfs/linux-2.6/xfs_buf.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
Keir Fraser [Fri, 12 Oct 2007 11:08:17 +0000 (12:08 +0100)]
linux/x86: retrieve VESA capabilities in dom0
Also, move some more common code to dom0_init_screen_info(). Signed-off-by: Jan Beulich <jbeulich@novell.com>
Keir Fraser [Wed, 10 Oct 2007 10:32:15 +0000 (11:32 +0100)]
Check that awk supports 'gensub' command.
The linux-2.6.18-xen.hg/scripts/Makefile.xen.awk script depends on the
GNU AWK-specific function "gensub". If another awk is used (e.g.,
Debian installs mawk by default), the lack of gensub trickles down to
cause the -xen.c files to not be compiled. This was time-consuming to
track. So we should check that the awk program supports 'gensub'.
Signed-off-by: Michael Abd-El-Malek <mabdelmalek@cmu.edu>
Alex Williamson [Thu, 27 Sep 2007 20:49:14 +0000 (14:49 -0600)]
[IA64] Kdump: Add /proc/iomem_machine
Add /proc/iomem_machine. This is basically the iomem regions
as the hypervisor sees them. As opposed to Linux's /proc/iomem
which is provides a somewhat limited and distorted view of the world.
Or in other words, /proc/iomem is for pseudo-phical memory and
/proc/iomem_machine is for machine memory.
This is needed for kdump to work on ia64 as else it can't place
the crashkernel region correctly, nor can it map out all physical
memory to be included in the vmcore file in the second kernel.
There is an acompanying patch to kexec-tools to allow it
to use /proc/iomem_machine instead of /proc/iomem as appropriate.
Alex Williamson [Thu, 27 Sep 2007 20:37:22 +0000 (14:37 -0600)]
[IA64] Kdump: Use the machine address for the boot params region
The boot params region needs to be placed using the machine
address not the physical address. This is because it represents
an area of memory that is reserved in the hypervisor and it is
critical that the same area of machine memory is not trampled
over during kexec.
Alex Williamson [Thu, 27 Sep 2007 20:34:42 +0000 (14:34 -0600)]
[IA64] Kexec: machine addresss macros
Define IA64-specific macros for kexec to find the machine address
of a virtual address etc... This abstraction was hammered out
during the merge of the x86 code.
There seems to be a value in both allowing the kernel to determine
the base offset of the crashkernel automatically and allowing
users's to sepcify it.
The old behaviour on ia64, which is still the current behaviour on
most architectures is for the user to always specify the address.
Recently ia64 was changed so that it is always automatically determined.
With this patch the kernel automatically determines the offset if
the supplied value is 0, otherwise it uses the value provided.
This should probably be backed by a documentation change.
Signed-Off-By: Simon Horman <horms@verge.net.au> Signed-off-by: Tony Luck <tony.luck@intel.com>
Actually, on reflection I think that there is a good case for
keeping the options separate. I am thinking particularly of people
who want a very small crashdump kernel and thus don't want to compile
in kexec.
The patch below should fix things up so that all valid combinations of
KEXEC, CRASH_DUMP and VMCORE compile cleanly - VMCORE depends on
CRASH_DUMP which is why I said valid combinations. In a nutshell
it just untangles unrelated code and switches around a few defines.
Please note that it creats a new file, arch/ia64/kernel/crash_dump.c
This is in keeping with the i386 implementation.
Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: Tony Luck <tony.luck@intel.com>
Alex Williamson [Thu, 27 Sep 2007 19:40:11 +0000 (13:40 -0600)]
[IA64] ia64 kexec/kdump backport
From: Simon Horman <horms@verge.net.au>
* From Linux Upstream, commit a79561134f38de12dce14ed72138f38e55ef53fc
* Trivial backport to linux-2.6.18-xen of the following hunks
* arch/ia64/kernel/mca.c: hunk 2
* include/asm-ia64/machvec.h: hunks 1 & 2
* include/asm-ia64/machvec_sn2.h: hunk 1
* meminit.h
[IA64] IA64 Kexec/kdump
Changes and updates.
1. Remove fake rendz path and related code according to discuss with Khalid Aziz.
2. fc.i offset fix in relocate_kernel.S.
3. iospic shutdown code eoi and mask race fix from Fujitsu.
4. Warm boot hook in machine_kexec to SN SAL code from Jack Steiner.
5. Send slave to SAL slave loop patch from Jay Lan.
6. Kdump on non-recoverable MCA event patch from Jay Lan
7. Use CTL_UNNUMBERED in kdump_on_init sysctl.
Signed-off-by: Zou Nan hai <nanhai.zou@intel.com> Signed-off-by: Tony Luck <tony.luck@intel.com>
Alex Williamson [Thu, 27 Sep 2007 19:33:50 +0000 (13:33 -0600)]
[IA64] Initialise xen_start_info earlier in setup_arch()
xen_start_info needs to be set before efi_init() is called on ia64
because xen_machine_kexec_setup_resources() is indirectly
called by efi_init() and it needs a working is_initial_xendomain();
One more of these issues (which were considered fixed): Other than on
x86-64, i386 allows set_fixmap() to replace already present mappings.
Consequently, on PAE, care must be taken to not update the high half
of a pte while the low half is still holding the old value.
This is a backport of some code for Linux that is needed by
my backport of kexec to IA64 xen.
From: Simon Horman <horms@verge.net.au>
sysctl: implement CTL_UNNUMBERED
This patch takes the CTL_UNNUMBERD concept from NFS and makes it
available to all new sysctl users.
At the same time the sysctl binary interface maintenance documentation
is updated to mention and to describe what is needed to successfully
maintain the sysctl binary interface.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Acked-by: Alan Cox <alan@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
linux/x86: match native behavior of 'make install'
Placement of the final image and handling of the install process
should match native (whether to implicitly create an initrd is just
one example). This includes there not being a need for a special
boot-xen subdirectory and more unification of arch/*/Makefile pieces.
Alex Williamson [Wed, 12 Sep 2007 15:38:50 +0000 (09:38 -0600)]
[IA64] Minor fix of xcom_hcall.c for pv-on-hvm.
- compilation fix.
hypercall.h shouldn't be included directly. intead include hypervisor.h
- In RHEL4U4, insmod xen-platform-pci.ko failed with these patches.
xen_platform_pci: Unknown symbol xencomm_arch_hypercall_suspend
comment out xencomm_hypercall_suspend() because suspend hypercall isn't
necessary for VTi domain.
Add the CDROM_GET_CAPABILITY ioctl to blkfront.
Return 0 instead of -EINVAL if the blkfront device is a cdrom,
i.e. had the VDISK_CDROM attribute. This allows udev's cdrom_id
to correctly detect the device as a cdrom device. Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
rebind_irq_to_cpu needs to mask evtchn before bind, which should
be same as what evtchn_rebind_cpu does today. Or else cpu_disable
fails at fixup_irqs.
Signed-off-by: Kevin Tian <kevin.tian@intel.com> Signed-off-by: Keir Fraser <keir@xensource.com>
Wake sts is only required to be checked for S1, and implementation
is free to not touch wake sts bit for S3. The latter case is observed
falling into loop on checking wake sts after sleep hypercall returns.
Actually we only need to check hypercall return value here, and those
checks belong to Xen instead.
Bind different tasks' evtchns to different vcpus of Dom0
Currently, all user-space event channels notify Dom0's vcpu0 -- this
is not nice considering scalability. The patch tries to bind different
tasks' evtchns to different vcpus of Dom0 when the bindings are
initialized, and it can also dynamically change the binding if a task
actually gets run on another vcpu for some reason. Tests (Inb and
OLTP) show the patch can improve scalability to some notable degree.
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com> Signed-off-by: Kan Liang <kan.liang@intel.com> Signed-off-by: Keir Fraser <keir@xensource.com>
This fixes a bug causing a bogus symbol reference (to init_page_count)
in the PV-on-HVM drivers for 2.6 kernels that define the set_page_count
macro.
Based on an original patch by: Signed-off-by: Ben Guthro <bguthro@virtualiron.com> Signed-off-by: Dave Lively <dlively@virtualiron.com> Signed-off-by: Keir Fraser <keir@xensource.com>
Fix potential kthread deadlock during Xen suspend.
kthread_create() depends on keventd, so it cannot be executed from
keventd. Replace use of kthread_create() with an approach based on
kernel_thread().
Based on an original patch by: Signed-off-by: Ben Guthro <bguthro@virtualiron.com> Signed-off-by: Robert Phillips <rphillips@virtualiron.com> Signed-off-by: Keir Fraser <keir@xensource.com>