Commit Graph
19148 Commits
Author SHA1 Message Date
Keir Fraser 77699d4240 Consolidate cpufreq cmdline handling
... by moving as much of the option processing into cpufreq code as is
possible, by folding the cpufreq_governor option into the cpufreq one
(the governor name, if any, must be specified as the first thing after
the separator following "cpufreq=xen"), and by allowing each
governor to have an option processing routine.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2009-02-03 18:12:51 +00:00
Keir Fraser 964fb3d636 x86: Relocate Multiboot structures where we know they will be
accessible. GRUB2 seems to like to stick them really high sometimes
(just below 4GB).

The 32-bit C code framework that this sets up can also be used for
other stuff in future:
 * early cmdline parsing
 * relocating multiboot modules so they too are guaranteed accessible

Its interaction with normal Xen start-of-day, and with the 16-bit
assembly trampoline, needs a bit of thought.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-02-03 18:11:03 +00:00
Keir Fraser 684e6b10cb ia64: fix compilation error
This patch fixes the following compilation error.
Since struct page_list_head is defined in mm.h, sched.h needs mm.h.
Other circular inclusions are sorted out.

> In file included from xen/include/asm-ia64/linux-xen/asm/smp.h:50,
>                  from xen/include/linux/smp.h:5,
>                  from xen/include/asm-ia64/linux/topology.h:33,
>                  from xen/include/asm-ia64/linux-xen/linux/gfp.h:6,
>                  from xen/include/asm/mm.h:11,
>                  from xen/include/xen/mm.h:90,
>                  from viosapic.c:35:
> xen/include/xen/sched.h:174: error: field page_list has incomplete
> type
> xen/include/xen/sched.h:175: error: field xenpage_list has
> incomplete type

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2009-02-03 14:06:51 +00:00
Keir Fraser 720a883c7f x86/shadow: struct page_info's type_info is now unsigned long,
hence local variables of type u32 (and the more such with misleading
names) must no longer be used.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2009-02-03 14:03:32 +00:00
Keir Fraser 4134c89049 Fix 'debug ?= y' to actually enable debug build.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-02-02 09:21:04 +00:00
Keir Fraser 2090d39064 x86: page_info cleanups.
1. No reason for i386 not to use the same definitions as x64
 2. No need for shadow_page_info names to hang around.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-30 11:33:27 +00:00
Keir Fraser 8ddc017144 page_alloc: try to put heap control structures on the target node
This also neatly eliminates (in certain cases) the need to reserve a
page between nodes, as the heap control structures will never be freed
and thus can serve as the needed separator.

It also adds an additonal fallback attempting to make use of the
wasted tail of a (group of) page(s) used for the _heap array by putting the
avail array there if it fits.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2009-01-30 11:16:52 +00:00
Keir Fraser b93bffcc1a page_alloc: properly honor MAX_ORDER in init_heap_pages()
The previous check was flawed in that it checked
- for a single bit to be set instead of a range of bits to be clear
- a machine address against a mask supposed to be used on MFNs.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2009-01-30 11:14:23 +00:00
Keir Fraser 1a3997bafc pass-through: drop lock before calling xfree() on error path
Signed-off-by: Jan Beulich <jbeulich@novell.com>
2009-01-30 11:13:55 +00:00
Keir Fraser 968f46f565 amd-iommu: drop locks before printing error messages
Signed-off-by: Jan Beulich <jbeulich@novell.com>
2009-01-30 11:13:32 +00:00
Keir Fraser 0daab815d5 amd-iommu: obtain page_alloc_lock before traversing a domain's page list
From all I can tell, this doesn't violate lock ordering as other
places call heap allocation functions from inside hd->mapping_lock.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2009-01-30 11:13:06 +00:00
Keir Fraser f1e6f665b9 x86: re-arrange struct page_info members
By combining the overlay fields that are 8 bytes long (on x86-64) into
a union separate from the one used for the 4 byte wide fields, no
unnecessary padding will be inserted while at the same time avoiding
to use __attribute__((__packed__)) on any of the sub-structures (which
risks misaligning structure members without immediately noticing).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2009-01-30 11:10:43 +00:00
Keir Fraser 1065734fcb x86-64: use MFN also for next_shadow link
Signed-off-by: Jan Beulich <jbeulich@novell.com>
2009-01-30 11:09:44 +00:00
Keir Fraser 74ded61cc3 x86-64: fold shadow_page_info fields into page_info
... combining the list entry members of both structures and removing
the artificial 'mbz' member (shadow code must keep the real underlying
member 'count_info' at zero for the lifetime of pages use as shadows).

