]> xenbits.xensource.com Git - xen.git/log
xen.git
16 years agostubdom: Fix newlib-chk.patch so it applies
Keir Fraser [Wed, 1 Apr 2009 07:36:21 +0000 (08:36 +0100)]
stubdom: Fix newlib-chk.patch so it applies
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agostubdom: Add newlib-chk.patch
Keir Fraser [Tue, 31 Mar 2009 17:37:58 +0000 (18:37 +0100)]
stubdom: Add newlib-chk.patch

From: "George S. Coker, II" <gscoker@alpha.ncsc.mil>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
16 years agoSimplify spinlock code and re-enable IRQs where possible when spinning.
Keir Fraser [Tue, 31 Mar 2009 14:03:59 +0000 (15:03 +0100)]
Simplify spinlock code and re-enable IRQs where possible when spinning.

Based on a patch by Juergen Gross.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agohvmloader: ROMBIOS must POST in big real mode, since it supports PMM,
Keir Fraser [Tue, 31 Mar 2009 13:04:50 +0000 (14:04 +0100)]
hvmloader: ROMBIOS must POST in big real mode, since it supports PMM,
and hence Option ROMs can expect noi segment limit checks.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agoxend: Fix domain creation.
Keir Fraser [Tue, 31 Mar 2009 12:57:11 +0000 (13:57 +0100)]
xend: Fix domain creation.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agobuild: Get rid of some more hardcoded install paths
Keir Fraser [Tue, 31 Mar 2009 12:30:50 +0000 (13:30 +0100)]
build: Get rid of some more hardcoded install paths
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
16 years agox86: Enable S3 for 32bit dom0 on 64bit Xen
Keir Fraser [Tue, 31 Mar 2009 12:28:45 +0000 (13:28 +0100)]
x86: Enable S3 for 32bit dom0 on 64bit Xen

Three SYSENTER MSRs should be taken care of at save/restore BSP
context, or else 32bit dom0 rejects working after S3 resume. Thanks
for Jan's help to find this missing part.

Signed-off-by: Guanqun Lu <guanqun.lu@intel.com>
Signed-off-by: Kevin Tian <kevin.tian@intel.com>
16 years agohvmloader acpi: Reserve ioport ranges for expanded PHP
Keir Fraser [Tue, 31 Mar 2009 12:27:03 +0000 (13:27 +0100)]
hvmloader acpi: Reserve ioport ranges for expanded PHP

Now there are two control registers plus one register for
each of the 32 PHP slots. A total of 34 registers. Accordingly the
ioport space required has expanded by from 3 to 34 bytes.

Signed-off-by: Simon Horman <horms@verge.net.au>
hvmloader acpi: Use If and Else instead of Switch

Signed-off-by: Simon Horman <horms@verge.net.au>
16 years agox86: unify BUG() & Co, reduce overhead on x86-64
Keir Fraser [Tue, 31 Mar 2009 12:23:11 +0000 (13:23 +0100)]
x86: unify BUG() & Co, reduce overhead on x86-64

Since it's only the string pointer representations that differ between
i386 and x86-64, abstract out those and make everything else shared.

While touching this code, also use
- proper instructions rather than a mixture of such and raw .byte/
  .long/.quad data emissions,
- PC-relative pointers on x86-64 to cut the amount of storage (and
  in particular cache space) needed for string references by half.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
16 years agoUse unlikely() in BUG_ON()/WARN_ON()
Keir Fraser [Tue, 31 Mar 2009 12:22:12 +0000 (13:22 +0100)]
Use unlikely() in BUG_ON()/WARN_ON()

-fno-reorder-blocks was added in c/s 1712, when x86-64 just started to
become enabled. The reason it got added is entirely unclear to me, and
it prevents the intended effect of unlikely() constructs (in
particular
the ones added here) of moving out of line code which is expected to
never get executed, as well as using forward branches (which are
statically predicted taken by various processors' branch prediction
units) preferably to reach infrequently executed code.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
16 years agoia64, pygrub: Allow command-line editing in Lilo boot loader
Keir Fraser [Tue, 31 Mar 2009 12:21:36 +0000 (13:21 +0100)]
ia64, pygrub: Allow command-line editing in Lilo boot loader

On IA64 platform reset() function has one more parameter for Lilo
bootloader used by IA64 than for GRUB bootloader used for other
platforms.

Signed-off-by: Michal Novotny <minovotn@redhat.com>
16 years agoxend: less noise in xend-debug.log on HVM shutdown
Keir Fraser [Tue, 31 Mar 2009 12:20:04 +0000 (13:20 +0100)]
xend: less noise in xend-debug.log on HVM shutdown

Shutting down a hvm, xend-debug.log always shows:

Unhandled exception in thread started by=20
Traceback (most recent call last):
  File "//usr/lib64/python/xen/xend/image.py", line 549, in
  _sentinel_watch
    self._dmfailed(message)
  File "//usr/lib64/python/xen/xend/image.py", line 491, in _dmfailed
    xc.domain_shutdown(self.vm.getDomid(), DOMAIN_CRASH)
xen.lowlevel.xc.Error: (3, 'No such process')

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
16 years agoxend: Check for valid CPU_CAP value when creating new domain
Keir Fraser [Tue, 31 Mar 2009 12:19:07 +0000 (13:19 +0100)]
xend: Check for valid CPU_CAP value when creating new domain

