Commit Graph
21721 Commits
Author SHA1 Message Date
Keir Fraser 5bcc7775a7 rombios: pause for a keypress after a failed boot
rombios: inform the user and pause for a keypress after a failed boot
rather than powering off immediately.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2010-07-06 16:49:59 +01:00
Keir Fraser 621441dcd1 Add an exact-node request flag for mem allocations.
Signed-off-by : Dulloor <dulloor@gmail.com>
2010-07-05 08:40:26 +01:00
Keir Fraser 52ff658b7e x2APIC: improve enabling logic
This patch masks PIC and IOAPIC RTE's before x2APIC enabling, unmask
and restore them after x2APIC enabling. It also really enables
interrupt remapping before x2APIC enabling instead of just checking
interrupt remapping setting. This patch also handles all x2APIC
configuration including BIOS settings and command line
settings. Especially, it handles that BIOS hands over in x2APIC mode
(when there is apic id > 255). It checks if x2APIC is already enabled
by BIOS. If already enabled, it will disable interrupt remapping and
queued invalidation first, then enable them again.

Signed-off-by: Weidong Han <weidong.han@intel.com>
2010-07-05 08:31:29 +01:00
Keir Fraser 19fbbfffdc x2APIC/VT-d: improve interrupt remapping and queued invalidation enabling and disabling
x2APIC depends on interrupt remapping, so interrupt remapping needs to
be enabled before x2APIC. Usually x2APIC is not enabled
(x2apic_enabled=0) when enable interrupt remapping, although x2APIC
will be enabled later. So it needs to pass a parameter to set
interrupt mode in intremap_enable, instead of checking
x2apic_enable. This patch adds a parameter "eim" to intremap_enable to
achieve it.  Interrupt remapping and queued invalidation are already
enabled when enable x2apic, so it needn't to enable them again when
setup iommu. This patch checks if interrupt remapping and queued
invalidation are already enable or not, and won't enable them if
already enabled. It does the similar in disabling, that's to say don't
disable them if already disabled.

Signed-off-by: Weidong Han <weidong.han@intel.com>
2010-07-05 08:30:25 +01:00
Keir Fraser 600814950b x2APIC/VT-d: allocate iommu when create a drhd
A drhd is created when parse ACPI DMAR table, but drhd->iommu is not
allocated until iommu setup. But iommu is needed by x2APIC which will
enable interrupt remapping before iommu setup. This patch allocates
iommu when create drhd. And then drhd->ecap can be removed because
it's the same as iommu->ecap.

Signed-off-by: Weidong Han <weidong.han@intel.com>
2010-07-05 08:29:10 +01:00
Keir Fraser 34b9ec5289 VT-d: No need to emulate WBINVD when force snooping feature available
There is no cache coherency issue if VT-d engine's force snooping
feature available.

Signed-off-by: Sheng Yang <sheng@linux.intel.com>
2010-07-05 08:28:08 +01:00
Keir Fraser 093e295b3c VMX: fix ept pages free up when ept superpage split fails:
1) implement ept super page split in a recursive way to
   form an ept sub tree before real installation;
2) free an ept sub tree also in a recursive way.
3) change ept_next_level last input parameter from shift
   bits # to next walk level;

Signed-off-by: Xin Li <xin.li@intel.com>
2010-07-05 08:27:26 +01:00
Keir Fraser 712b05770c trace: insert compiler memory barriers
This is to ensure fields shared writably with Dom0 get read only once
for any consistency checking followed by actual calculations.

I realized there was another multiple-read issue, a fix for which is
also included (which at once simplifies __insert_record()).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-07-05 08:24:18 +01:00
Keir Fraser 2604adda4f AMD OSVW (OS Visible Workaround) for Xen
This path enables AMD OSVW (OS Visible Workaround) feature for
Xen. New AMD errata will have a OSVW id assigned in the future. OS is
supposed to check OSVW status MSR to find out whether CPU has a
specific erratum. Legacy errata are also supported in this patch:
traditional family/model/stepping approach will be used if OSVW
feature isn't applicable.  This patch is adapted from Hans Rosenfeld's
patch submitted to Linux kernel.

Signed-off-by: Wei Huang <wei.huang2@amd.com>
Signed-off-by: Hans Rosenfeld <hands.rosenfeld@amd.com>
Acked-by: Jan Beulich <jbeulich@novell.com>
2010-07-02 19:04:57 +01:00
Keir Fraser 2156299cf0 x86: Fix (bogus) use-before-initialise compiler warning.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-07-02 19:03:16 +01:00
Keir Fraser 8f0aaeab8a VMX: cleanup ept_set_entry:
1) more strict input parameters checking;
2) better comments;
3) fewer variable;
4) change direct_mmio type to bool_t.