This also fixes a latent issue with u.inuse._domain not getting
explicitly cleared before returning shadow pages to the domain heap -
it just so happened that this member turned out to be zero in all
(normal?) cases when a shadow page ends its life (but there were
neither build nor run-time assertions that this would actually be the
case). The bug got exposed by a subsequent patch changing the order of
fields in struct page_info.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2009-01-30 11:08:06 +00:00
Keir Fraser 0d75438a32 x86: Better bzimage_headroom() crash fix.
Signed-off-by:  Joseph Cihula <joseph.cihula@intel.com>
2009-01-30 11:04:24 +00:00
Keir Fraser e44c9316ba x86-64: use MFNs for linking together pages on lists
Unless more than 16Tb are going to ever be supported in Xen, this will
allow reducing the linked list entries in struct page_info from 16 to
8 bytes.

This doesn't modify struct shadow_page_info, yet, so in order to meet
the constraints of that 'mirror' structure the list entry gets
artificially forced to be 16 bytes in size. That workaround will be
removed in a subsequent patch.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2009-01-30 11:03:28 +00:00
Keir Fraser bb978e7d19 x86_64: Remove bogus extra do_xsm_op from hypercall_args_table
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-30 10:51:01 +00:00
Isaku Yamahata 66f2be91a7 [IA64] remove static-partitioned xenheap
This patch is ia64 counter part of 19054:845aa241e163

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2009-01-30 11:12:57 +09:00
Isaku Yamahata f396b06cc7 [IA64] Widen page counts and domain pointer
This is ia64 counter part of 19089:39517e863cc8.
This patch is preliminary for removing xenheap.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2009-01-30 11:12:44 +09:00
Isaku Yamahata c495397bb1 [IA64] No need for cmpxchg on page_info structure.
Updates and checks on count_info and page owner can safely be
non-atomic.
This is ia64 counter part of 19088:055c589f4791.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2009-01-30 11:12:29 +09:00
Isaku Yamahata 488196302a [IA64] fix __virt_to_maddr()
__virt_to_maddr() should be updated acording to xen relocation.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2009-01-30 11:12:03 +09:00
Isaku Yamahata 2a2afad75f [IA64] use domheap for mpt_table.
Now there is no need to allocate pages for mpt_table from xenheap.
So allocate it from domheap.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2009-01-30 11:11:39 +09:00
Isaku Yamahata 08ac2b0670 [IA64] remove opt_p2m_xenheap
xenheap isn't pinned down now so that allocating p2m pages from
xenheap doesn't make sense anymore.
This is preparation for removing xenheap.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2009-01-30 11:09:27 +09:00
Isaku Yamahata adc5463bdf [IA64] remove warning
This patch remove the following warning.
> memory.c:116: warning: implicit declaration of function 'guest_physmap_mark_populate_on_demand'
> memory.c:206: warning: implicit declaration of function 'p2m_pod_decrease_reservation'

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2009-01-30 11:04:51 +09:00
Isaku Yamahata 624ed7c364 merge with xen-unstable.hg 2009-01-30 10:54:13 +09:00
Keir Fraser 0c4794ceea x86: Fix the build.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-29 23:40:37 +00:00
Keir Fraser fa5078d407 stubdom: add videoram to stubdom initial memory reservation
This patch adds a videoram parameter (4MB is the default) to pv guests
too: if the pv guest is actually a stubdomain then the videoram size
is added to the initial required available memory.
This way there is no risk that a stubdom fails to populate the
videoram because the RAM freed for the videoram by dom0 has already
been used to create the stubdom.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-01-29 16:41:48 +00:00
Keir Fraser 4419593858 PoD: Check refcount, not type count when reclaiming zero pages
Check the page refcount rather than the type count when deciding if a
page is still mapped.

This catches pages which are mapped by qemu; it also removes the need
for gnttab_is_granted().

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2009-01-29 16:40:48 +00:00
Keir Fraser 597edba986 xend: Fix block device type check
Since changeset 17617 the block device protocols are checked to be
either file or phy. This has later been fixed to also include
tap. This is still not a correct check as there can be arbitrary
additional protocols. Before this check was added you could have a
block-xyz hotplug script and xyz would work as a protocol, now it is
refused. An example for this mechanism is the block-nbd script which
is included in the tree.

This patch changes the check to allow file, phy, tap and all protocol
names for which a block-$protocol hotplug script exists. This should
fix the last regressions introduced by the check.

Signed-off-by: Kevin Wolf <kwolf@suse.de>
2009-01-29 16:39:56 +00:00
Keir Fraser aab43dddfe PoD: Remove on-stack arrays from pod_zero_check_superpage
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2009-01-29 12:48:33 +00:00
Keir Fraser 1d87a30cef tboot: use TXT's DMA-protected DMAR table to setup VT-d
Signed-off-by: Joseph Cihula <joseph.cihula@intel.com>
2009-01-29 12:44:31 +00:00
Keir Fraser 04c749dc89 tboot: tboot no longer marks TXT regions as E820_UNUSABLE, so Xen must
explicitly disallow them itself.

