Keir Fraser [Fri, 30 May 2008 18:08:50 +0000 (19:08 +0100)]
xen: Set blocking timeout to 1/2 jiffy later than we want. This avoids
repeated early wakeup just before the jiffy tick, causing us to
effectively spin rather than sleep.
Keir Fraser [Thu, 15 May 2008 08:42:27 +0000 (09:42 +0100)]
balloon: Fix minimum_target() check to work when built as a module.
From: Jan Beulich <jbeulich@novell.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Wed, 14 May 2008 12:53:06 +0000 (13:53 +0100)]
acpi: Fix a bug related to parse named objects
This patch is pulled from native linux, and is needed in our patchset
to make it run, otherwise will parse wrong _PSD info.
Fixed a problem with the Package operator where all named
references were created as object references and left otherwise
unresolved. According to the ACPI specification, a Package can
only contain Data Objects or references to control methods. The
implication is that named references to Data Objects (Integer,
Buffer, String, Package, BufferField, Field) should be resolved
immediately upon package creation. This is the approach taken
with this change. References to all other named objects (Methods,
Devices, Scopes, etc.) are all now properly created as reference
objects.
Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Keir Fraser [Wed, 14 May 2008 12:51:50 +0000 (13:51 +0100)]
xen: Basic framework of getting and notifying Px info
Setup basic framework for ACPI Px parse, get basic Px info,
transfer Px info to hypervisor through platform op hypercall.
Add external control for ACPI parse, add notify mechanism for
dynamic Px event (like ppc).
Signed-off-by: Tian Kevin <kevin.tian@intel.com> Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
Keir Fraser [Tue, 13 May 2008 08:32:00 +0000 (09:32 +0100)]
xen: Cleanup of MSI code
A few cleanups of the MSI code. There were a couple of race
conditions in the use of msi_dev_head which this patch fixes. Use
list_empty rather than list_empty_careful since pirq_list_head is only
ever accessed under pirq_list_lock. I removed some unused variables.
Signed-off-by: Neil Turton <nturton@solarflare.com>
Isaku Yamahata [Tue, 13 May 2008 01:42:09 +0000 (10:42 +0900)]
[IA64] implement xencomm routine for HVMOP_track_dirty_vram.
This patches implement xencomm routine for HVMOP_track_dirty_vram hypercall.
Without this, using vfb results in annoying messages in dom0 as
> xencomm_privcmd_hvm_op: unknown HVMOP 6
xen/ia64 doesn't implement the hypercall at this moment so that
it simply returns -ENOSYS. So the xencomm routine returns -ENOSYS
directly without issuing the useless hypercall.
linux/balloon: don't allow ballooning down a domain below a reasonable limit
Reasonable is hard to judge; we don't want to disallow small domains.
But the system needs a reasonable amount of memory to perform its
duties, set up tables, etc. If on the other hand, the admin is able
to set up and boot up correctly a very small domain, there's no point
in forcing it to be larger. We end up with some kind of logarithmic
function, approximated.
Signed-off-by: Kurt Garloff <garloff@suse.de> Signed-off-by: Jan Beulich <jbeulich@novell.com>
Dell's Precision490, for example, fails to properly power off without
going through the full sequence of operations in the hypervisor. Hence
acpi_notify_hypervisor_state() must be defined, and used for entry to
S5, regardless of CONFIG_ACPI_PV_SLEEP configuration.
Also fix a compiler warning and the improper use of a hypervisor
return value as ACPI status.
IA64: Bug fix for kexec to work on an HP rx2620 ia64 machine.
PCI: fix for quirk_e100_interrupt()
Check that the e100 is in the D0 power state. If it's not, it won't
respond to MMIO accesses and we end up with master-abort machine
checks on some platforms.
Signed-off-by: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Cc: Auke Kok <auke-jan.h.kok@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Simon Horman <horms@verge.net.au>
xen evtchn: Rememeber to re-bind user-attached event channels to VCPU
0 when the channel is closed.
From: Pascal Bouchareine <pascal@gandi.net> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Thu, 15 May 2008 14:15:09 +0000 (15:15 +0100)]
linux/x86-64: initialization code cleanup
Since init_memory_mapping() installs the pgd entry after populating
all lower level tables, the whole mechanism can be coded to avoid
using xen_l?_entry_update() on pages that aren't page tables
(yet). Also, __set_pte() is a pure duplicate of set_pte() and hence
can go away.
Keir Fraser [Thu, 15 May 2008 09:03:29 +0000 (10:03 +0100)]
Do not unmap all MSI-X pirqs when enabling MSI-X
Originally, all existing MSI-X pirqs of that device are unmapped
before mapping the required MSI-X entries. This is actually not
right. This function may be called several times, with each time
requiring enabling different parts of the device MSI-X entry. Former
pirqs should not be unmapped.
Thanks for Neil Turton's comments on this problem.
Keir Fraser [Mon, 31 Mar 2008 10:03:07 +0000 (11:03 +0100)]
xen: fix grant table bug
A PV OS has two grant table data structures: the grant table itself
and a free list. The free list is composed of an array of pages,
which grow dynamically as the guest OS requires more grants. While
the grant table contains 8-byte entries, the free list contains 4-byte
entries. So we have half as many pages in the free list than in the
grant table.
There was a bug in the free list allocation code. The free list was
indexed as if it was the same size as the grant table. But it's only
half as large. So memory got corrupted, and I was seeing crashes in
the slab allocator later on.
Signed-off-by: Michael Abd-El-Malek <mabdelmalek@cmu.edu>
On Xen kernels, BIOVEC_PHYS_MERGEABLE permits merging of disk IOs that
span multiple pages, provided that the pages are both
pseudophysically- AND machine-contiguous ---
However, this best-effort merging of adjacent pages can occur in
regions of dom0 memory which just happen, by virtue of having been
initially set up that way, to be machine-contiguous. Such pages
which occur outside of a range created by xen_create_contiguous_
region won't be seen as contiguous by range_straddles_page_boundary(),
so the pci-dma-xen.c code for dma_map_sg() will send these regions
to the swiotlb for bounce buffering.
This patch adds a new check, check_pages_physically_contiguous(),
to the test for pages stradding page boundaries both in
swiotlb_map_sg() and dma_map_sg(), to capture these ranges and map
them directly via virt_to_bus() mapping rather than through the
swiotlb.
Keir Fraser [Fri, 28 Mar 2008 14:27:38 +0000 (14:27 +0000)]
ballon sysfs: Avoid sysfs name-clash with Linux memory hotplug
infrastructure by renaming to /sys/devices/system/xen_memory/ Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Ian Campbell [Fri, 28 Mar 2008 09:49:22 +0000 (09:49 +0000)]
Avoid deadlock when unregistering a xenbus watch.
Watch handlers which run in a separate thread (XBWF_new_thread) should
run without the xenbus_mutex held since kthread_run can block waiting
for memory which causes a deadlock if further watches need to be
unregistered in order to activate the swap device on resume.
XBWF_new_thread cannot be safely unregistered anyway since the mutex
only protects thread startup.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Keir Fraser [Tue, 18 Mar 2008 15:01:09 +0000 (15:01 +0000)]
xen: Variable-size gntdev support
This patch adds the ability to set the number of slots that may be
used for mapping grant references, using the gntdev user-space grant
reference mapping driver.
Keir Fraser [Tue, 18 Mar 2008 11:43:42 +0000 (11:43 +0000)]
netfront accel: Reduce length of accel_watch workqueue name
As reported reported (see link below) the first argument to
create_workqueue is limited to 10 character on RHEL4U2. This patch
shortens the length and makes the workqueue name a little more
descriptive.
Keir Fraser [Tue, 18 Mar 2008 11:22:54 +0000 (11:22 +0000)]
xen/i386: re-add and use pre_setup_arch_hook()
It was only during the 2.6.25 merge that I realized that there was a
difference to native code that was not only unnecessary, but even
preventing the Xen version from being better readable and closer to
native both in terms of source code and behavior:
pre_setup_arch_hook() can do everything that (or equivalent to what)
x86-64 does in head64-xen.c. Apart from that it simplifies forward
porting, since certain pieces set up here are required to be available
much earlier in newer Linux.
Keir Fraser [Tue, 18 Mar 2008 11:21:44 +0000 (11:21 +0000)]
xen: satisfy newer modpost requirements, part 2
References to __devinit probe functions are considered valid by newer
modprobe if the containing structure is named in certain ways. Use the
_driver suffix where necessary.
Keir Fraser [Tue, 18 Mar 2008 11:18:06 +0000 (11:18 +0000)]
xen pcifront: satisfy newer modpost requirements
pcifront_scan_root() calls pci_scan_bus_parented() possibly after core
kernel initialization, but that latter function is marked __devinit.
While HOTPLUG can be turned off only under EMBEDDED, 2.6.25's modpost
still (validly) catches this as an incorrect reference. Marking
pcifront_scan_root() __init_refok seems too dangerous, however, so
instead the much more streamlined pcifront_backend_changed() is being
marked so, and the rest of the offending dependencies is being marked
__devinit, and XEN_PCIDEV_FRONTEND now selects HOTPLUG to make it
independend of any changes in HOTPLUG's prompt visibility.
Keir Fraser [Tue, 18 Mar 2008 11:13:37 +0000 (11:13 +0000)]
xen: validate type and value of the dtor argument of SetPageForeign()
Linux 2.6.25 changes the protoype of pte_free() etc., resulting in
those functions no longer be suitable as a PageForeign destructor. I
had to find out by way of analysing a crash, but for the future it'd
be much better if the build would already indicate a problem with
this.
At the same time, also check the destructor supplied is not NULL.
Keir Fraser [Wed, 5 Mar 2008 17:28:41 +0000 (17:28 +0000)]
xenbus: prevent warnings on unhandled enumeration values
XenbusStateReconfiguring/XenbusStateReconfigured were introduced by
c/s 437, but aren't handled in many switch statements. This c/s also
introduced a possibly un-referenced label, which also gets eliminated
here.
Keir Fraser [Wed, 5 Mar 2008 17:28:04 +0000 (17:28 +0000)]
linux: fix pv driver build
When building with -Werror-implicit-function-declaration, the addition
of is_initial_xen_domain() checks in drivers/xen/netfront/accel.c
causes the build to fail.
Additionally, drivers/xen/netfront/netfront.c illegally (and
needlessly) includes xen/hypercall.h directly.
Keir Fraser [Wed, 5 Mar 2008 17:27:36 +0000 (17:27 +0000)]
linux/i386-pae: fix __pte_ma()
While at present there's no use of the macro that would suffer from
this problem, this is a latent bug and should therefore be fixed (just
like __pte() in the native kernel).
Keir Fraser [Wed, 5 Mar 2008 11:09:41 +0000 (11:09 +0000)]
x86 xen: New vcpu_op call to get physical CPU identity.
Some AMD machines have APIC IDs that not equal to CPU IDs. In
the default Xen configuration, ACPI calls on these machines
can get confused. This shows up most noticeably when running
AMD PowerNow!. The only solution is for dom0 to get the
hypervisor's cpuid to apicid table when needed (ie, when dom0
vcpus are pinned).
Add a vcpu op to Xen to allow dom0 to query the hypervisor for
architecture dependent physical cpu information if dom0 vcpus are
pinned.
Signed-off-by: Mark Langsdorf <mark.langsdorf@amd.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>