Commit Graph
23678 Commits
Author SHA1 Message Date
Konrad Rzeszutek Wilk bc91eecaa1 doc: Update the com1,com2 section with pci and amt options.
The "xen: Automatically find serial port on PCI/PCIe and AMT devices."
provides the functionality to probe for the I/O base using the
"pci" and "amt" option. Update the documentation with this fact.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2011-07-14 09:31:53 +01:00
Konrad Rzeszutek Wilk e2da9f6845 xen: Update pci_uart_config to save the BAR1 contents if com2 is used
Jan Beulich pointed out that the pci_uart_config can be called for
com2 and we should probe the second BAR instead of the first one.

This patch will probe the BAR0 if it is com1, and BAR1 if its com2.
It also cleans up some of the whitespace problems and changes the
name of the parameter and function from 'magic' to 'pci'.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2011-07-14 09:31:12 +01:00
Konrad Rzeszutek Wilk ac17df064f xen: Restore the BAR and PCI command after resume.
Certain PCI serial cards just don't want to remember
what they are when they come out of resume. Save
the BAR and the PCI command values before we suspend and
write them back in when we resume.

Signed-off-by: Roger Cruz <roger.cruz@virtualcomputer.com>
Signed-off-by: Tom Goetz <tom.goetz@virtualcomputer.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2011-07-14 09:30:25 +01:00
James Mckenzie 9738db88f6 xen: Automatically find serial port on PCI/PCIe and AMT devices.
Instead of having to manually look the right I/O port on the PCI
devices or AMT devices, lets probe the card and find that
automatically.

This means that you don't have to have this:
 com1=115200,8n1,0xd800,0

But instead can have
 com1=115200,8n1,magic

Or if you have AMT:
 com1=19200,8n1,amt

Signed-off-by: James Mckenzie <jamesmck@bob.uk.xensource.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Tom Goetz <tom.goetz@virtualcomputer.com>
2011-07-14 09:28:23 +01:00
Jan Beulich d0ae97d413 x86-64: properly handle alias mappings beyond _end
Changeset 19632:b0966b6f5180 wasn't really complete: The Xen image
mapping doesn't end at _end, but a full 16Mb gets mapped during boot
(and never got unmapped so far), hence all of this space was subject
to alias mappings when it comes to cache attribute changes. Unmap all
full large pages between _end and the 16Mb boundary, and include all
other pages beyond _end when checking for aliases.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2011-07-14 09:26:13 +01:00
Jan Beulich 7844f90abd x86-64/EFI: discard .comment.* sections
The SuSE version of gcc produces a non-standard section named
.comment.SUSE.OPTs, but the PE32+ handling in binutils can't really
deal with any section to be placed at virtual address zero (and not
needing to be loaded). Even if binutils did, at least the UEFI
implementation in EDK 1.06 doesn't look at the section characteristics
at all, and hence would attempt to load such a section, and fail or
corrupt other data.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2011-07-08 13:23:05 +01:00
Jan Beulich 6b2c9b33a0 x86-64/physdevop: reduce generated code duplication
At least all the helper functions can be used by both the native and
the compat-mode implementations, requiring their parameters to be
adjusted.

Additionally, rather than having the compat mode wrapper source file
blindly define the native structures to be replaced by the compat mode
ones, replace unnecessary (un-)definitions by layout match checks.

In a second step, do_physdev_op() could be split into a part that
needs
re-compilation for compat mode handling and one that can be used for
native and compat mode.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2011-07-08 13:21:53 +01:00
Keir Fraser 71db85f478 Revert 23664:3e3c0a8be9f9 2011-07-08 13:20:09 +01:00
Tim Deegan 412b25c828 x86/mm: fix 32-bit p2m type lookups
23300:4b0692880dfa moved a check for 0 into p2m_flags_to_type()
and removed it from its caller, but the new check is only
compiled in 64-bit builds.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2011-07-08 11:44:23 +01:00
Konrad Rzeszutek Wilk 7c7a202cce ns16550: Implement suspend handler.
For PCI type cards, you need to disable the timer code during
suspend. Otherwise during resume, the timer can be put on the
heap as its being resumed and corrupt it resulting in a crash.

Signed-off-by: Roger Cruz <roger.cruz@virtualcomputer.com>
Signed-off-by: Tom Goetz <tom.goetz@virtualcomputer.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2011-07-08 08:42:30 +01:00
KUWAMURA Shin'ya 1d67ac323c [IA64] kexec: fix ia64 build
23408:1fc3347850c7 causes the following error:
  machine_kexec.c:106: error: static declaration of
  'machine_kexec_get_xen' follows non-static declaration
  /xen-unstable.hg/xen/include/xen/kexec.h:39: error: previous
  declaration of 'machine_kexec_get_xen' was here

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
2011-07-08 08:39:26 +01:00
Andrew Cooper c24c3e21e3 KEXEC: disconnect all PCI devices from the PCI bus on crash
In the case of a crash, IOMMU DMA remapping gets turned off so that
the kdump kernel may boot.  However, this is warned as being dangerous
in the VTD specification if a DMA transaction is in progress.

