Commit Graph
19445 Commits
Author SHA1 Message Date
Keir Fraser ea3ee2e615 xend: Allow drbd disks.
From: Ben Timby <btimby@gmail.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-03-31 11:26:10 +01:00
Keir Fraser 14f5ee16c8 xend: Supply pass-through vslot to qemu-dm
Signed-off-by: Simon Horman <horms@verge.net.au>
2009-03-31 11:24:13 +01:00
Keir Fraser ceb97ddf1c 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>
2009-03-31 11:23:38 +01:00
Keir Fraser da2c445024 x86: virt_to_mfn() fixes.
Signed-off-by: Xiaowei Yang <xiaowei.yang@intel.com>
2009-03-31 11:21:14 +01:00
Keir Fraser c8432f0b59 xenpm: add cmd set-max-cstate
Signed-off-by: Wei Gang <gang.wei@intel.com>
2009-03-31 11:19:56 +01:00
Keir Fraser fd598342a0 cpuidle: export max_cstate access via libxc
Signed-off-by: Wei Gang <gang.wei@intel.com>
2009-03-31 11:19:26 +01:00
Keir Fraser 6fe255bdc2 pygrub: More accurate try/except catch.
Signed-off-by: Michal Novotny <minovotn@redhat.com>
2009-03-31 11:17:51 +01:00
Keir Fraser f32b5caf31 xend: Save the state of PPCIs after hot-plug events.
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2009-03-31 11:16:01 +01:00
Keir Fraser be01c537b2 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>
2009-03-31 11:13:56 +01:00
Keir Fraser 92f9c55a94 xend: Disallow bogus MAC addresses when creating new VIF devices
Signed-off-by: Michal Novotny <minovotn@redhat.com>
2009-03-31 11:12:39 +01:00
Keir Fraser c55103c526 intel mce: Small fixes.
Signed-off-by: Frank van der Linden <Frank.Vanderlinden@Sun.COM>
2009-03-31 11:10:06 +01:00
Keir Fraser cd0d1464b9 x86 acpi: Delete unnecessary and broken RSDP-scanning code.
Signed-off-by: Keir Fraser <keir.fraser@eu.citrix.com>
2009-03-30 16:48:26 +01:00
Isaku Yamahata 2594e423ee merge with xen-unstable.hg 2009-03-27 11:07:11 +09:00
Isaku Yamahata 1dc0906f89 [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>
2009-03-27 10:54:08 +09:00
Keir Fraser 92f5c346e7 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>
2009-03-24 06:55:29 +00:00
Keir Fraser e8c21780e3 x86: Build fixes and cleanups after Intel MCA changes.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-03-20 17:42:46 +00:00
Keir Fraser c8596872e0 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>
2009-03-20 17:25:29 +00:00
Keir Fraser f74394f46c 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>
2009-03-20 17:24:53 +00:00
Keir Fraser 32e8dd573b 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>
2009-03-20 17:24:29 +00:00
Keir Fraser 2ccae6ea67 x86: Enable Xen C-state management by default.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-03-20 15:38:46 +00:00
Keir Fraser f976214e1d 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>
2009-03-20 15:37:33 +00:00
Keir Fraser 3ba523ff95 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>=
2009-03-20 12:33:55 +00:00
Keir Fraser 5534b7d986 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>
2009-03-20 12:09:20 +00:00
Keir Fraser a7eb53a53f xenstore: Don't hardcode install path
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2009-03-20 10:37:12 +00:00
Keir Fraser b04cc386ed xmexample: fix cpuid example
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2009-03-20 10:36:40 +00:00
Keir Fraser 155cd37d8b 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>
2009-03-20 09:36:57 +00:00
Keir Fraser 18b0268f19 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>
2009-03-20 09:34:09 +00:00
Keir Fraser 312b6463fb 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>
2009-03-20 09:10:55 +00:00
Keir Fraser 7b915d3eaf 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>
2009-03-20 08:59:47 +00:00
Keir Fraser cec3850d14 Typo fix for request_irq
Signed-off-by: Wei Gang <gang.wei@intel.com>
2009-03-20 08:57:45 +00:00
Keir Fraser f33c258bab x86_64: Fix handling of DIRECTMAP_VIRT_START in virt_to_maddr().
Signed-off-by: Xiaowei Yang <xiaowei.yang@intel.com>
2009-03-20 08:57:23 +00:00
Keir Fraser add6160d7b Add cpufreq actual average freq information to xenpm tools
Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
2009-03-20 08:49:17 +00:00
Keir Fraser 037d1b3c89 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>
2009-03-20 08:48:57 +00:00
Keir Fraser 1d79561c41 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>
2009-03-20 08:48:17 +00:00
Keir Fraser 7cb051784b mcheck: Small fix to Intel CMCI code
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-03-20 08:44:54 +00:00
Keir Fraser 9c2e145d68 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>
2009-03-20 08:43:53 +00:00
Keir Fraser e8f30212b1 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>
2009-03-20 08:42:59 +00:00
Keir Fraser f7ffd86d52 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>
2009-03-20 08:42:14 +00:00
Keir Fraser 15ab9b2d3f tmem: Placeholder hypercall.
Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-03-20 08:40:18 +00:00
Keir Fraser f13bb77a49 x86: Fix the 32-bit build after c/s 19400.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-03-20 08:34:24 +00:00
Keir Fraser 4b42d85567 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>
2009-03-19 17:04:06 +00:00
Keir Fraser ff7c1b9e4f build system cleanup - get rid of some hardcoded paths
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2009-03-19 14:01:56 +00:00
Keir Fraser 7fe15ceac0 Clean up physdev.h public header.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-03-19 10:24:48 +00:00
Keir Fraser 3fdb2ba306 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>
2009-03-19 10:20:11 +00:00
Keir Fraser 8959f0c05a 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>
2009-03-19 10:10:59 +00:00
Keir Fraser b21c09a4ff cpuidle and xenpm small cleanups.
Signed-off-by: Guanqun Lu <guanqun.lu@intel.com>
2009-03-19 10:10:31 +00:00
Keir Fraser cb4343bf2e 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>
2009-03-19 10:09:59 +00:00
Keir Fraser 7dc1bc818a 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>=
2009-03-19 10:09:24 +00:00
Keir Fraser 93d17a53a3 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>
2009-03-19 10:08:48 +00:00
Keir Fraser d532e54c26 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>
2009-03-19 10:05:01 +00:00