Commit Graph
23832 Commits
Author SHA1 Message Date
Stefano Stabellini cee3fd7bb8 Clone and build Seabios by default
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2011-09-13 10:30:09 +01:00
Stefano Stabellini 9233be8d2c Clone and build upstream Qemu by default
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2011-09-13 10:29:14 +01:00
Stefano Stabellini 145854fa0d Rename ioemu-dir as qemu-xen-traditional-dir
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2011-09-13 10:27:53 +01:00
Stefano Stabellini 088276d615 Move the ioemu-dir-find shell script to an external file
Add support for configuring upstream qemu and rename ioemu-remote
ioemu-dir-remote.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2011-09-13 10:27:20 +01:00
Olaf Hering 5b6fdcc0d8 xenpaging: use batch of pages during final page-in
Map up to RING_SIZE pages in exit path to fill the ring instead of
populating one page at a time.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
2011-09-13 10:25:32 +01:00
Ian Campbell d7d2447395 hvmloader: don't clear acpi_info after filling in some fields
In particular the madt_lapic0_addr and madt_csum_addr fields are
filled in while building the tables.

This fixes a bluescreen on shutdown with certain versions of Windows.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Reported-by: Christoph Egger <Christoph.Egger@amd.com>
Tested-and-acked-by: Christoph Egger <Christoph.Egger@amd.com>
2011-09-13 10:22:03 +01:00
Tim Deegan 4cb7001d84 x86/mm: use new page-order interfaces in nested HAP code
to make 2M and 1G mappings in the nested p2m tables.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
2011-09-08 15:13:06 +01:00
Tim Deegan 84f8baf807 x86/mm: adjust paging interface to return superpage sizes
to the caller of paging_ga_to_gfn_cr3()

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
2011-09-08 15:13:06 +01:00
Tim Deegan a18dd4934f x86/mm: adjust p2m interface to return superpage sizes
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
2011-09-08 15:13:06 +01:00
Olaf Hering 55a63ea713 p2m-ept: remove map_domain_page check
map_domain_page() can not fail, remove ASSERT in ept_set_entry().

Signed-off-by: Olaf Hering <olaf@aepfle.de>
2011-09-07 10:37:48 +01:00
Jan Beulich 5326da0cc5 x86: remove unnecessary indirection from irq_complete_move()'s sole parameter
Signed-off-by: Jan Beulich <jbeulich@suse.com>
2011-09-07 10:37:20 +01:00
Jan Beulich cd4ab341d2 bitmap_scnlistprintf() should always zero-terminate its output buffer
... as long as it has non-zero size. So far this would not happen if
the passed in CPU mask was empty.

Also fix the comment describing the return value to actually match
reality.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
2011-09-07 10:36:55 +01:00
Keir Fraser 090a543628 docs: Fix 'make docs'
Signed-off-by: Keir Fraser <keir@xen.org>
2011-09-06 15:49:40 +01:00
Olaf Hering 47f81623da mem_event: use mem_event_mark_and_pause() in mem_event_check_ring()
Signed-off-by: Olaf Hering <olaf@aepfle.de>
2011-09-05 15:10:28 +01:00
Olaf Hering 46d0343de0 mem_event: add ref counting for free requestslots
If mem_event_check_ring() is called by many vcpus at the same time
before any of them called also mem_event_put_request(), all of the
callers must assume there are enough free slots available in the ring.

Record the number of request producers in mem_event_check_ring() to
keep track of available free slots.

Add a new mem_event_put_req_producers() function to release a request
attempt made in mem_event_check_ring(). Its required for
p2m_mem_paging_populate() because that function can only modify the
p2m type if there are free request slots. But in some cases
p2m_mem_paging_populate() does not actually have to produce another
request when it is known that the same request was already made
earlier by a different vcpu.


mem_event_check_ring() can not return a reference to a free request
slot because there could be multiple references for different vcpus
and the order of mem_event_put_request() calls is not known. As a
result, incomplete requests could be consumed by the ring user.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
2011-09-05 15:10:09 +01:00
Andrew Cooper fdf2123364 IRQ: Introduce old_vector to irq_cfg
Introduce old_vector to irq_cfg with the same principle as
old_cpu_mask.  This removes a brute force loop from
__clear_irq_vector(), and paves the way to correct bitrotten logic
elsewhere in the irq code.