Signed-off-by: Xin Li <xin.li@intel.com>
2010-07-02 19:00:04 +01:00
Keir Fraser faba8d7d41 Remove stale file xen/arch/x86/hvm/vmx/vpmu.c
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-07-02 18:59:36 +01:00
Keir Fraser ee310a9ca9 io: make shared ring pad field less enticing for users by adding a __ prefix
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Daniel Stodden <daniel.stodden@citrix.com>
Cc: Dongxiao Xu <dongxiao.xu@intel.com>
2010-07-02 18:58:28 +01:00
Keir Fraser 1b9cecdb88 blktap2: make protocol specific usage of shared sring explicit
I don't think protocol specific data really belongs in this header
but since it is already there and we seem to be stuck with it let's at
least make the users explicit lest people get caught out by future new
fields moving the pad field around.

This is the Xen portion of this change. The kernel portion will be
sent separately. There is no dependency between the two.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Daniel Stodden <daniel.stodden@citrix.com>
Cc: Dongxiao Xu <dongxiao.xu@intel.com>
2010-07-02 18:58:02 +01:00
Keir Fraser ac9fb79947 trace: fix security issues
After getting a report of 3.2.3's xenmon crashing Xen (as it turned
out this was because c/s 17000 was backported to that tree without
also applying c/s 17515), I figured that the hypervisor shouldn't rely
on any specific state of the actual trace buffer (as it is shared
writable with Dom0)

[GWD: Volatile quantifiers have been taken out and moved to another
patch]

To make clear what purpose specific variables have and/or where they
got loaded from, the patch also changes the type of some of them to be
explicitly u32/s32, and removes pointless assertions (like checking an
unsigned variable to be >= 0).

I also took the prototype adjustment of __trace_var() as an
opportunity to simplify the TRACE_xD() macros. Similar simplification
could be done on the (quite numerous) direct callers of the function.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2010-07-02 18:56:34 +01:00
Keir Fraser d505477d64 trace: adjust printk()s
They should be lower level or rate limited.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
2010-07-02 18:53:37 +01:00
Keir Fraser 43b0124af6 trace: improve check_tbuf_size()
It didn't consider the case of the incoming size not allowing for the
2*data_size range for t_buf->{prod,cons}

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2010-07-02 18:53:10 +01:00
Keir Fraser 79fdc7a419 trace: Fix T_INFO_FIRST_OFFSET calculation
This wasn't defined correctly, thus allowing in the
num_online_cpus() == NR_CPUS case to pass a corrupted MFN to
Dom0.

Reported-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2010-07-02 18:52:45 +01:00
Keir Fraser 6634a6768c gdbsx: Always build -- remove build-time config option.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-07-02 18:52:12 +01:00
Keir Fraser 8c5c89fc7c xenpaging: Fix 32-bit build after fixed-width type changes.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-06-30 22:12:54 +01:00
Keir Fraser a61e7a3565 Fix #GPF injection into compat guests in vm86 code
not to let the guest disable interrupts in the real EFLAGS.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2010-06-30 18:12:43 +01:00
Keir Fraser 7664456355 Use gfn_to_mfn_query() rather then gfn_to_mfn() when changing P2M types
Use gfn_to_mfn_query() rather then gfn_to_mfn() when changing
P2M types since we do not really want to force a PoD allocation
as a side effect.

Signed-off-by: Paul Durrant <Paul.Durrant@citrix.com>
2010-06-30 18:11:42 +01:00
Keir Fraser 1b2b50ec3f x86: fix an off-by-one pirq range check
Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-06-30 18:11:09 +01:00
Keir Fraser 3f3ba5b3d4 VMX: remove useless super page recomputing in ept_set_entry.
Caller to ept_set_entry must give a valid order that hardware
supports, see set_p2m_entry in p2m.c.

Signed-off-by: Xin Li <xin.li@intel.com>
2010-06-30 18:09:16 +01:00
Keir Fraser b5103d692a x86 oprofile: use rdmsrl/wrmsrl
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2010-06-29 18:20:14 +01:00
Keir Fraser 79bdfbb588 trace: share t_info pages only in read-only mode
There's no need to share writably the t_info pages (Dom0 only wants
[and needs] to read it)

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
2010-06-29 18:18:42 +01:00
Keir Fraser cecde1f967 Use fixed-width types in the memory event interface
Set the types in the public memory_event header file to use
fixed-sized and self-aligned fields rather than "unsigned long".  AIUI
this feature only works with 64-bit hypervisors but I think this
change will be necessary to use 32-on-64 dom0 tools.

