Commit Graph
18860 Commits
Author SHA1 Message Date
Keir Fraser e7a89ddbf9 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.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2008-12-04 11:31:37 +00:00
Keir Fraser 66664705d9 xentop: Fix xentop for blktap
Blktap devices information isn't shown by xentop currently.

xen-unstable c/s 17813 said "blktap devices have statistics
counters (e.g., rd_req, wr_req, oo_req) prepended by tap_".
In fact, it is as follows.

# ls -l /sys/devices/xen-backend/tap-1-769/statistics/
total 0
-r--r--r-- 1 root root 4096 Dec  3 20:37 oo_req
-r--r--r-- 1 root root 4096 Dec  3 20:37 rd_req
-r--r--r-- 1 root root 4096 Dec  3 20:37 rd_sect
-r--r--r-- 1 root root 4096 Dec  3 20:37 wr_req
-r--r--r-- 1 root root 4096 Dec  3 20:37 wr_sect

The statistics counters haven't had "tap_" because it was removed
by linux-2.6.18-xen c/s 34.

This patch reverts xen-unstable c/s 17813, then we can get the
blktap devices information by using xentop.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-12-03 15:58:23 +00:00
Keir Fraser 1c8299d846 AMD IOMMU: Invalidate all pages on domain destruction
Attached patch adds support to invalidate all pages associated with
the same domain ID on domain destruction.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
2008-12-03 15:56:33 +00:00
Keir Fraser 371971198e AMD IOMMU: Propagate HyperTransport settings from IVHD table to control register
Attached patch propagate HyperTransport settings suggested by IVHD
table to iommu control register(MMIO offset 0018h).

Signed-off-by: Wei Wang <wei.wang2@amd.com>
2008-12-03 15:56:05 +00:00
Keir Fraser c6312a2cdb 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.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
2008-12-03 15:55:32 +00:00
Keir Fraser 0a59d0d01a Fix the HVM save hypercall to avoid freeing an uninitalised pointer.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2008-12-03 15:54:24 +00:00
Keir Fraser 7ee660e381 Do not request domain shutdown if in S3 state during domain save.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-12-03 15:12:19 +00:00
Keir Fraser ea755e0433 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.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-12-03 11:44:47 +00:00
Keir Fraser 964960aa18 x86: Fix mfn_to_virt() to cast MFN to address size.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-12-03 11:38:36 +00:00
Keir Fraser 1c185534be x86: No need for short jmp before long hjmp when setting CR0.PE
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-12-03 11:21:34 +00:00
Keir Fraser ff0b9e1254 xenpmd: Adjust strncat() length to avoid static buffer overflow.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-12-02 22:17:22 +00:00
Keir Fraser 3f5125965b 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.

Signed-off-by: Niraj Tolia <niraj.tolia@hp.com>
2008-12-02 11:53:24 +00:00
Keir Fraser cedf79a3b2 pvgrub: value returned by getrtsecs should be BCD
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-12-01 13:45:46 +00:00
Keir Fraser fd3c09b029 x86: Fix PHYSDEVOP_pirq_eoi_mfn, which I modified and broke.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-11-29 09:07:52 +00:00
Keir Fraser 272ec2ee7d x86: remove unused parameter/arguments from flush_ready_eoi()
Signed-off-by: Jan Beulich <jbeulich@novell.com>
2008-11-28 13:28:16 +00:00
Keir Fraser 83850d485c 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>
2008-11-28 13:27:32 +00:00
Keir Fraser c4e83a1484 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.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-11-28 13:05:58 +00:00
Keir Fraser 2fdd853ff5 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.

Signed-off-by: INAKOSHI Hiroya <inakoshi.hiroya@jp.fujitsu.com>
2008-11-28 13:04:30 +00:00
Keir Fraser 1f80f21b47 shadow: fix the fix for promotion/resync race.
Signed-off-by: Gianluca Guida <gianluca.guida@eu.citrix.com>
2008-11-28 12:02:43 +00:00
Keir Fraser 735b2f96e0 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.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-11-27 16:22:14 +00:00
Keir Fraser 7f470fe5a9 Avoid warn_unused_result build failure on fgets().
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-11-27 12:43:25 +00:00
Keir Fraser c44f6b3172 x86, hpet: check hpet existence
Add check on hpet existence which is removed accidentally
in previous changeset (18790). Or else BAD PERIOD error can be seen.

Signed-off-by: Kevin Tian <kevin.tian@intel.com>
2008-11-27 11:24:52 +00:00
Keir Fraser 4825311686 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>
2008-11-27 11:22:38 +00:00
Keir Fraser 89fcb252a1 shadow: set fast_emul to zero when emulating to an out-of-sync page.
A small missing thing on the original out of sync patch.
No real bug, but it's better to correctly specify the path.