Signed-off-by Andrew Cooper <andrew.cooper3@citrix.com>
2011-09-05 15:09:24 +01:00
Andrew Cooper 8d8bc3af88 IRQ: Fold irq_status into irq_cfg
irq_status is an int for each of nr_irqs which represents a single
boolean variable.  Fold it into the bitfield in irq_cfg, which saves
768 bytes per CPU with per-cpu IDTs in use.

Signed-off-by Andrew Cooper <andrew.cooper3@citrix.com>
2011-09-05 15:08:38 +01:00
Andrew Cooper 0ba296917d IRQ: Remove bit-rotten code
irq_desc.depth is a write only variable.
LEGACY_IRQ_FROM_VECTOR(vec) is never referenced.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
2011-09-05 15:02:11 +01:00
George Dunlap ba3d7de6ce xen, vtd: Fix device check for devices behind PCIe-to-PCI bridges
On some systems, requests devices behind a PCIe-to-PCI bridge all
appear to the IOMMU as though they come from from slot 0, function 0
on that device; so the mapping code much punch a hole for X:0.0 in the
IOMMU for such devices.  When punching the hole, if that device has
already been mapped once, we simply need to check ownership to make
sure it's legal.  To do so, domain_context_mapping_one() will look up
the device for the mapping with pci_get_pdev() and look for the owner.

However, if there is no device in X:0.0, this look up will fail.

Rather than returning -ENODEV in this situation (causing a failure in
mapping the device), try to get the domain ownership from the iommu
context mapping itself.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2011-09-05 15:00:46 +01:00
George Dunlap 3ec1e58d33 xen: Add global irq_vector_map option, set if using AMD global intremap tables
As mentioned in previous changesets, AMD IOMMU interrupt
remapping tables only look at the vector, not the destination
id of an interrupt.  This means that all IRQs going through
the same interrupt remapping table need to *not* share vectors.

The irq "vector map" functionality was originally introduced
after a patch which disabled global AMD IOMMUs entirely.  That
patch has since been reverted, meaning that AMD intremap tables
can either be per-device or global.

This patch therefore introduces a global irq vector map option,
and enables it if we're using an AMD IOMMU with a global
interrupt remapping table.

This patch removes the "irq-perdev-vector-map" boolean
command-line optino and replaces it with "irq_vector_map",
which can have one of three values: none, global, or per-device.

Setting the irq_vector_map to any value will override the
default that the AMD code sets.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2011-09-05 15:00:15 +01:00
Keir Fraser 9d032eca4a ns16550: Simplify UART and UART-interrupt probing logic.
1. No need to check for UART existence in the polling routine. We
already check for UART existence during boot-time initialisation (see
check_existence() function).

2. No obvious need to send a dummy character. The poll routine will
run until a character is eventually sent, but for the most common use
of serial ports (console logging) that will happen almost immediately.

Signed-off-by: Keir Fraser <keir@xen.org>
2011-09-02 14:56:26 +01:00
Ian Campbell 8a36a4acd1 xen/x86: only support >128 CPUs on x86_64
32 bit cannot cope with 256 cpus and hits:

    /* At least half the ioremap space should be available to us. */
    BUILD_BUG_ON(IOREMAP_VIRT_START + (IOREMAP_MBYTES << 19) >=
    FIXADDR_START);

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2011-09-01 17:46:43 +01:00
Tim Deegan 43b036a94c x86/mm: use defines for page sizes rather hardcoding them.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
2011-09-01 09:39:25 +01:00
Stefano Stabellini 1aa9c4f626 xen: get_free_pirq: make sure that the returned pirq is allocated
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2011-08-31 15:23:49 +01:00
Stefano Stabellini a7ffe0fdec xen: __hvm_pci_intx_assert should check for gsis remapped onto pirqs
If the isa irq corresponding to a particular gsi is disabled while the
gsi is enabled, __hvm_pci_intx_assert will always inject the gsi
through the violapic, even if the gsi has been remapped onto a pirq.
This patch makes sure that even in this case we inject the
notification appropriately.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2011-08-31 15:23:34 +01:00
Stefano Stabellini 79858fee30 xen: fix hvm_domain_use_pirq's behavior
hvm_domain_use_pirq should return true when the guest is using a
certain pirq, no matter if the corresponding event channel is
currently enabled or disabled.  As an additional complication, qemu is
going to request pirqs for passthrough devices even for Xen unaware
HVM guests, so we need to wait for an event channel to be connected
before considering the pirq of a passthrough device as "in use".

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2011-08-31 15:23:12 +01:00
Andrew Cooper 12b6ea528f IRQ: manually EOI migrating line interrupts
When migrating IO-APIC line level interrupts between PCPUs, the
migration code rewrites the IO-APIC entry to point to the new
CPU/Vector before EOI'ing it.