Signed-off-by: Michal Novotny <minovotn@redhat.com>
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
16 years agox86 mce: fix and clean up c/s 19423
Keir Fraser [Tue, 31 Mar 2009 12:17:48 +0000 (13:17 +0100)]
x86 mce: fix and clean up c/s 19423

- fix inverted return value check for intel_mce_{rd,wr}msr()
- fix broken initialization of d->arch.vmca_msrs.mci_ctl
- remove pointless (!d || is_idle_domain(d)) checks
- eliminate hard-coded limit to 9 banks
- avoid redundant gdprintk()s

Signed-off-by: Jan Beulich <jbeulich@novell.com>
16 years agox86: small adjustment to asm constraints for c/s 19400
Keir Fraser [Tue, 31 Mar 2009 12:14:10 +0000 (13:14 +0100)]
x86: small adjustment to asm constraints for c/s 19400

Properly indicate the variable that the asm writes to, and allow
compiler more freedom in selecting a suitable input operand for the
ltr instruction.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
16 years agox86 mce: fix c/s 18938
Keir Fraser [Tue, 31 Mar 2009 12:12:35 +0000 (13:12 +0100)]
x86 mce: fix c/s 18938

Provide for up to 16/32 on (32/64-bit) extended MCE MSRs, and use
actually existing extended MSRs on 64-bits that were inaccessible so
far.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
16 years agox86 mce: fix c/s 17968 for 32-on-64
Keir Fraser [Tue, 31 Mar 2009 12:11:56 +0000 (13:11 +0100)]
x86 mce: fix c/s 17968 for 32-on-64

32-on-64 aspects were not properly considered. Add respective
checking, and adjust structure layouts for the cases where the
checking pointed out issues.