This breaks compatibility with older builds of the tools, but I can't
see any way to avoid it short of __attribute__((__packed__)).

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Acked-by: Patrick Colp <pjcolp@cs.ubc.ca>
2010-06-29 18:17:44 +01:00
Keir Fraser af2b4aaad0 x86: Only build memory-event features on 64-bit Xen
32-bit Xen doesn't have enough p2m types to support them.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2010-06-29 18:16:41 +01:00
Keir Fraser d9edd37387 gpxe: Add eb-roms.h to hgignore list and build ROMs serially.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-06-29 13:43:18 +01:00
Keir Fraser 98ed7531a4 gpxe: Build e1000 ROM with PCI-ID matching that advertised by qemu-dm.
Also build gpxe without -Werror and require it always to be built (do
not include a pre-built binary in our source repo).

Portions of this patch are from Gianni Tedesco <gianni.tedesco@citrix.com>

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-06-29 13:33:37 +01:00
Keir Fraser 4580002f0f x86: send_IPI_mask() ignores offline CPUs in given cpumask.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-06-29 13:16:22 +01:00
Ian Jackson 2aaf60746f Merge 2010-06-28 17:40:16 +01:00
Ian Jackson 7bbf69bc87 tools/ocaml: Add .NOTPARALLEL to Makefile
tools/ocaml was capable of descending into lib/* and xenstored/
simultaneously, obviously with poor results.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-06-28 17:35:10 +01:00
Ian Jackson 4f5a16eb5c libxl: Specify no nics to qemu when no emulated nics
qemu will default to one emulated NIC if no network configuration is
specified on the command-line.  If there are no emualted NICs (i.e.,
no NICs or all NICs are PV), specify no nics to avoid getting an
emulated NIC by default.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2010-06-28 17:13:43 +01:00
Ian Jackson 28d7162231 libxl: Pass bridge config info into xenstore
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2010-06-28 17:10:38 +01:00
Ian Jackson df0dc32332 tools/libxc: Do not crash freeing logger on xc_interface_open error path
libxc could sometimes free the logger which xl created.
Thanks to report from Yang Hongyang <yanghy@cn.fujitsu.com>.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-06-28 16:56:52 +01:00
Ian Jackson f3fdbe7359 tools/python: sxp parser: show empty string
This patch makes the sxp parser show empty string.

Test case:
 import sxp
 sxp.show(sxp.from_string('(a "")'))
 sxp.show(sxp.from_string("(a '')"))

Without this patch:
 (a )(a )
With this patch:
 (a '')(a '')

Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
2010-06-28 16:49:45 +01:00
Keir Fraser c3efc4ecb7 vtd: Only kill_timer() an init_timer()'ed timer.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-06-28 16:45:19 +01:00
Keir Fraser 9bea076291 xentrace: restrict trace buffer MFNs
Since they're being passed to Dom0 using an array of uint32_t, they
must be representable as 32-bit quantities, and hence the buffer
allocation must specify an upper address boundary.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
2010-06-28 16:27:56 +01:00
Keir Fraser fb082c90a0 Merge 2010-06-25 16:05:20 +01:00
Keir Fraser cb9fded465 x86 mtrr: use rdmsrl
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2010-06-25 16:04:47 +01:00
Ian Jackson 2407e4dff9 Merge 2010-06-25 15:53:53 +01:00
Keir Fraser 67da0f0cf8 svm: use wrmsrl
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2010-06-25 15:45:50 +01:00
Keir Fraser c3049f0f7c x86 paging_domctl: reinstates the breaks in the flow control (and
folds two identical cases together) and fixes the memory leak that was
causing a crash.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2010-06-25 15:44:58 +01:00
Ian Jackson ddf97d4db8 libxc: Fix ia64 build for interface change
This patch fixes ia64 by the following method:
- rename xc_handle xch
- rename guest_xc xch
- add xc_interface *xch to arguments of some functions
- replace xc_dom_printf with macros
- Add *xch argument to corresponding x86 functions [iwj]

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-06-25 15:43:50 +01:00
Ian Jackson a2fab4fce5 xend: Fix up check "mac" address sooner change
In changeset 21653,
         dev_type = sxp.name(dev_config)
should not have been moved, otherwise, the checking "mac"
paragraph is of no use.

(The original patch as submitted was correct but I had to make the
change manually as it had been mangled.)

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by Chunyan Liu <CYLiu@novell.com>
2010-06-25 15:13:11 +01:00
Keir Fraser cd38466b79 x86 cpufreq: Fixes after msr cleanup patch
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-06-25 13:23:49 +01:00
Keir Fraser 18918be607 x86 cpu: use rdmsrl/wrmsrl
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2010-06-25 13:10:46 +01:00
Keir Fraser a69acadfa5 x86 cpufreq: use rdmsrl/wrmsrl
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2010-06-25 12:58:27 +01:00
Keir Fraser 70e47b3b9b [IA64] counter part of 21407:e4028345ad48
Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
2010-06-25 08:39:44 +01:00