Signed-off-by: Shane Wang <shane.wang@intel.com>
Signed-off-by: Joseph Cihula <joseph.cihula@intel.com>
2009-01-29 12:10:39 +00:00
Keir Fraser e73ef5b21d tboot: hypervisor integrity on S3
When launched from tboot, utilise tboot interface to provide integrity
protection to the hypervisor during S3

Signed-off-by: Joseph Cihula <joseph.cihula@intel.com>
ACKed-by: Shane Wang <shane.wang@intel.com>
2009-01-29 11:36:09 +00:00
Keir Fraser 4d41b00276 tboot: ACPI Generic Address Structure for tboot shutdown
New versions of tboot support ACPI GAS (Generic Address Structure) for
handling sleep states.  This required a change to the tboot_shared_t
data structure that is not backwards compatible.  This patch requires
that new version makes use of GAS when invoking tboot on shutdown.

Signed-off-by: Shane Wang <shane.wang@intel.com>
Signed-off-by: Joseph Cihula <joseph.cihula@intel.com>
2009-01-29 11:35:19 +00:00
Keir Fraser a2e1511237 tboot: single tboot entry point for shutdown
tboot removed the shutdown_entry32 and shutdown_entry64 from
tboot_shared_t and now has just a single shutdown_entry field.

Signed-off-by: Joseph Cihula <joseph.cihula@intel.com>
2009-01-29 11:32:06 +00:00
Keir Fraser 6fd8a628cf x86: Although bzimage_headroom() doesn't return -ve values,
bzimage_parse() can.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-29 11:28:09 +00:00
Keir Fraser dc064d77d8 x86: bzimage_headroom does not return -ve error codes.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-29 01:16:30 +00:00
Keir Fraser c517f5a48c x86: Do not check dom0 kernel header for bzimage magic until we are
sure it is mapped. This fixes a crash when running on top of tboot.

Signed-off-by: Joseph Cihula <joseph.cihula@intel.com>
2009-01-29 01:11:50 +00:00
Keir Fraser 1d0ec27ff1 x86: Pickle domain in page_info into 32 bits.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-28 17:40:01 +00:00
Keir Fraser eab803cb2b x86: VCPU structure must reside below 4GB, since it contains embedded
PAE mode PDPTEs.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-28 17:05:18 +00:00
Keir Fraser 3cf2caaacb Allow memflags to be specified to alloc_xenheap_pages().
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-28 16:58:41 +00:00
Isaku Yamahata 641b3e7cf6 merge with xen-unstable.hg 2009-01-28 13:06:45 +09:00
Isaku Yamahata ca0dcbc228 [IA64] support XEN_DOMCTL_[gs]et_address_size
support XEN_DOMCTL_[gs]et_address_size to support
the updated xm dump-core.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2009-01-28 12:22:58 +09:00
Keir Fraser ad4292993b acpi: Neaten reboot messages.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-27 16:41:09 +00:00
Keir Fraser 2d0557c5cb x86: Fold page_info lock into type_info.
Fix some racey looking code at the same time.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-27 16:02:21 +00:00
Keir Fraser 800dcd89f7 x86-64: don't generate dependency files when building compat headers
The generated dependency files weren't correct (as their names get
derived only from the base name of the target file, and there are
public headers with the same base name in different directories), not
needed (as the makefile already listed all necessary dependencies
explicitly), and resulted in the first re-build in an already built
tree to be an almost full re-build since the *.c files explicitly
mentioned in the .*.d result in make not considering them as
intermediate anymore, thus triggering re-generation of the headers,
and hence re-building of almost the entire tree.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2009-01-27 11:54:22 +00:00
Keir Fraser e65026569e x86: clean up struct page_info
Remove the now unnecessary (and leading to misalignment of cpumask on
x86-64) 'packed' attributes.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2009-01-27 11:45:59 +00:00
Keir Fraser 87f82d5e02 x86: use alloc_domheap_page() consistently in dom0 building
Signed-off-by: Jan Beulich <jbeulich@novell.com>
2009-01-27 11:24:47 +00:00
Keir Fraser a8ed416a2c x86: clean up comments in mce_intel.c
Signed-off-by: Jan Beulich <jbeulich@novell.com>
2009-01-27 11:24:24 +00:00
Keir Fraser b9471b802c make pirq_acktype() static to its respective source files
Signed-off-by: Jan Beulich <jbeulich@novell.com>
2009-01-27 11:23:56 +00:00