Commit Graph
18164 Commits
Author SHA1 Message Date
Keir Fraser e8ea651a7a x86, hvm: Fix issue with user-mode writes to read-only memory.
This patch fixes an issue where a guest could get stuck if a write to
memory marked p2m_ram_ro happened from user mode. It would get
misinterpreted as a user-mode page-table write, and the "dummy write"
emulation necessary to skip over the instruction never got done. In
looking into this, I also discovered that the user-mode page-table
check is done in two places, the second (in emulate_map_dest) of which
can never be reached and is just a waste of cycles. Tim Deegan
requested that rather than completely removing that code, I'd leave it
in for debug-builds with an added warning-print.

Signed-off-by: Trolle Selander <trolle.selander@eu.citrix.com>
2008-07-29 13:24:57 +01:00
Keir Fraser 8d375aa174 rombios: Narrow window where BIOS area is writable, and ensure it
really *is* writable in that region. This is almost enough to get S3
working again (read-only firmware-waking-vector is still a problem).

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-07-29 13:11:29 +01:00
Keir Fraser 5c23498926 x86: reprogram LAPIC timer in pit_broadcast_exit
Thus to remove possible timer expiring delay caused by deep C state
LAPIC timer stopping.

Signed-off-by: Wei Gang <gang.wei@intel.com>
2008-07-29 10:42:30 +01:00
Keir Fraser ef5cb4e6a0 vtd: Fix some dmar bugs
In acpi_parse_one_drhd(), remove return directly when only one
INCLUDE_ALL check fails, so that avoid memory leak. In addition,
remove "dmaru->scope.devices_cnt == 0 && !dmaru->include_all" check,
due to PCI-PCI bridges are not counted.

This patch fixes bug #1307.

Signed-off-by: Weidong Han <weidong.han@intel.com>
2008-07-29 10:41:41 +01:00
Keir Fraser 06efa7c664 x86: fix a few page table handling issues
- adjust_guest_l?e() shouldn't be called on non-guest entries
- unadjust_guest_l3e() should be called in the back-out loop of
  alloc_l3_table()
- create_pae_xen_mappings() and pae_flush_pgd() shouldn't be called in
  the failure case of mod_l3_entry()

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2008-07-29 10:05:32 +01:00
Keir Fraser 043521fecd Fix ia64 build.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-07-29 09:57:14 +01:00
Keir Fraser accacb43cb Simplify 'dma heap' logic.
1. Only useful for NUMA systems, so turn it off on non-NUMA systems by
   default.
2. On NUMA systems, by default relate the DMA heap size to NUMA node 0
   memory size (so that not all of node 0's memory ends up being 'DMA
   heap').
3. Remove the 'dma emergency pool'. It's less useful now that running
   out of low memory isn;t as fatal as it used to be (e.g., when we
   needed to be able to allocate low-memory PAE page directories).

Based on patches by Andre Przywara and Xiaowei Yang.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-07-28 16:40:30 +01:00
Keir Fraser f5219467e7 Default dma_bitsize is 30.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-07-28 16:06:03 +01:00
Keir Fraser bddc6f497e Change cpufreq_controller from meanless FREQCTL_none to FREQCTL_xen
Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
2008-07-28 13:39:47 +01:00
Keir Fraser a76bb0a4ff Move xen-pm options from dom0 cmdline option to start info.
Thus to avoid xen-pm being manually enforced by end user in dom0
cmdline but without enabling them in xen.

signed-off-by: Wei Gang <gang.wei@intel.com>
2008-07-28 11:43:54 +01:00
Keir Fraser a4fe67df67 xenapi: Update the xenapi document for pci device assignment support.
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2008-07-28 11:40:21 +01:00
Keir Fraser bfd0dbdd08 fs-back: build fixes for BSD and cleanups.
Signed-of-by: Christoph Egger <Christoph.Egger@amd.com>
2008-07-28 11:39:32 +01:00
Keir Fraser 839f06eff1 x86: extend debug key 't' to collect useful clock skew info
By repeating "xm debug-key t; xm dmesg | tail -N" in
dom0 (e.g. with the "watch" command), useful skew info
about the machine can be collected, which will be very
helpful for diagnosing customer problems on misbehaving
machines.

Patch details:
1) Min and max readings from the current sample are useless
so get rid of those but retain the current maxdif (stime skew).
2) Remember max of skew, sum of skews, and a count
so average skew can be displayed.
3) Also record info for cycles (tsc on x86, itc on ia64).

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
2008-07-28 11:36:39 +01:00
Keir Fraser 42bcbe769e x86: Roughly synchronise calls to local_time_calibration().
This results in reduced skew; both max and average skew are reduced by
between a factor of 2 and 3.  Note that timers still fire at slightly
different times because the next "round epoch" is still relative to
local stime which still has some inter-processor skew.

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
2008-07-28 11:33:28 +01:00
Keir Fraser 5589b0008c xend, pci passthru: Use Dstate transition to do FLR for integrated
devices without proper FLR capability.

