Commit Graph
23841 Commits
Author SHA1 Message Date
Juergen Gross 2411017e28 libxc: Enable cpuid performance counter leaf for HVM
In HVM domains the usable performance counters can be checked
automatically only, if cpuid leaf 0x0000000a is accessible.

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-09-15 15:26:07 +01:00
Olaf Hering 1f9d04fb02 xenstored: allow guest to shutdown all its watches/transactions
During kexec all old watches have to be removed, otherwise the new
kernel will receive unexpected events. Allow a guest to reset itself
and cleanup all of its watches and transactions.

Add a new XS_RESET_WATCHES command to do the reset on behalf of the
guest.

(Changes by iwj: specify the argument to be a single nul byte.  Permit
read-only clients to use the new command.)

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-09-15 11:08:05 +01:00
Ian Jackson dcbc297aea tools: Revert seabios and upstream qemu build changes
These have broken the build and it seems to be difficult to fix.  So
we will revert the whole lot for now, and await corrected patch(es).

Revert "fix the build when CONFIG_QEMU is specified by the user"
Revert "tools: fix permissions of git-checkout.sh"
Revert "scripts/git-checkout.sh: Is not bash specific. Invoke with /bin/sh."
Revert "Clone and build Seabios by default"
Revert "Clone and build upstream Qemu by default"
Revert "Rename ioemu-dir as qemu-xen-traditional-dir"
Revert "Move the ioemu-dir-find shell script to an external file"

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-09-14 11:38:13 +01:00
Stefano Stabellini 2093b2b5db fix the build when CONFIG_QEMU is specified by the user
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2011-09-13 15:46:47 +01:00
Ian Jackson bcbf8c5464 tools: fix permissions of git-checkout.sh
23828:0d21b68f528b introduced a new scripts/git-checkout.sh, but it
had the wrong permissions.  chmod +x it, and add a blank line at the
end to make sure it actually gets updated.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-09-13 14:52:22 +01:00
Keir Fraser 6018608caf scripts/git-checkout.sh: Is not bash specific. Invoke with /bin/sh.
Signed-off-by: Keir Fraser <keir@xen.org>
2011-09-13 11:20:57 +01:00
George Dunlap d0ac87b3c0 xen,credit1: Add variable timeslice
Add a xen command-line parameter, sched_credit_tslice_ms,
to set the timeslice of the credit1 scheduler.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2011-09-13 10:43:43 +01:00
Andrew Cooper ac710413f6 IRQ: IO-APIC support End Of Interrupt for older IO-APICs
The old io_apic_eoi() function using the EOI register only works for
IO-APICs with a version of 0x20.  Older IO-APICs do not have an EOI
register so line level interrupts have to be EOI'd by flipping the
mode to edge and back, which clears the IRR and Delivery Status bits.

This patch replaces the current io_apic_eoi() function with one which
takes into account the version of the IO-APIC and EOI's
appropriately.

v2: make recursive call to __io_apic_eoi() to reduce code size.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
2011-09-13 10:33:10 +01:00
Stefano Stabellini 2569814496 xen: if mapping GSIs we run out of pirq < nr_irqs_gsi, use the others
PV on HVM guests can have more GSIs than the host, in that case we
could run out of pirq < nr_irqs_gsi. When that happens use pirq >=
nr_irqs_gsi rather than returning an error.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Tested-by: Benjamin Schweikert <b.schweikert@googlemail.com>
2011-09-13 10:32:24 +01:00
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