Also,
- fix a potential memory corruption issue (do_mca() could write beyond
  log_cpus' end if the guest specified less than the number of online
  CPUs
- there is no reason to make the (not even properly prefixed)
  definitions in xen/public/arch-x86/xen-mca.h globally visible by
  including the file from xen/public/arch-x86/xen.h.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
16 years agominios: Extend struct blkfront_aiocb.
Keir Fraser [Tue, 31 Mar 2009 11:06:57 +0000 (12:06 +0100)]
minios: Extend struct blkfront_aiocb.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
16 years agotools build: No need for LFS flags on NetBSD.
Keir Fraser [Tue, 31 Mar 2009 10:55:42 +0000 (11:55 +0100)]
tools build: No need for LFS flags on NetBSD.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
16 years agovtd: fix multiple Dom0 S3 on hosts that support Queued Invalidation.
Keir Fraser [Tue, 31 Mar 2009 10:54:12 +0000 (11:54 +0100)]
vtd: fix multiple Dom0 S3 on hosts that support Queued Invalidation.

On such hosts we can't do multiple Dom0 S3 when VT-d is enabled.
The cause is: during the first S3 resume, init_vtd_hw() initializes
the invalidation function pointers to the register-based ones and later
enable_qinval() forgets to overwrite the flush function pointers to
queued-based ones, so actually Queued Invalidaton is enabled, but we
actually use the register-based invalidation function! Later during
the second Dom0 S3, in iommu_suspend() -> iommu_flush_all(), we try to
use the register-based invalidation functions to perform global flush
while Queued Invalidation is enabled, and this can cause a host reset
because VT-d spec says: when the queued invalidation is enabled,
software must submit invalidation commands only through the IQ (and
not through any invalidation command registers).

The attached patch fixes the buggy enable_qinval(). And in
iommu_resume(), we invoke iommu_flush_all() for safety.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
16 years agocpuidle: suspend/resume scheduler tick timer during cpu idle state entry/exit
Keir Fraser [Tue, 31 Mar 2009 10:51:56 +0000 (11:51 +0100)]
cpuidle: suspend/resume scheduler tick timer during cpu idle state entry/exit

cpuidle can collaborate with scheduler to reduce unnecessary timer
interrupt. For example, credit scheduler accounting timer
doesn't need to be active at idle time, so it can be stopped at
cpuidle entry and resumed at cpuidle exit. This patch implements this
function by adding two ops in scheduler: tick_suspend/tick_resume, and
implement them for credit scheduler

Signed-off-by: Yu Ke <ke.yu@intel.com>
Signed-off-by: Tian Kevin <kevin.tian@intel.com>
16 years agoxend: Return True from device_update when cfg_xenapi
Keir Fraser [Tue, 31 Mar 2009 10:49:56 +0000 (11:49 +0100)]
xend: Return True from device_update when cfg_xenapi

When device_update is called by using cfg_xenapi, this patch
returns True.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
16 years agoXenAPI: Implement {get,set}_auto_power_on
Keir Fraser [Tue, 31 Mar 2009 10:48:07 +0000 (11:48 +0100)]
XenAPI: Implement {get,set}_auto_power_on

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
16 years agox86: Clean up atomic.h comments and asm specifiers.
Keir Fraser [Tue, 31 Mar 2009 10:47:20 +0000 (11:47 +0100)]
x86: Clean up atomic.h comments and asm specifiers.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agovtd: fix iommu vector leak
Keir Fraser [Tue, 31 Mar 2009 10:41:13 +0000 (11:41 +0100)]
vtd: fix iommu vector leak

When we do Dom0 S3 for many times, iommu_set_interrupt() would fail
during S3 resume because it can't obtain vector. We should not request
new vector for every Dom0 S3 resume. We should re-use the same vector.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
16 years agoxend: Allow user to specify vslots 0 - 1f for static pass-through
Keir Fraser [Tue, 31 Mar 2009 10:40:28 +0000 (11:40 +0100)]
xend: Allow user to specify vslots 0 - 1f for static pass-through

The current parser only accepts vslots 0 - f (hex), that is, only
slots that have one digit. This is an omission as two digit slots
with a leading 0 or 1 are also valid, representing the
full range of slots 0 - 1f.

Thanks to Dexuan Cui for spotting this problem.

Cc: Dexuan Cui <dexuan.cui@intel.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
16 years agoxen: include MSI/MSI-X information in interrupt debug output
Keir Fraser [Tue, 31 Mar 2009 10:39:32 +0000 (11:39 +0100)]
xen: include MSI/MSI-X information in interrupt debug output

With per-domain irq-to-vector mappings, dump_irqs() omitted some
vectors. This patch cycles through the vectors rather than
interrupts and prints the same debug information. The patch also
prints out information about mapped but unbound interrupts.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@netronome.com>
16 years agoxenctx: Teach xenctx how to find the right addresses in real-mode.
Keir Fraser [Tue, 31 Mar 2009 10:38:05 +0000 (11:38 +0100)]
xenctx: Teach xenctx how to find the right addresses in real-mode.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
16 years agominios: _chk_fail and _chk canaries for minios and newlib
Keir Fraser [Tue, 31 Mar 2009 10:36:11 +0000 (11:36 +0100)]
minios: _chk_fail and _chk canaries for minios and newlib

Add __stack_chk_fail to mini-os and __sprintf_chk __fprintf_chk to
newlib, to cope with ocaml runtimes compiled with -fstack-protector.

From: "George S. Coker, II" <gscoker@alpha.ncsc.mil>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
16 years agoxenctx: Always show code context, even when not in kernel mode
Keir Fraser [Tue, 31 Mar 2009 10:33:56 +0000 (11:33 +0100)]
xenctx: Always show code context, even when not in kernel mode

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
16 years agolibxc: Fix xc_translate_foreign_address in non-paged mode
Keir Fraser [Tue, 31 Mar 2009 10:32:56 +0000 (11:32 +0100)]
libxc: Fix xc_translate_foreign_address in non-paged mode

Returns paddr rather than gfn when in non-paged mode.  Add a shift to
fix it.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
16 years agoxenapi: Fix VDI:read_only, VDI:sharable and VBD:mode of XenAPI
Keir Fraser [Tue, 31 Mar 2009 10:31:08 +0000 (11:31 +0100)]
xenapi: Fix VDI:read_only, VDI:sharable and VBD:mode of XenAPI

I started a VM by using xm create, then I checked values of VDI
records and values of VBD records.  When I gave the following disk
modes to a disk parameter, I got the following values from the records.

               "r"    "w"    "w!"
VDI:read_only  True   True   True   <-- Always True!
VDI:sharable   True   True   True   <-- Always True!
VBD:mode       RO     RW     RO
                             ^^  <-- It should be RW.

This patch fixes the values of the records as follows.

               "r"    "w"    "w!"
VDI:read_only  True   False  False
VDI:sharable   False  False  True
VBD:mode       RO     RW     RW

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
16 years agoxend: fix hotplug for integrated devices
Keir Fraser [Tue, 31 Mar 2009 10:29:53 +0000 (11:29 +0100)]
xend: fix hotplug for integrated devices

For integrated devices(with bus number 0), self.find_parent() returns
None, causing a python exception here.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
16 years agoxend: Accept udev events about SCSI and update physical SCSI information
Keir Fraser [Tue, 31 Mar 2009 10:28:49 +0000 (11:28 +0100)]
xend: Accept udev events about SCSI and update physical SCSI information

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
16 years agoxend: Fix 'xm pci_list_assignable_devices'
Keir Fraser [Tue, 31 Mar 2009 10:28:08 +0000 (11:28 +0100)]
xend: Fix 'xm pci_list_assignable_devices'

The current implementation of 'xm pci-list-assignable-devices' command
has a problem that it directly invokes hypercall using
xen.lowlevel.xc.
This is probably based on an assumption that the command is executed
on the host itself, but in fact there are cases xm commands can be
executed on a remote server through xmlrpc.
So this patch makes the xm command just inquire of xend about the
information of available devices.

Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
16 years agoxend: Fix scsi_id for pvSCSI
Keir Fraser [Tue, 31 Mar 2009 10:27:10 +0000 (11:27 +0100)]
xend: Fix scsi_id for pvSCSI

pvSCSI allocations fail if the version of udev in a host OS is
relatively new.  I have not been able to detect the failure because
I have used udev of the version 095.  The failure occurs by
an incompatibility problem of scsi_id command included udev.
This patch tackles the incompatibility problem.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
16 years agoxend: Allow drbd disks.
Keir Fraser [Tue, 31 Mar 2009 10:26:10 +0000 (11:26 +0100)]
xend: Allow drbd disks.

From: Ben Timby <btimby@gmail.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agoxend: Supply pass-through vslot to qemu-dm
Keir Fraser [Tue, 31 Mar 2009 10:24:13 +0000 (11:24 +0100)]
xend: Supply pass-through vslot to qemu-dm

Signed-off-by: Simon Horman <horms@verge.net.au>
16 years agoxend: Properly save/restore vnc/vfb configuration
Keir Fraser [Tue, 31 Mar 2009 10:23:38 +0000 (11:23 +0100)]
xend: Properly save/restore vnc/vfb configuration

In 19284:0942BAA2A088 provision was made for running vnc and sdl
simultaneously.  However, arrangements for saving and restoring the
new structure-configuration, and arrangements for allowing the new
code to load old savefiles, were not made.

This patch adds these facilities.  Amongst other things, HVM VNC
save/restore will now work properly again.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
16 years agox86: virt_to_mfn() fixes.
Keir Fraser [Tue, 31 Mar 2009 10:21:14 +0000 (11:21 +0100)]
x86: virt_to_mfn() fixes.

Signed-off-by: Xiaowei Yang <xiaowei.yang@intel.com>
16 years agoxenpm: add cmd set-max-cstate
Keir Fraser [Tue, 31 Mar 2009 10:19:56 +0000 (11:19 +0100)]
xenpm: add cmd set-max-cstate

Signed-off-by: Wei Gang <gang.wei@intel.com>
16 years agocpuidle: export max_cstate access via libxc
Keir Fraser [Tue, 31 Mar 2009 10:19:26 +0000 (11:19 +0100)]
cpuidle: export max_cstate access via libxc

Signed-off-by: Wei Gang <gang.wei@intel.com>
16 years agopygrub: More accurate try/except catch.
Keir Fraser [Tue, 31 Mar 2009 10:17:51 +0000 (11:17 +0100)]
pygrub: More accurate try/except catch.

Signed-off-by: Michal Novotny <minovotn@redhat.com>
16 years agoxend: Save the state of PPCIs after hot-plug events.
Keir Fraser [Tue, 31 Mar 2009 10:16:01 +0000 (11:16 +0100)]
xend: Save the state of PPCIs after hot-plug events.

Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
16 years agoxend: fix domain_migrate
Keir Fraser [Tue, 31 Mar 2009 10:13:56 +0000 (11:13 +0100)]
xend: fix domain_migrate

When the guest(pv-on-hvm guest that cannot suspend) reboot in
LiveMigration, the disconnecting of src-side is not transmitted to
dist-side. As a result, the error processing on the dist side is not
executed.

Signed-off-by: Tomonari Horikoshi <t.horikoshi@jp.fujitsu.com>
16 years agoxend: Disallow bogus MAC addresses when creating new VIF devices
Keir Fraser [Tue, 31 Mar 2009 10:12:39 +0000 (11:12 +0100)]
xend: Disallow bogus MAC addresses when creating new VIF devices

Signed-off-by: Michal Novotny <minovotn@redhat.com>
16 years agointel mce: Small fixes.
Keir Fraser [Tue, 31 Mar 2009 10:10:06 +0000 (11:10 +0100)]
intel mce: Small fixes.

Signed-off-by: Frank van der Linden <Frank.Vanderlinden@Sun.COM>
16 years agox86 acpi: Delete unnecessary and broken RSDP-scanning code.
Keir Fraser [Mon, 30 Mar 2009 15:48:26 +0000 (16:48 +0100)]
x86 acpi: Delete unnecessary and broken RSDP-scanning code.

Signed-off-by: Keir Fraser <keir.fraser@eu.citrix.com>
16 years agomerge with xen-unstable.hg
Isaku Yamahata [Fri, 27 Mar 2009 02:07:11 +0000 (11:07 +0900)]
merge with xen-unstable.hg

16 years ago[IA64] ia64 counter part of 19374:e655cb27d085.
Isaku Yamahata [Fri, 27 Mar 2009 01:54:08 +0000 (10:54 +0900)]
[IA64] ia64 counter part of 19374:e655cb27d085.

This patch is the ia64 counter part of 19374:e655cb27d085.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
16 years agolibxc: fix link error of xc_save on ia64
Keir Fraser [Tue, 24 Mar 2009 06:55:29 +0000 (06:55 +0000)]
libxc: fix link error of xc_save on ia64

The suspend event channel functions are arch independent code
which xc_save uses.
The changeset of 19382:a5f497f02e34 cause link error on ia64.
This patch moves the functions into arch common file from
x86 specific file xc_domain_save.c

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
16 years agox86: Build fixes and cleanups after Intel MCA changes.
Keir Fraser [Fri, 20 Mar 2009 17:42:46 +0000 (17:42 +0000)]
x86: Build fixes and cleanups after Intel MCA changes.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agoMCA interfaces between XEN/DOM0, let DOM0 know the MCA recovery action
Keir Fraser [Fri, 20 Mar 2009 17:25:29 +0000 (17:25 +0000)]
MCA interfaces between XEN/DOM0, let DOM0 know the MCA recovery action

Signed-off-by: Jiang, yunhong <yunhong.jiang@intel.com>
Signed-off-by: Ke, liping <liping.ke@intel.com>
16 years agoImplements Guest MCE# MSR read/write virtualization
Keir Fraser [Fri, 20 Mar 2009 17:24:53 +0000 (17:24 +0000)]
Implements Guest MCE# MSR read/write virtualization

Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
Signed-off-by: Ke, Liping <liping.ke@intel.com>
16 years agox86: Core support for Intel MCA support
Keir Fraser [Fri, 20 Mar 2009 17:24:29 +0000 (17:24 +0000)]
x86: Core support for Intel MCA support

Those patches based on AMD and SUN's MCA related jobs.
We have latest rebase after SUN's latest improvements.
We will have late following patches for recovery actions. This is a
basic framework for Intel.

Some implementation notes:
1) When error happens, if the error is fatal (pcc = 1) or can't be
recovered (pcc = 0, yet no good recovery methods),
    for avoiding losing logs in DOM0, we will reset machine
    immediately. Most of MCA MSRs are sticky. After reboot,
    MCA polling mechanism will send vIRQ to DOM0 for logging.