The EOI process says that EOI'ing the Local APIC will cause a
broadcast with the vector number, which the IO-APIC must listen to to
clear the IRR and Status bits.

In the case of migrating, the IO-APIC has already been
reprogrammed so the EOI broadcast with the old vector fails to match
the new vector, leaving the IO-APIC with an outstanding vector,
preventing any more use of that line interrupt.  This causes a lockup
especially when your root device is using PCI INTA (megaraid_sas
driver *ehem*)

However, the problem is mostly hidden because send_cleanup_vector()
causes a cleanup of all moving vectors on the current PCPU in such a
way which does not cause the problem, and if the problem has occured,
the writes it makes to the IO-APIC clears the IRR and Status bits
which unlocks the problem.

This fix is distinctly a temporary hack, waiting on a cleanup of the
irq code.  It checks for the edge case where we have moved the irq,
and manually EOI's the old vector with the IO-APIC which correctly
clears the IRR and Status bits.  Also, it protects the code which
updates irq_cfg by disabling interrupts.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
2011-08-31 15:19:24 +01:00
Kevin Tian a81d0ee933 x86: add irq count for IPIs
such count is useful to assist decision make in cpuidle governor,
while w/o this patch only device interrupts through do_IRQ is
currently counted.

Signed-off-by: Kevin Tian <kevin.tian@intel.com>
2011-08-31 15:18:23 +01:00
Dietmar Hahn 2f4c78e40f vpmu: Add processors Westmere E7-8837 and SandyBridge i5-2500 to the vpmu list
Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
2011-08-31 15:17:45 +01:00
Laszlo Ersek 9da0c5b639 x86: Increase the default NR_CPUS to 256
Changeset 21012:ef845a385014 bumped the default to 128 about one and a
half years ago. Increase it now to 256, as systems with eg. 160
logical CPUs are becoming (have become) common.

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
2011-08-31 15:16:14 +01:00
Christoph Egger 2aab6a3a7f nestedsvm: VMRUN doesn't use nextrip
VMRUN does not use nextrip. So remove pointless assignment.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2011-08-31 15:15:41 +01:00
Keir Fraser 773f372b6b x86-64: Fix off-by-one error in __addr_ok() macro
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Keir Fraser <keir@xen.org>
2011-08-31 15:14:49 +01:00
Ian Jackson 423df429f7 Merge 2011-08-30 11:46:58 +01:00
Keir Fraser ee991a2daf Config.mk: Include optional .config file *first* rather than *last*
Allows the core of Config.mk to correctly respond to any configuration
overrides specified in the .config file.

Signed-off-by: Keir Fraser <keir@xen.org>
2011-08-27 12:20:19 +01:00
Jan Beulich 32e447cde1 x86: drop unused parameter from msi_compose_msg() and setup_msi_irq()
This particularly eliminates the bogus passing of NULL by hpet.c.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2011-08-27 12:15:07 +01:00
Jan Beulich de95a738fd x86: work around certain Intel BIOSes causing (transient) hangs during boot
They apparently leave the USB legacy emulation bits set in ICH10's
SMI Control and Enable register, but fail to handle the resulting SMIs
gracefully. The hangs can apparently extend indefinitely, but are
commonly observed to last between a few seconds and a minute.

This assumes that only ICH10-based systems on Intel main boards with
Intel BIOS may be affected. Until Intel comes up with a more precise
identification of affected BIOSes, all Intel ones on Intel boards
will get this workaround applied.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2011-08-27 12:14:38 +01:00
Jan Beulich 04d708ca09 x86-64: allow mapping mmcfg space for high numbered PCI segments
Rather than using the segment number directly when determining the
virtual address for a particular mmconfig block, use the array index
instead. Thus a system with (perhaps significantly) less than 2048 PCI
segments, but with some having numbers beyond 2047 can actually have
all its mmconfig blocks mapped.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2011-08-27 12:13:39 +01:00
Kaushik Kumar Ram eab869a86a Add missing 'break' statement.
Without the 'break', assigning a pci device to a PV guest results in an abort,
since the code always falls through to the default abort case in the switch
statement.