Currently integrated devices without proper FLR capability are not
assignable. This is not nice since actually they may be assignable,
but due to old BIOS the proper FLR capability is not exposed. We can
use the previously-used Dstate transition method to do FLR for them.
This works well and looks few issues are reported AFAIK. Maybe we can
make a black list for the (rare) integrated devices that don't work
with this method.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2008-07-28 11:29:23 +01:00
Keir Fraser 3c456fd628 xend, pci passthru: Relax the requirement of co-assignment.
Certain PCI or PCIe devices needs to be co-assigned. Currently we
require all the related devices be assigned to the same guest. This
can be relaxed to: part of them can be assgined to the same guest, and
after that, the left ones can't be assigned.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2008-07-28 11:28:45 +01:00
Keir Fraser a7d2697092 xend: Improve the error prompt when xc.test_assign_device() fails.
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2008-07-28 11:27:48 +01:00
Keir Fraser 64e2962929 Update Xen version for 3.3.0-rc2-pre 2008-07-25 15:03:03 +01:00
Keir Fraser 6528b3a3ca Added tag 3.3.0-rc1 for changeset c3494402098e26507fc61a6579832c0149351d6a 2008-07-25 15:02:06 +01:00
Keir Fraser 2d05476a74 Update Xen version for 3.3.0-rc1. 3.3.0-rc1 2008-07-25 15:01:59 +01:00
Keir Fraser 07740ee912 Add some directories created by the stubdom build to .hgignore.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2008-07-25 14:01:31 +01:00
Keir Fraser 26c26ff17a x86_emulate: fix unintended writeback on cmp/test instructions
This patch fixes an issue when x86_emulate is called with
force_writeback=1 set. It resulted in cmp and test instructions with
memory operands to have the mem value written back after instruction
emulation finished. This caused false alarms on writes to RO mem, and
might have caused other issues if unintended writes occured to device
registers in mmio space.

Signed-off-by: Trolle Selander <trolle.selander@eu.citrix.com>
2008-07-25 14:00:27 +01:00
Keir Fraser f6e4baff82 Support using a specific branch or tag of ioemu-remote
With this patch you can set QEMU_TAG to check out a specific version.
When we set it, QEMU_TAG ought to be in Config.mk, I think.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2008-07-25 13:59:07 +01:00
Keir Fraser cead514ad8 xend: fix dual destroy
After changeset 18030 and 18064 were checked in, I found some issues
when creating HVM domains with devices assigned.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2008-07-25 13:58:23 +01:00
Keir Fraser ee7be8aa51 stubdom: avoid re-making mk-headers and thus newlib etc.
Using a stamp file for mk-headers permits to avoid to re-run newlib
configuration etc.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-07-25 10:06:53 +01:00
Keir Fraser 2406df9ada fs-backend: fix FD allocation for file creation
The creation operation also opens a file, we need to allocate a
virtual fd for that too.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-07-25 09:49:06 +01:00
Keir Fraser 410dbc38e8 x86: adds put_domain() for breaks in arch_do_domctl().
Signed-off-by: Weidong Han <weidong.han@intel.com>
2008-07-25 09:47:41 +01:00
Keir Fraser 4ae5a52192 vtd: change code style of pci.c file, and add spin_unlock(&pdev->lock)
when iommu_add_device() fails.

Signed-off-by: Weidong Han <weidong.han@intel.com>
2008-07-25 09:46:27 +01:00
Keir Fraser e8424702c5 vtd: There is only one INCLUDE_ALL DMAR unit in system, but no
restriction on whether it's the last unit.

Signed-off-by: Weidong Han <weidong.han@intel.com>
2008-07-25 09:45:41 +01:00
Keir Fraser fa88cfadf9 vt-d: Map RMRR in intel_iommu_add_device() if the device has RMRR;
move domain_context_mapping() to be in front of list_move() in
reassign_device_ownership().

Signed-off-by: Weidong Han <weidong.han@intel.com>
2008-07-25 09:44:48 +01:00
Keir Fraser dba5b800e3 stubdom: fix do_xen_hypercall error report
call.result is an unsigned long

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-07-25 09:40:14 +01:00
Keir Fraser c4241bc454 stubdom: make sure to use old tree for now
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-07-24 17:36:27 +01:00
Keir Fraser ae41a026ab minios: grant table map (gntdev) bug fixes
* Uninitialized dev_bus_addr argument to GNTTABOP_unmap_grant_ref
   results in an angry hypervisor.
 * Set errno in libxc and return -1 on error.
 * op.status is a int16_t, so it should be printed with PRId16.
 * Don't print domids[0] or refs[0] if the ptr is NULL. It's more
   polite to crash later, after the message has been printed.