2) When MCE# happens, all CPUs enter MCA context. The first CPU who
read&clear the error MSR bank will be this
    MCE# owner. Necessary locks/synchronization will help to judge the
    owner and select most severe error.
3) For convenience, we will select the most offending CPU to do most
of processing&recovery job.
4) MCE# happens, we will do three jobs:
    a. Send vIRQ to DOM0 for logging
    b. Send vMCE# to Impacted Guest (Currently Only inject to impacted
    DOM0)
    c. Guest vMCE MSR virtualization
5) Some further improvement/adds for newer CPUs might be done  later
    a) Connection with recovery actions (cpu/memory online/offline)
    b) More software-recovery identification in severity_scan
    c) More refines and tests for HVM might be done when needed.

This patch Enable basic MCA support For Intel

Signed-off-by: Jiang, Yunhong<yunhong.jiang@intel.com>
Signed-off-by: Ke, Liping <Liping.ke@intel.com>
16 years agox86: Enable Xen C-state management by default.
Keir Fraser [Fri, 20 Mar 2009 15:38:46 +0000 (15:38 +0000)]
x86: Enable Xen C-state management by default.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agopygrub: run first entry in config when invalid default boot option provided
Keir Fraser [Fri, 20 Mar 2009 15:37:33 +0000 (15:37 +0000)]
pygrub: run first entry in config when invalid default boot option provided