Also, in the case of a crash, DMA transactions and interrupts from
peripheral devices such as network cards are likely to keep coming in.
Without DMA remapping enabled, the transactions will be writing over
low memory, corrupting the crash state, and perhaps even the kdump
reserved memory.

Therefore, on the crash path, we can disconnect all PCI devices from
their respective buses so that they are no longer able to be DMA
busmasters.  This reduces the risk of DMA transactions corrupting
state (and will also reduce spurious interrupts arriving to the kdump
kernel) until the kdump kernel and properly reset the PCI devices.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
2011-07-08 08:38:35 +01:00
Jan Beulich 56a86d9c66 libelf: "required" features should also be reported as "supported"
Signed-off-by: Jan Beulich <jbeulich@novell.com>
2011-07-08 08:35:00 +01:00
Jan Beulich fe15cd0fb6 add privileged/unprivileged kernel feature indication
With our switching away from supporting 32-bit Dom0 operation, users
complained that attempts (perhaps due to lack of knowledge of that
change) to boot the no longer privileged kernel in Dom0 resulted in
apparently silent failure. To make the mismatch explicit and visible,
add feature flags that the kernel can set to indicate operation in
what modes it supports. For backward compatibility, absence of both
feature flags is taken to indicate a kernel that may be capable of
operating in both modes.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2011-07-08 08:34:29 +01:00
Kevin Tian 4776f8ddd2 xenpm: clean up print messages
Signed-off-by Kevin Tian <kevin.tian@intel.com>
2011-07-08 08:33:01 +01:00
Kevin Tian 32cdcb2a24 cpuidle: initialize default Cstate information
C0/C1 should be always available when cpuidle is enabled in Xen.
When there's case that Dom0 doesn't register ACPI Cstate information,
e.g. due to BIOS issue or acpi processor module  is not installed,
this patch provides basic C0/C1 information available to xenpm tool.

Signed-off-by: Kevin Tian <kevin.tian@intel.com>
2011-07-08 08:32:37 +01:00
Paul Durrant 80ecb40362 x86/hvm: Don't expose CPUID time leaf when not using PVRDTSCP
Some versions of Oracle's Solaris PV drivers make a check that the
maximal Xen hypervisor CPUID leaf is <= base leaf + 2 and refuse to
work if this is not the case.  The addition of the time leaf makes the
maximal leaf == base leaf + 3 so this patch introduces a workaround
that obscures the time leaf unless PVRDTSCP is in operation.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
2011-07-08 08:31:10 +01:00
Christoph Egger f128d21688 nestedsvm: allow l1 guest to use OSXSAVE
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2011-07-08 08:30:56 +01:00
Liu, Jinsong 6f8f53cc64 x86 cpu: Fix bug: unify cpu_dev attr as __cpuinitdata
Currently different x86 cpu define different attr for cpu_dev.
Some cpu define as __initdata, this would be risk under cpu hotplug.
This patch fix the bug, unify them as __cpuinitdata, as what AMD cpu
define now.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
               Shan, Haitao <haitao.shan@intel.com>
2011-07-08 08:30:41 +01:00
Ian Jackson a49c86dd62 libxl: fix incorrect return of ERROR_INVAL from disk_try_backend
disk_try_backend is supposed to return 0 or the disk backend format.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-07-07 12:35:05 +01:00
Ian Jackson bab1f0a2b0 libxl: sane disk backend selection and validation
Introduce a new function libxl__device_disk_set_backend which
does some sanity checks and determines which backend ought to be used.

If the caller specifies LIBXL_DISK_BACKEND_UNKNOWN (which has the
value 0), it tries PHY, TAP and QDISK in that order.  Otherwise it
tries only the specified value.

libxl__device_disk_set_backend (and its helper function
disk_try_backend) inherit the role (and small amounts of the code)
from validate_virtual_disk.  This is called during do_domain_create
and also from libxl_disk_device_add (for the benefit of hotplug
devices).

It also now takes over the role of the scattered fragments of backend
selection found in libxl_device_disk_add,
libxl_device_disk_local_attach and libxl__need_xenpv_qemu.  These
latter functions now simply do the job for the backend they find has
already been specified and checked.

The restrictions on the capabilities of each backend, as expressed in
disk_try_backend (and to an extent in libxl_device_disk_local_attach)
are intended to be identical to the previous arrangements.