Signed-off-by: Diego Ongaro <diego.ongaro@citrix.com>
2008-07-24 17:34:50 +01:00
Keir Fraser b45184b0fc minios: Fix build on some gcc versions.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-07-24 17:33:40 +01:00
Keir Fraser 499da5e253 tools: use $(PREFIX) rather than hard-coding /usr
Signed-off-by: Jan Beulich <jbeulich@novell.com>
2008-07-24 14:33:28 +01:00
Keir Fraser 6f79893756 tools: remove type parameter from xc_physdev_map_pirq{,_msi}()
... as it's implied by the function name.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2008-07-24 14:18:58 +01:00
Keir Fraser 26b4c342ea x86: rename MSI option
Also rename the variable and move its declaration to a header.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2008-07-24 14:18:05 +01:00
Keir Fraser 4fc2348da5 x86/32on64: add missing physdev compat mode definitions
Signed-off-by: Jan Beulich <jbeulich@novell.com>
2008-07-24 14:17:14 +01:00
Keir Fraser c039177d82 x86: XENPF_set_processor_pminfo handler adjustments
Only handle information passed up from dom0 when actually controlling
the respective functionality. Only count up CPUs once for each CPU.
Allow dom0 to provide information incrementally.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2008-07-24 14:16:47 +01:00
Keir Fraser 7d0b678231 minios: grant table map (gntdev) for minios
I've implemented a grant map for mini-os to support the xc_gnttab_*()
functions, the equivalent of gntdev in linux. This is useful for my
work in putting xenstored in a stub domain.

Signed-off-by: Diego Ongaro <diego.ongaro@citrix.com>
2008-07-24 14:14:27 +01:00
Keir Fraser b5d7ddffa7 ioemu: fix spurious track_dirty_vram warning
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-07-24 14:12:46 +01:00
Keir Fraser 597e548eef mini-os: select call incorrectly reports xce_handle as ready
The current implementation in minios of xc_evtchn_pending doesn't set
read=0 when there is exactly one port pending. This resulted in
select() incorrectly reporting the file descriptor as ready.

Signed-off-by: Diego Ongaro <diego.ongaro@citrix.com>
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-07-24 14:11:47 +01:00
Keir Fraser fd6a37dbdc pv-grub: re-implement xc_map_foreign_ranges
Also get rid of va and npages members of privcmd_mmap_entry since we
do not need them any more.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-07-24 14:10:45 +01:00
Keir Fraser 0905190686 rombios: S3 resume data must be in EBDA.
Rombios itself is read-only.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-07-24 13:44:08 +01:00
Keir Fraser d4a22e75c9 blktap: Clean *.opic on 'make clean'.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-07-24 11:19:13 +01:00
Keir Fraser 28f8960f3e libxc: Fix after xc_map_foreign_ranges() patch.
Must munmap() region after loading elf image.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-07-24 11:18:53 +01:00
Keir Fraser ce29ad450c libxc: Clean up xc_map_foreign_ranges() interface to hide the
underlying mmap() invocation.

From: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-07-23 16:39:46 +01:00
Keir Fraser 6de959a1f6 hvm: Fix intra-vga-mem mmio in stdvga.c
The current stdvga code never checks if the copy_from/to_guest calls
fail, and thus silenty fails if both sides of an IOREQ_COPY points
into mmio space. This patch fixes this and makes the code correctly
handle intra-vga-mem copies, as well as log & turn off caching if some
more "exotic" type of mmio (say, copy from vga mem to some other
device's iomem), so that such mmio reqs will fall through to regular
ioemu where they can hopefully be handled correctly.

In practice, this patch fixes a number of graphical glitches for
guests running in standard vga mode, including a corrupted OS/2 boot
graphic.

Signed-off-by: Trolle Selander <trolle.selander@eu.citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@eu.citrix.com>
2008-07-23 13:31:57 +01:00
Keir Fraser 9cd4e059ae vtd: no need to flush iotlb or write buffer in iommu_page_mapping().
Signed-off-by: Weidong Han <weidong.han@intel.com>
2008-07-23 09:59:21 +01:00
Keir Fraser 597683c799 vtd: During parsing DMAR table, if find RMRR is incorrect, return error.
Signed-off-by: Weidong Han <weidong.han@intel.com>
2008-07-23 09:58:48 +01:00