This behaviour matches that of real GRUB.

Signed-off-by: Michal Novotny <minovotn@redhat.com>
16 years agoCPUIDLE: enable MSI capable HPET for timer broadcast
Keir Fraser [Fri, 20 Mar 2009 12:33:55 +0000 (12:33 +0000)]
CPUIDLE: enable MSI capable HPET for timer broadcast

The HPET broadcast was default not enabled because the old code use
HPET channel 0 in legacy replacing mode which will hide both PIT & RTC
irqs and cause issues if RTC is needed in some cases. The upstream
default broadcast timer is PIT, which is in periodic mode (100HZ) and
would be expensive to be used as oneshot. MSI capable HPET is coming
into being. It is capable to deliver interrupt through FSB directly,
and has no side effect.

This patch extends support for MSI HPET based on original legacy HPET
code. The broadcast timer selection logic becomes: 1. if MSI capable HPET
available, use multiple HPET channels (no more than possible cpu num)
in MSI mode; 2. else if legacy replacing mode available for HPET &
'hpetbroadcast' option is given in cmd line, use HPET channel 0 in
legacy mode; 3 else use PIT.

While entering broadcast, it gets a hpet channel (look for a spare one
first, if failing allocate a shared one), attach to current cpu, setup
the irq affinity & broadcast cpumask. While exiting broadcast, it
detach the used hpet channel and try to change the owner if the
broadcast mask is not empty. Some optimizations(static affinity) were
done for (MSI HPET channels >= possible cpu num) case.

A new hw_interrupt_controller 'HPET_MSI' is created for HPET MSI
interrupt handling.

Signed-off-by: Wei Gang <gang.wei@intel.com>=
16 years agoxend: specify the slot for pass-through devices
Keir Fraser [Fri, 20 Mar 2009 12:09:20 +0000 (12:09 +0000)]
xend: specify the slot for pass-through devices

Currently a slot may be specified for a hot-plug device,
but not for a pass-through device that is inserted at boot time.
This patch adds support for the latter.

The syntax is:
     BUS:DEV.FUNC[@VSLOT]
e.g: 0000:00:1d:0@7

This may be important as recent changes that allow any free PCI
slot to be used for pass-through (and hotplug) may case pass-through
devices to be assigned in different locations to before. Amongst
other things, specifying the slot will allow users to move them
back, if there is a need.

Signed-off-by: Simon Horman <horms@verge.net.au>
16 years agoxenstore: Don't hardcode install path
Keir Fraser [Fri, 20 Mar 2009 10:37:12 +0000 (10:37 +0000)]
xenstore: Don't hardcode install path

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
16 years agoxmexample: fix cpuid example
Keir Fraser [Fri, 20 Mar 2009 10:36:40 +0000 (10:36 +0000)]
xmexample: fix cpuid example

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
16 years agovtd: fix Dom0 S3 when VT-d is enabled.
Keir Fraser [Fri, 20 Mar 2009 09:36:57 +0000 (09:36 +0000)]
vtd: fix Dom0 S3 when VT-d is enabled.