Signed-off-by: Gianluca Guida <gianluca.guida@eu.citrix.com>
2008-11-27 11:21:19 +00:00
Keir Fraser 2f73ee2697 Merge with ia64 tree. 2008-11-26 11:14:26 +00:00
Keir Fraser 63e8b90794 timer: Print timer fn when dump timer queue
Print timer fn when dump timer queue, which would be
useful to understand type of the timer.

Signed-off-by Kevin Tian <kevin.tian@intel.com>
2008-11-26 11:11:26 +00:00
Keir Fraser 26943a1d94 vtd: cleanups
- potential issues in vtd_page_fault() handler
 - wrong print messages
 - existing ATS code in dmar.c.

Signed-off-by: Allen Kay <allen.m.kay@intel.com>
2008-11-26 11:08:45 +00:00
Keir Fraser 2853fea7b0 xen: Fix gcc 4.3 build failure.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-11-26 11:07:44 +00:00
Isaku Yamahata 5fb5ca3d1b merge with xen-unstable.hg 2008-11-26 10:23:49 +09:00
Keir Fraser 712cd1b8c9 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.

Signed-off-by: Gianluca Guida <gianluca.guida@eu.citrix.com>
2008-11-25 11:17:57 +00:00
Isaku Yamahata 772cdea233 merge with xen-unstable.hg 2008-11-25 14:21:24 +09:00
Keir Fraser ba10bcb00f hvmloader: Pass BDF to PCI option ROMs.
Signed-off-by: Shan Haitao <Haitao.shan@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-11-24 13:57:48 +00:00
Keir Fraser 6641cb8ee3 hvmloader: Load physical PCI option ROMs where available.
Signed-off-by: Shan Haitao <Haitao.shan@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-11-24 13:43:28 +00:00
Keir Fraser 66d936fdab 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.

Signed-off-by: Shan Haitao <haitao.shan@intel.com>
2008-11-24 11:17:44 +00:00
Keir Fraser 6d72e644df shadow: fix race between resync and page promotion.
This patch fixes a (hopefully) rare-occurring problem causing memory
corruption in 64 bit guests (and assertion failures in debug build
xen).

On a pagefault, set_l{3,4}e's resync_all was able to give write access
to a page in the guest still not shadowed.

Signed-off-by: Gianluca Guida <gianluca.guida@eu.citrix.com>
2008-11-24 11:12:20 +00:00
Keir Fraser c65b3f8832 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>.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2008-11-24 11:11:20 +00:00
Keir Fraser 71a732a2b8 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>
2008-11-24 11:06:16 +00:00
Keir Fraser 39bef5bcf0 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.

Tested with NR_IRQS forced to 1024.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2008-11-20 14:23:59 +00:00
Keir Fraser f0f1915d27 Eliminate NR_IRQ_VECTORS
Signed-off-by: Jan Beulich <jbeulich@novell.com>
2008-11-20 14:23:33 +00:00
Keir Fraser c193d476f0 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.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2008-11-20 14:22:54 +00:00
Keir Fraser a5b98f7f34 x86: freeze non-current vCPUs of dom0 before entering S5
Signed-off-by: Jan Beulich <jbeulich@novell.com>
2008-11-20 14:21:17 +00:00
Keir Fraser ed2dbb7a0f 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.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2008-11-20 14:17:09 +00:00
Keir Fraser 9e70091fd7 x86, hpet: Fix initialisation of secondary timers.
Each channel may have different settings, and in the original
implementation, other Tn configuration will accidently overwrite T0
configuration.

Signed-off-by: Guanqun Lu <guanqun.lu@intel.com>
2008-11-20 14:15:50 +00:00
Keir Fraser c014d5785e xenapi: fix valid_object typo
Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
2008-11-20 14:14:20 +00:00
Keir Fraser ee324ed5c4 x86: Fix build for some versions of gcc.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-11-19 19:13:22 +00:00
Keir Fraser 65408dcf21 x86: secure ioapic_guest_write() against FREE_TO_ASSIGN irq values
Signed-off-by: Jan Beulich <jbeulich@novell.com>
2008-11-19 16:11:39 +00:00
Keir Fraser ceb1434f7d x86: support CPUID hypervisor feature bit
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-11-19 16:10:39 +00:00
Keir Fraser e1054557f9 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.

Signed-off-by Kevin Tian <kevin.tian@intel.com>
2008-11-19 13:17:31 +00:00
Keir Fraser de48794325 Remove Xen-private definitions from kexec public header.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-11-19 13:13:39 +00:00
Keir Fraser 71e53fef6c xen s3, No need to check idle vcpu before update_vcpu_system_time().
Signed-off-by: Kevin Tian <kevin.tian@intel.com>
2008-11-19 12:52:03 +00:00