In 23618:3173b68c8a94 combined with 23622:160f7f39841b,
23623:c7180c353eb2, "xl" effectively became much more likely to select
TAP as the backend.  With this change to libxl the default backend
selected by the libxl__device_disk_set_backend is intended to once
again to be PHY where possible.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Ian Campbell <Ian.Campbell@citrix.com>
2011-07-06 18:26:49 +01:00
Olaf Hering e7f49e6bec libxl: testenum.c depends on libxl.h
testenum.c may fail to compile if libxl.h dependencies are not yet met.

In file included from testenum.c:3:
libxl.h:199:26: error: _libxl_types.h: No such file or directory
In file included from testenum.c:3:
libxl.h:203: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
....

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-07-06 16:32:16 +01:00
Keir Fraser db39174bcd x86: Couple of small cleanups after cpuid faulting patch.
Signed-off-by: Keir Fraser <keir@xen.org>
2011-07-04 07:57:32 +01:00
Keir Fraser d22d26c1a7 x86: Remove redundant cpuid-faulting-related BUG_ON I added.
Signed-off-by: Keir Fraser <keir@xen.org>
2011-07-02 09:08:27 +01:00
Liu, Jinsong d972dc6037 x86: cpuid faulting feature enable
Latest Intel processor add cpuid faulting feature. This patch is used
to support cpuid faulting in Xen.  Like cpuid spoofing, cpuid faulting
mainly used to support live migration. When cpuid faulting enabled,
cpuid instruction runs at cpl>0 will produce GP, vmm then emulate
execution of the cpuid instruction. Hence will appear to guest
software the value chosen by the vmm.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
Signed-off-by: Keir Fraser <keir@xen.org>
2011-07-01 22:28:53 +01:00
Christoph Egger 8c626737aa nestedsvm: fix handling of invalid virtual vmcb
When the l1 guest sets up an invalid vmcb then inject VMEXIT(#INVALID)
rather having the host sitting in an endless loop of injecting #UD.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2011-07-01 20:48:00 +01:00
Jan Beulich 0a77045bc6 x86: remove the domain parameter from the guest EOI functions.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
2011-07-01 20:46:54 +01:00
Jan Beulich a03507b3b1 x86: make domain_spin_lock_irq_desc() a wrapper of pirq_spin_lock_irq_desc()
...and drop the now unused struct domain * parameter of the latter.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2011-07-01 20:45:21 +01:00
Jan Beulich cbed78b7be x86: remove unnecessary ALIGN directives
ENTRY() already includes an ALIGN.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2011-07-01 20:44:50 +01:00
Jan Beulich 81855a95f6 x86-64/mmcfg: fix pci_mmcfg_arch_free()
While only used on error paths so far, it should still actually do
something (which iounmap(), being an empty stub, doesn't).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2011-07-01 20:44:21 +01:00
Jan Beulich 442ecc9035 x86: streamline page fault path
#PF is, in all "normal" usage models, the only potentially high
frequency (and hence performance sensitive) exception. Thus make it
the fall-through case into handle_exception (rather than
divide_error for x86-32 and not having one at all for x86-64).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2011-07-01 20:43:55 +01:00
Jan Beulich 9e71918d4f x86: adjust pirq_spin_lock_irq_desc()
Remove unnecessary/bogus assertions and add retry loop matching
domain_spin_lock_irq_desc().

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2011-07-01 20:43:02 +01:00
Jan Beulich 8fa9467a78 x86/EFI: adjust installation logic
We should always install xen.efi into /usr/lib64/efi/; installation
into /boot/efi/efi/$(EFI_VENDOR) remains dependent upon specifying
EFI_VENDOR.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2011-07-01 20:42:22 +01:00
Jan Beulich d89149543d x86/EFI: fix interrupt and fault handling during runtime services calls
The missing piece was the setting up of an accessible GDT prior to
switching page tables (and reverting to the original setting after
having established the normal page tables again afterwards).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2011-07-01 20:41:43 +01:00
George Dunlap 0bb1c9cd22 xentrace: Allow tracing to be enabled at boot
Add a "tevt_mask" parameter to the xen command-line, allowing
trace records to be gathered early in boot.  They will be placed
into the trace buffers, and read when the user runs "xentrace".

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2011-07-01 20:31:18 +01:00
George Dunlap 81ca63ed94 xentrace: Add tracing for IRQ-related events
Add tracing for various IRQ-related events.  Also, move
the exiting TRC_TRACE_IRQ from the "generic" class into the
new TRC_HW_IRQ sub-class.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2011-07-01 20:29:35 +01:00
George Dunlap 88420b5015 xentrace: Make a new hardware-related trace class
Power management seems a very narrow focus for its own class, of
which we have a limited number due to the layout of the trace
records.  Make a hardware-event trace class, and move power management
events into a subclass of those.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2011-07-01 20:22:38 +01:00
Tim Deegan 217c9831a9 x86/mm: fix the non-debug build
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2011-06-30 11:01:04 +01:00
Tim Deegan baa496ade9 Nested p2m: use a linked list for LRU np2m selection.
Because the flush-all-np2ms op doesn't take the np2m lock any more
we can't reorder the p2ms in the array that it will walk.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2011-06-30 10:26:54 +01:00
Tim Deegan 63898815b4 x86/p2m: Add p2m_change_type_range() operation
that defers the nested-p2m flush until the entire batch has been updated.
Use it in the HAP log-dirty operations for tracking VRAM changes.
This should avoid a lot of unpleasant IPI storms as the log-dirty code
on one CPU repeatedly shoots down the nested p2m of another CPU.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2011-06-30 10:26:54 +01:00
Tim Deegan 7b56c0f584 Nested p2m: rework locking around nested-p2m flushes and updates.
The nestedp2m_lock now only covers the mapping from nested-cr3 to
nested-p2m; the tables themselves may be updated or flushed using only
the relevant p2m lock.

This means that the nested-p2m lock is only taken on one path, and
always before any p2m locks.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Acked-by: Christoph Egger <Christoph.Egger@amd.com>
2011-06-30 10:26:54 +01:00
Tim Deegan 625df8ad2f Nested p2m: flush only one p2m table when reallocating.
It's unhelpful to flush all of them when we only need one.

Reported-by: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Acked-by: Christoph Egger <Christoph.Egger@amd.com>
2011-06-30 10:26:54 +01:00
Tim Deegan 7fb0a22e68 Nested p2m: clarify logic in p2m_get_nestedp2m()
This just makes the behaviour of this function a bit more explicit.  It
may be that it also needs to be changed. :)

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Acked-by: Christoph Egger <Christoph.Egger@amd.com>
2011-06-30 10:26:54 +01:00
Tim Deegan 3812cf7656 Nested p2m: remove bogus check of CR3 value.
0 is a valid CR3 value; CR3_EADDR isn't but there's nothing stopping a
guest from putting it in its VMCB.  The special case was broken anyway
since AFAICT "p2m->cr3" is a nester-cr3 (i.e. p2m-table) value and
guest_cr[3] is an actual-cr3 (pagetable) value.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Acked-by: Christoph Egger <Christoph.Egger@amd.com>
2011-06-30 10:26:54 +01:00
Tim Deegan 67a0e20164 Nested p2m: implement "flush" as a first-class action
rather than using the teardown and init functions.
This makes the locking clearer and avoids an expensive scan of all
pfns that's only needed for non-nested p2ms.  It also moves the
tlb flush into the proper place in the flush logic, avoiding a
possible race against other CPUs.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Acked-by: Christoph Egger <Christoph.Egger@amd.com>
2011-06-30 10:26:54 +01:00
Konrad Rzeszutek Wilk 7e9ee87b3e libxc: Squash xc_e820.h (and delete) into xenctrl.h
.. as there is no need to keep that internal header file anymore.
We export two functions xc_domain_[set|get]_memory_map which
depend on the 'struct e820entry' defined in 'xc_e820.h'.

We move the contents of the 'xc_e820.h' to the 'xenctrl.h' fixing
compiler errors when applications outside the Xen tree are trying
to compile against the libraries.

Tested-by: Daniel Castro <evil.dani@gmail.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-06-28 18:15:44 +01:00
Keir Fraser 98883d0bb7 x86_32: Fix buil dafter EFI MPS patch.
Signed-off-by: Keir Fraser <keir@xen.org>
2011-06-28 14:45:36 +01:00
Ian Jackson 163a741ea3 QEMU_TAG update 2011-06-28 14:01:53 +01:00
Roger Pau Monne 685373b4bc xend: NetBSD portability fix for LVM raw volume names
Xen 4.1.1 was incorrectly passing /dev/rmapper/vg-lvname to pygrub
(notice the r in front of mapper), when it should pass
/dev/mapper/rvg-lvname (add the r to the last file) when using NetBSD.
I've patched it to work correctly. I'm attaching a unified diff with
the patch made against Xen 4.1.1 (it's a really simple modification).

From: Roger Pau Monne <roger.pau@entel.upc.edu>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-06-28 13:56:53 +01:00
Ian Jackson 30a8a75228 xl: new "check-xl-disk-parse" test script for disk parser
This runs "xl -N block-attach 0 <some strings>" for various sets of
strings and checks that the output is as expected.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
2011-06-28 12:19:17 +01:00