On some platforms that support Queued Invalidation and Interrupt
Remapping, Dom0 S3 doesn't work. The patch fixes the issue.

1) In device_power_down(), we should invoke iommu_suspend() after
ioapic_suspend(); in device_power_up(), we should invoke
iommu_resume() before ioapic_resume().

2) Add 2 functions: disable_qinval() and disable_intremap(); in
iommu_suspend(), we invoke them and iommu_disable_translation().
   Rename qinval_setup() to enable_qinval() and rename
   intremap_setup() to enable_intremap().

3) In iommu_resume(), remove the unnecessary
iommu_flush_{context, iotlb}_global() -- actually we mustn't do that
if Queued Invalidation was enabled before S3 because at this point of
S3 resume, Queued Invalidation hasn't been re-enabled.

4) Add a static global array ioapic_pin_to_intremap_index[] to
remember what intremap_index an ioapic pin uses -- during S3 resume,
ioapic_resume() re-writes all the ioapic RTEs, so we can use the array
to re-use the previously-allocated IRTE;

5) Some cleanups:
   a) Change some failure handlings in enable_intremap() to panic().
   b) Remove the unnecessary local variable iec_cap in
   __iommu_flush_iec().
   c) Add a dmar_writeq(iommu->reg, DMAR_IQT_REG, 0) in
   enable_qinval().

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
16 years agoDo not pass DIRECTMAP_VIRT_END to virt_to_mfn(). It's out of range.
Keir Fraser [Fri, 20 Mar 2009 09:34:09 +0000 (09:34 +0000)]
Do not pass DIRECTMAP_VIRT_END to virt_to_mfn(). It's out of range.

Signed-off-by: Xiaowei Yang <xiaowei.yang@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agovtd: only enable Interrupt Remapping if Queued Invalidation is also enabled.
Keir Fraser [Fri, 20 Mar 2009 09:10:55 +0000 (09:10 +0000)]
vtd: only enable Interrupt Remapping if Queued Invalidation is also enabled.

If Queued Invalidation is not supported or not enabled, we should not
enable Interrupt Remapping even if HW supports it, because Interrupt
Remapping needs Queued Invalidation to invalidate Interrupt Remapping
Cache.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
16 years agoxenpm: Add a small scheduler knob "sched_smt_power_savings"
Keir Fraser [Fri, 20 Mar 2009 08:59:47 +0000 (08:59 +0000)]
xenpm: Add a small scheduler knob "sched_smt_power_savings"

Current scheduler only care performance, thus always picks pCPU from
the most idle package. This knob provides another option to pick pCPU from
least idle package, for user who want performance power balance.

Signed-off-by: Yu Ke <ke.yu@intel.com>
Signed-off-by: Tian Kevin <kevin.tian@intel.com>
16 years agoTypo fix for request_irq
Keir Fraser [Fri, 20 Mar 2009 08:57:45 +0000 (08:57 +0000)]
Typo fix for request_irq

Signed-off-by: Wei Gang <gang.wei@intel.com>
16 years agox86_64: Fix handling of DIRECTMAP_VIRT_START in virt_to_maddr().
Keir Fraser [Fri, 20 Mar 2009 08:57:23 +0000 (08:57 +0000)]
x86_64: Fix handling of DIRECTMAP_VIRT_START in virt_to_maddr().

Signed-off-by: Xiaowei Yang <xiaowei.yang@intel.com>
16 years agoAdd cpufreq actual average freq information to xenpm tools
Keir Fraser [Fri, 20 Mar 2009 08:49:17 +0000 (08:49 +0000)]
Add cpufreq actual average freq information to xenpm tools

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
16 years agoDeliver cpufreq actual average freq to libxc interface
Keir Fraser [Fri, 20 Mar 2009 08:48:57 +0000 (08:48 +0000)]
Deliver cpufreq actual average freq to libxc interface

Calculate cpu actual average freq according to aperf and mperf MSR and
then deliver to libxc interface

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
16 years agocpufreq: Update cpufreq aperf and mperf read, so that it can be used
Keir Fraser [Fri, 20 Mar 2009 08:48:17 +0000 (08:48 +0000)]
cpufreq: Update cpufreq aperf and mperf read, so that it can be used
by both ondemand gov and user program

Current __get_measured_perf read aperf and mperf MSR and then clear
them for the sake of ondemand governor. This solution block user
program to get aperf and mperf on their purpose. In this patch, it no
longer clear aperf and mperf MSR, so that it can be used by both
ondemand gov and user program.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
16 years agomcheck: Small fix to Intel CMCI code
Keir Fraser [Fri, 20 Mar 2009 08:44:54 +0000 (08:44 +0000)]
mcheck: Small fix to Intel CMCI code

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agofs-back: unmapp all shared ring pages when a domain dies
Keir Fraser [Fri, 20 Mar 2009 08:43:53 +0000 (08:43 +0000)]
fs-back: unmapp all shared ring pages when a domain dies

This bug causes some pages not to be properly freed by xen, hence
after a cycle of 50 save\restore we don't have enough spare memory to
start 2 VMs any more. This patch fixes the issue properly unmapping
all the pages needed by the shared ring.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
16 years agoxend: fix vscsi error path
Keir Fraser [Fri, 20 Mar 2009 08:42:59 +0000 (08:42 +0000)]
xend: fix vscsi error path

