Keir Fraser [Thu, 4 Dec 2008 11:36:18 +0000 (11:36 +0000)]
Fix existence check for MMIO-mapped 16550 UARTs
Changeset 982e6fce0e47 added an existence test for UARTs.
Unfortunately, the existence test happens before MMIO UARTs are
ioremapped, therefore it may not be probing where it thinks it's
probing. Rather than moving more code around, I think it's probably
safe to assume the arch code knows what it's doing if it passes in an
MMIO UART.
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Keir Fraser [Thu, 4 Dec 2008 11:31:37 +0000 (11:31 +0000)]
xend: Remember bootloader settings in xenstore
When xend is restarted, bootloader settings of all running domains are
lost. The attached patches fixes this by saving bootloader and
bootloader_args to xenstore database.
Keir Fraser [Wed, 3 Dec 2008 15:55:32 +0000 (15:55 +0000)]
AMD IOMMU: Fix event log interrupt handling
Reset EventLogInt bit in iommu status register(MMIO offset 2020h) in
event log interrupt handler, to show software has handled the
interrupt. Completion wait interrupt is disabled.
Keir Fraser [Wed, 3 Dec 2008 11:44:47 +0000 (11:44 +0000)]
physdev: make PHYSDEVOP_pirq_eoi_mfn use of gmfn instead of mfn.
To pass a page from a guest to hypervisor, gmfn should be used
instead of mfn like grant table and other hypercalls. It's more
consistent. So make use of gmfn instead of mfn for
PHYSDEVOP_pirq_eoi_mfn hypercall.
Keir Fraser [Tue, 2 Dec 2008 11:53:24 +0000 (11:53 +0000)]
Fix Xen panic with oprofile
The attached patch fixes a Xen panic when a domain is shutdown before
oprofile is stopped. Without this patch, free_xenoprof_pages() is
called before the domain is destroyed and that, in turn, prevents
oprofile from cleaning up pages shared with guests. Shutting down a
domain without terminating oprofile therefore causes a Xen panic at a
later point in time.
Keir Fraser [Fri, 28 Nov 2008 13:27:32 +0000 (13:27 +0000)]
x86: add a shared page indicating the need for an EOI notification
To simplify the interface for the guest, when a guest uses this new
(sub-)hypercall, PHYSDEVOP_eoi behavior changes to unmask the
corresponding event channel at once, avoiding the eventual need for a
second hypercall from the guest.
Signed-off-by: Jan Beulich <jbeulich@novell.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Fri, 28 Nov 2008 13:05:58 +0000 (13:05 +0000)]
xend: Fix device release for tap devices
I saw an error message when I shut down a domain. The error
message showed that release of device(vbd/51712) failed. But the
device was tap, was not vbd. I think that a cause of the error message is
because _releaseDevices() calls destroyDevice() by wrong device class.
Keir Fraser [Fri, 28 Nov 2008 13:04:30 +0000 (13:04 +0000)]
xm: Relax the sanity check on guest configuration with XSM-ACM addlabel
The attached patch relaxes the sanity check on guest configuration
when assigning a acm label to the guest. This patch makes a guest
configuration accept a bootloader parameter. This is common for
paravirtualized guests to boot them by using pygrub.
Keir Fraser [Thu, 27 Nov 2008 16:22:14 +0000 (16:22 +0000)]
x86_emulate: Fix for test harness and simplify some opcodes.
- Need to use EFLG_DF rather than EF_DF
- No need to force EAX destination for many opcodes, as this will be
the default behaviour for DstReg with no ModRM.
Keir Fraser [Thu, 27 Nov 2008 11:22:38 +0000 (11:22 +0000)]
VT-d code cleanup
- remove a printk line. This printk may be output too many on some
platforms, thus result in hang during dom0 booting.
- add write buffer flush in domain_context_unmap_one()
- when map/unmap context, if context is not flushed, needn't to flush
iotlb
Signed-off-by: Weidong Han <weidong.han@intel.com>
Keir Fraser [Tue, 25 Nov 2008 11:17:57 +0000 (11:17 +0000)]
Fix PSE PAT handling in guest walk.
Guest walk was currently checking for _PAGE_PSE_PAT flag in
guest_l2e_get_flags(). The problem is that this function only checks
for the first 12 bits of the PDE, while _PAGE_PSE_PAT is actually on bit
12 (that is the 13th bit). This caused _PAGE_PAT bit to never been set on
splintered L1s.
Keir Fraser [Mon, 24 Nov 2008 11:17:44 +0000 (11:17 +0000)]
hvmloader: Relocate the etherboot ROM to be near the end of VGA
BIOS. Current Xen hard coded VGA ROM at 0xC0000 and etherboot ROM
at 0xD0000. This makes the space in [0xC0000 - 0xDFFFF] to be
fragments, which makes it hard to find enough space to hold another
Option ROM.
Keir Fraser [Mon, 24 Nov 2008 11:11:20 +0000 (11:11 +0000)]
pv-on-hvm drivers: build fixes for Linux 2.6.27+
Make the drivers build properly in a 2.6.27 environment as well as
against a kernel with pv-ops Xen configured on (in the latter case
more work would be needed to also make the drivers work, as there's a
large number of duplicate exports).
Portions from Charles Arnold <carnold@novell.com>.
Keir Fraser [Mon, 24 Nov 2008 11:06:16 +0000 (11:06 +0000)]
PCI interface changes for PCIE-AER enabling
This patch reflects some pci interface changes in pciif.h in XEN head
file. And also add domain shutdown support in xend for shutting domain
from DOM0 kernel when non-recoverable uncorrected pci error happens.
Signed-off-by: Jiang Yunhong <yunhong.jiang@intel.com> Signed-off-by: Ke Liping <liping.ke@intel.com>
Keir Fraser [Thu, 20 Nov 2008 14:23:59 +0000 (14:23 +0000)]
x86: make NR_IRQS build-time configurable
While keeping the NR_IRQS default at 256 here, I think it would be a
good thing to set it to a higher value to make sure no new mixing of
irq and vector spaces slip in.
Keir Fraser [Thu, 20 Nov 2008 14:22:54 +0000 (14:22 +0000)]
Properly distinguish irq and vector spaces
This makes sure that there are no assumptions about NR_IRQS==NR_VECTORS
anymore, and it also renames various variables to properly reflect
what they represent.
While coded correctly, I wonder whether dump_irqs() shouldn't iterate
over the vector space rather than the irq space, so that MSI entries
are also processed.
Keir Fraser [Thu, 20 Nov 2008 14:17:09 +0000 (14:17 +0000)]
xend: Make _setCPUAffinity() errors nonfatal on domain resume
This patch allows domains to be resumed on different number of CPUs. After
c/s 18764, a domain cannot be resumed when _setCPUAffinity() fails, which
happens when affinity should be set to a non-existent CPU. This patch
makes _setCPUAffinity() errors nonfatal.
Keir Fraser [Wed, 19 Nov 2008 13:17:31 +0000 (13:17 +0000)]
x86, s3: Sync platform stamps at time suspend.
platform_timer_stamp and stime_platform_stamp are synced
to platform timer in time calibration (1s interval), and
thus doesn't reflect the latest value. If they're not
synced at time suspend, the offset can be lost after S3
resume. Average 0.8s lag-behind is observed for each S3
action, which accumulates to TOD inaccuracy.
Keir Fraser [Tue, 18 Nov 2008 15:59:26 +0000 (15:59 +0000)]
x86, hvm: Fix domain restore bug with Intel VLAPIC acceleration.
r18383 mark video memory as ram, and make all valid pages migrated,
including vlapic page (0xFEE00), and share page(0xFFFFF).
An extra memory population for lapic page would override previous
mapping then cause HVM guest with vlapic acceleration hang.
Keir Fraser [Tue, 18 Nov 2008 11:16:36 +0000 (11:16 +0000)]
x86, hvm: Implement interrupt routing to least priority processor.
Instead of round robin the vcpu with the lowest processor
priority is selected for the interrupt. If multiple vcpus
share the same low priority then interrupts are distributed between
those round robin.
This patch removes all the useless big endian stuff from the mini-os.
Before there was an effort to support big endian for PV-guest.
But the big endian support was never gotten into the common parts of
the mini-os so it makes no sense to have this only in the ia64
specific sources. And as there is no open source big endian os and
porting our BS2000 os to ia64 was stopped, nobody wants that stuff
in the common minos.
So this looks ugly then and remove the big endian stuff.
Keir Fraser [Thu, 13 Nov 2008 16:31:08 +0000 (16:31 +0000)]
x86: don't disable MSI in order to mask an IRQ
... as that's not really correct, and there are devices which can't
even cope with that. Instead, check whether an MSI IRQ can be masked,
and if it can't, treat it just like a level triggered IO-APIC IRQ.
There's one other bug fix in here, correcting an off-by-one error on
the entry_nr range check in __pci_enable_msix().
Keir Fraser [Thu, 13 Nov 2008 13:03:16 +0000 (13:03 +0000)]
x86: Use the shadow-code PT walker from the HAP functions
Replace the guts of the HAP pagetable walker with a call to the
newly-commonified walker from the shadow code. This reduces
duplication, and gives HAP guests proper access control and A/D-bit
setting for memory accesses from the emulator
Keir Fraser [Wed, 12 Nov 2008 12:04:15 +0000 (12:04 +0000)]
x86: add SSE-based copy_page()
In top of the highmem asstance hypercalls added earlier, this provides
a performance improvement of another 12% (measured on Xeon E5345) for
the page copying case.
Keir Fraser [Tue, 11 Nov 2008 11:03:58 +0000 (11:03 +0000)]
minios: add a barebone net/if.h
net/if.h is a standard header but unfortunately lwip doesn't provide
it for any target but linux. Therefore I am adding a net/if.h, with an
empty implementation of the declared functions.
Keir Fraser [Mon, 10 Nov 2008 10:41:41 +0000 (10:41 +0000)]
vtd: fix interrupt remapping to handle SMI RTE's with uninitialized
reserved fields
Some BIOS does not zero out reserve fields in IOAPIC RTE's.
clear_IO_APIC() zeroes out all RTE's except for RTE with MSI delivery
type. This is a problem when the host OS converts SMI delivery type
to some other type but leaving the reserved field uninitialized. This
can cause interrupt remapping table out of bound error if "format"
field is 1 and the uninitialized "index" field has a value that that
is larger than the maximum index of interrupt remapping table.
Isaku Yamahata [Fri, 7 Nov 2008 10:34:59 +0000 (19:34 +0900)]
[IA64] Fix frametable_miss handling for HVM guests.
For hvm guests, hypervisor use mfn_valid to check mfn, but it will incur
weird faults. It is becasue ipsr is saved in r29, but frametalbe miss assumes
saved in r21.
Keir Fraser [Wed, 5 Nov 2008 10:57:21 +0000 (10:57 +0000)]
x86: PV support for hugepages
Hugepage support must be enabled via the hypervisor command line
option "allowhugepage". There is currently no support in the tools for
saving/restoring/migrating guests who use hugepages.
Signed-off-by: Dave McCracken <dave.mccracken@oracle.com>
Keir Fraser [Wed, 5 Nov 2008 10:23:26 +0000 (10:23 +0000)]
xend, security: Prevent changing of the policy while VMs are migrating
The net changes of this patch are that the reader-side lock is put
into the path of the migration code and the writer lock into the path
of the code that handles the changing of the policy. Simultaneous
migrations of multiple hosts still work after this lock has been added.
Keir Fraser [Wed, 5 Nov 2008 10:22:19 +0000 (10:22 +0000)]
xend: Add a multi-reader-single-writer lock implementation
This patch adds a reader-writer lock primitive to xend since python
does not provide it by default. The implementation is based on a
condition variable. Some test code is appended at the end of the file.