Signed-off-by: Kaushik Kumar Ram <kaushik@rice.edu>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-08-26 14:58:41 +01:00
Tim Deegan e6492f348b Update my email address in MAINTAINERS
Signed-off-by: Tim Deegan <tim@xen.org>
2011-08-26 13:06:39 +01:00
Christoph Egger 1069d63c5e x86/mm/p2m: use defines for page sizes
Use defines for page sizes instead of hardcoding the value.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
2011-08-26 13:00:52 +01:00
Tim Deegan 17ffc59805 passthrough: Turn on IOMMU/HAP pagetable sharing by default.
Signed-off-by: Tim Deegan <tim@xen.org>
2011-08-25 12:03:14 +01:00
David Vrabel e675405f3a x86: don't limit dom0's maximum reservation by the available memory
Set dom0's initial maximum reservation using the max value supplied in
the dom0_mem command line option without limiting it by the available
memory.

This allows dom0 to make use of any hotplugged memory without having
to also adjust the maximum reservation.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Acked-by: Jan Beulich <jbeulich@novell.com>
2011-08-24 09:33:10 +01:00
Tim Deegan 91326b5491 Passthrough: fix iommu_use_hap_pt() to use hap_enabled()
In line with 22924:86000076dcee, paging_mode_hap(d) shouldn't be
used in HAP internals that are called during HAP setup.

Signed-off-by: Tim Deegan <tim@xen.org>
2011-08-23 10:54:27 +01:00
Tim Deegan ce686e3169 IOMMU: only try to share IOMMU and HAP tables for domains with P2M.
This makes the check more precise, and brings VTd in line with AMD code.

Signed-off-by: Tim Deegan <tim@xen.org>
2011-08-23 10:43:25 +01:00
Tim Deegan 6abdf3c829 VT-d: Explicitly test EPT capabilities during IOMMU init
because the cached version isn't set up until the EPT init happens.

Signed-off-by: Tim Deegan <tim@xen.org>
2011-08-23 10:43:20 +01:00
George Dunlap 45627433b2 x86: Fix up irq vector map logic
We need to make sure that cfg->used_vector is only cleared once;
otherwise there may be a race condition that allows the same vector to
be assigned twice, defeating the whole purpose of the map.

This makes two changes:
* __clear_irq_vector() only clears the vector if the irq is not being
moved
* smp_iqr_move_cleanup_interrupt() only clears used_vector if this
is the last place it's being used (move_cleanup_count==0 after
decrement).

Also make use of asserts more consistent, to catch this kind of logic
bug in the future.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2011-08-22 16:15:33 +01:00
Keir Fraser 1ded71e27c Adjust non-debug ASSERT() definition to avoid unused-variable warnings.
Signed-off-by: Keir Fraser <keir@xen.org>
2011-08-22 16:15:19 +01:00
Christoph Egger e7fc68d874 nested-p2m: suppress np2m flushes during p2m setup
There is no need to send IPIs within p2m_alloc_table() via
set_p2m_entry().

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Committed-by: Tim Deegan <tim@xen.org>
2011-08-22 14:37:29 +01:00
Jan Beulich 1d6ffea6d0 ACPI: add _PDC input override mechanism
In order to have Dom0 call _PDC with input fully representing Xen's
capabilities, and in order to avoid building knowledge of Xen
implementation details into Dom0, this provides a mechanism by which
the Dom0 kernel can, once it filled the _PDC input buffer according to
its own knowledge, present the buffer to Xen to apply overrides for
the parts of the C-, P-, and T-state management that it controls. This
is particularly to address the dependency of Xen using MWAIT to enter
certain C-states on the availability of the break-on-interrupt
extension (which the Dom0 kernel should have no need to know about).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2011-08-22 10:12:36 +01:00
Jan Beulich 2fba91e1d9 x86/IO-APIC: clear remoteIRR in clear_IO_APIC_pin()
It was found that in a crash scenario, the remoteIRR bit in an IO-APIC
RTE could be left set, causing problems when bringing up a kdump
kernel. While this generally is most important to be taken care of in
the new kernel (which usually would be a native one), it still seems
desirable to also address this problem in Xen so that (a) the problem
doesn't bite Xen when used as a secondary emergency kernel and (b) an
attempt is being made to save un-fixed secondary kernels from running
into said problem.

Based on a Linux patch from suresh.b.siddha@intel.com.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2011-08-22 10:11:10 +01:00