Fix xend start problem on non-Linux Dom0 where /proc/mount doesn't exist.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
16 years agohvm: Allow HVM guests direct access to 0xed debug/delay port
Keir Fraser [Fri, 20 Mar 2009 08:42:14 +0000 (08:42 +0000)]
hvm: Allow HVM guests direct access to 0xed debug/delay port

Port 0x80 is already passed-through.  Writes to port 0x80 are
traditionally used as IO delay.  Recent Linux kernel versions can be
configured to use port 0xed instead (CONFIG_IO_DELAY_0XED=3Dy).
Ubuntu 8.04 and later kernels are configured to use port 0xed.

In Linux IO delay is implemented by (in|out)[bwl]_p.  From a first
glance at Linux it looks like the only relevant usage of delayed IO is
in drivers/video/console/vgacon.c.  Affected is VGA console
initialization and font setup.  Output / scrolling is not affected.

Signed-off-by: Thomas Friebel <thomas.friebel@amd.com>
16 years agotmem: Placeholder hypercall.
Keir Fraser [Fri, 20 Mar 2009 08:40:18 +0000 (08:40 +0000)]
tmem: Placeholder hypercall.

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agox86: Fix the 32-bit build after c/s 19400.
Keir Fraser [Fri, 20 Mar 2009 08:34:24 +0000 (08:34 +0000)]
x86: Fix the 32-bit build after c/s 19400.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agox86: Ensure we execute LTR when running on non-compat GDT which has
Keir Fraser [Thu, 19 Mar 2009 17:04:06 +0000 (17:04 +0000)]
x86: Ensure we execute LTR when running on non-compat GDT which has
busy bit clear in TSS descriptor.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agobuild system cleanup - get rid of some hardcoded paths
Keir Fraser [Thu, 19 Mar 2009 14:01:56 +0000 (14:01 +0000)]
build system cleanup - get rid of some hardcoded paths

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
16 years agoClean up physdev.h public header.
Keir Fraser [Thu, 19 Mar 2009 10:24:48 +0000 (10:24 +0000)]
Clean up physdev.h public header.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agoXen: use proper device ID to search VT-d unit for ARI and SR-IOV device
Keir Fraser [Thu, 19 Mar 2009 10:20:11 +0000 (10:20 +0000)]
Xen: use proper device ID to search VT-d unit for ARI and SR-IOV device

PCIe Alternative Routing-ID Interpretation (ARI) ECN defines the Extended
Function -- a function whose function number is greater than 7 within an
ARI Device. Intel VT-d spec 1.2 section 8.3.2 specifies that the Extended
Function is under the scope of the same remapping unit as the traditional
function. The hypervisor needs to know if a function is Extended
Function so it can find proper DMAR for it.

And section 8.3.3 specifies that the SR-IOV Virtual Function is under the
scope of the same remapping unit as the Physical Function. The hypervisor
also needs to know if a function is the Virtual Function and which
Physical Function it's associated with for same reason.

Signed-off-by: Yu Zhao <yu.zhao@intel.com>
16 years agoXen: documentation for VT-d/SR-IOV
Keir Fraser [Thu, 19 Mar 2009 10:10:59 +0000 (10:10 +0000)]
Xen: documentation for VT-d/SR-IOV

Add a section about how to use the SR-IOV device with VT-d.

Signed-off-by: Yu Zhao <yu.zhao@intel.com>
16 years agocpuidle and xenpm small cleanups.
Keir Fraser [Thu, 19 Mar 2009 10:10:31 +0000 (10:10 +0000)]
cpuidle and xenpm small cleanups.

Signed-off-by: Guanqun Lu <guanqun.lu@intel.com>
16 years agoxenpm: add timeout option to 'xenpm start' command.
Keir Fraser [Thu, 19 Mar 2009 10:09:59 +0000 (10:09 +0000)]
xenpm: add timeout option to 'xenpm start' command.

Thus we can sample a fixed time of period without manual interruption.

Signed-off-by: Guanqun Lu <guanqun.lu@intel.com>
16 years agoFix a cpufreq userspace limitation bug
Keir Fraser [Thu, 19 Mar 2009 10:09:24 +0000 (10:09 +0000)]
Fix a cpufreq userspace limitation bug

Fix a cpufreq userspace limitation bug, so that userspace freq can
return to correct freq when freq_limitation return to high value (like
ppc event)

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>=
16 years agoxentrace: Add acpi pm tick output to idle tracing
Keir Fraser [Thu, 19 Mar 2009 10:08:48 +0000 (10:08 +0000)]
xentrace: Add acpi pm tick output to idle tracing

The reason is that tsc stops and it causes the inaccuracy.
And later we can write some scripts based on this patch.

Signed-off-by: Guanqun Lu <guanqun.lu@intel.com>
16 years agox86, hvm: Fix double-free of vpmu->context
Keir Fraser [Thu, 19 Mar 2009 10:05:01 +0000 (10:05 +0000)]
x86, hvm: Fix double-free of vpmu->context

When `opcontrol --shutdown' is called after xenoprof is used on Dom0,
the vpmu owner becomes PMU_OWNER_NONE. So it is possible to acquire
the owner as PMU_OWNER_HVM and to allocate vpmu->context twice. As a
result, the hypervisor panics because of double-alloc/free of
vpmu->context.

Signed-off-by: Kazuhiro Suzuki <kaz@jp.fujitsu.com>
16 years agox86 dom builder: Allocate domU pages in batches.
Keir Fraser [Thu, 19 Mar 2009 10:04:15 +0000 (10:04 +0000)]
x86 dom builder: Allocate domU pages in batches.

Allows a 32-bit dom0 to create very large guests.

Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agoioemu-stubdom: Use xen-setup-stubdom rather than configure
Keir Fraser [Wed, 18 Mar 2009 17:30:13 +0000 (17:30 +0000)]
ioemu-stubdom: Use xen-setup-stubdom rather than configure

xen-setup runs the upstream configure script, and ends up
autodetecting various properties of the host and then trying to use
them in stubdom, which works badly.

In commit c609854fe18aab3216f28e1e5291b75970d398d5 in
qemu-xen-unstable we provide a new `xen-setup-stubdom' script, which
hardcodes the relevant answers.

With these two changes, stubdom should compile again.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
16 years agolibxc: Use write_exact() in lock_suspend_event().
Keir Fraser [Wed, 18 Mar 2009 17:25:54 +0000 (17:25 +0000)]
libxc: Use write_exact() in lock_suspend_event().
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agoAdd PVUSB and PVSCSI interface headers.
Keir Fraser [Wed, 18 Mar 2009 15:42:47 +0000 (15:42 +0000)]
Add PVUSB and PVSCSI interface headers.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agofs-back: build fixes
Keir Fraser [Wed, 18 Mar 2009 13:25:25 +0000 (13:25 +0000)]
fs-back: build fixes

Remove some unused variables and replaces read and write
to the pipe with read_exact and write_exact (these two functions are
implemented in libxc, that we have to link anyway).

This allows fs-backed to be compiled with -D_FORTIFY_SOURCE=2, hence
should fix the problems reported by Boris.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
16 years agoActually set a HVM domain's time offset when it sets the RTC
Keir Fraser [Wed, 18 Mar 2009 13:24:42 +0000 (13:24 +0000)]
Actually set a HVM domain's time offset when it sets the RTC

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
16 years agofs-backend.c misses the unistd.h include for read() and write().
Keir Fraser [Wed, 18 Mar 2009 11:51:30 +0000 (11:51 +0000)]
fs-backend.c misses the unistd.h include for read() and write().

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
16 years agox86: Change the mod_lx_entry to accept the vcpu parameter
Keir Fraser [Wed, 18 Mar 2009 11:50:16 +0000 (11:50 +0000)]
x86: Change the mod_lx_entry to accept the vcpu parameter

Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
16 years agoMove the suspend event channel function to libxc, it will use the
Keir Fraser [Wed, 18 Mar 2009 11:49:26 +0000 (11:49 +0000)]
Move the suspend event channel function to libxc, it will use the
/var/lib/xen/suspend_evtchn_lock.d to protect the access.

Signed-off-by: Jiang Yunhong <yunhong.jiang@intel.com>
16 years agoxc_save: remove the dependency on the global si structure
Keir Fraser [Wed, 18 Mar 2009 11:48:48 +0000 (11:48 +0000)]
xc_save: remove the dependency on the global si structure

Signed-off-by: Jiang Yunhong <yunhong.jiang@intel.com>
16 years agovtd: Only enable some VT-d features if all VT-d engines support them.
Keir Fraser [Wed, 18 Mar 2009 11:46:32 +0000 (11:46 +0000)]
vtd: Only enable some VT-d features if all VT-d engines support them.

By default, we enable snoop control, queued invalidation and interrupt
remapping if all VT-d engines support them, and for DMA passthrough we
don't enable it by default.

A user can use 'iommu=passthrough' to enable DMA passthrough (only
for Dom0). A user can use 'iommu=no-snoop,no-qinval,no-intremap' to
disable the 3 features.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>=
16 years agoDisable xen platform PCI device when xen_platform_pci=0 is specified
Keir Fraser [Wed, 18 Mar 2009 11:37:59 +0000 (11:37 +0000)]
Disable xen platform PCI device when xen_platform_pci=0 is specified

 - Change guest firmware to use new fixed byte port 0x10.
 - Add "xen_platform_pci" option into guest config file and APIs.
    xen_platform_pci=0: Disable xen platform device.
    xen_platform_pci=1: Enable xen platform device. (default)
 - Add "disable_pf" entry into xenstore.

Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
16 years agoxend: Fix vscsi assignment when XenAPI is available
Keir Fraser [Wed, 18 Mar 2009 11:34:20 +0000 (11:34 +0000)]
xend: Fix vscsi assignment when XenAPI is available

When XenAPI is available, xm scsi-attach fails.  Also xm new and
xm create fail if a vscsi parameter is defined into domain
configuration files.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
16 years agoxend: Use vnc-listen setting specified in xend config file
Keir Fraser [Wed, 18 Mar 2009 11:32:46 +0000 (11:32 +0000)]
xend: Use vnc-listen setting specified in xend config file

If domU frame buffer configuration has no vnclisten attribute set, use
the global vnc-listen address specified in xend configuration file
when updating vfb location.  Currently the hardcoded value 'localhost'
is used.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>