xen.git
17 years agox86: microcode update support for AMD CPUs
Keir Fraser [Fri, 12 Sep 2008 13:18:13 +0000 (14:18 +0100)]
x86: microcode update support for AMD CPUs

Microcode update support for AMD CPUs Family10h and Family11h.
It is based on a patch for Linux which is on its way for 2.6.28.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
17 years ago$(XEN_ROOT) absolutification fixes for ioemu-remote (incl stubdom)
Keir Fraser [Fri, 12 Sep 2008 12:15:36 +0000 (13:15 +0100)]
$(XEN_ROOT) absolutification fixes for ioemu-remote (incl stubdom)

 * Move code for generating an absolute version of XEN_ROOT
   into a common make variable set in Config.mk
 * Use this common code when invoking make -C ioemu-dir clean
   from tools/, which avoids a problem where `make clean' fails
   because qemu's (ioemu-remote's) build system wants to run
   `make clean' in `tests' but XEN_ROOT is a confection involving
   ../'s.
 * Use this common code in stubdom/Makefile, instead of $(abspath...)
   as the latter is a relatively new feature in GNU make and is not
   available in all the places that we want to be able to build
   (cf c/s 17997:3f23e01d31985899dbd1660b166f229f1ee74292)

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
17 years agoCheck the existence of serial port before using
Keir Fraser [Fri, 12 Sep 2008 10:43:47 +0000 (11:43 +0100)]
Check the existence of serial port before using

Signed-off-by: Huacai Chen <huacai.chen@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agostubdom: compile stubdom with qemu-remote
Keir Fraser [Fri, 12 Sep 2008 09:41:51 +0000 (10:41 +0100)]
stubdom: compile stubdom with qemu-remote

Remove the CONFIG_QEMU override; fixing lwip isystem path.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
17 years agox86, cpu hotplug: flush softirq work when going offline
Keir Fraser [Fri, 12 Sep 2008 09:40:19 +0000 (10:40 +0100)]
x86, cpu hotplug: flush softirq work when going offline

From: Haitao Shan <haitao.shan@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: Clean up cpufreq core logic
Keir Fraser [Fri, 12 Sep 2008 09:34:50 +0000 (10:34 +0100)]
x86: Clean up cpufreq core logic

Clean up cpufreq core logic, which now can cope with cpu
online/offline event, and also dynamic platform limitation event
(_PPC).

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
17 years agoxenstore: Fix a memory leak in 'xs_is_domain_introduced'.
Keir Fraser [Thu, 11 Sep 2008 17:00:06 +0000 (18:00 +0100)]
xenstore: Fix a memory leak in 'xs_is_domain_introduced'.

Signed-off-by: Konrad Rzeszutek <konrad@virtualiron.com>
17 years agoACPI: Grant access of MSR_IA32_THERM_CONTROL MSR to dom0
Keir Fraser [Thu, 11 Sep 2008 15:51:13 +0000 (16:51 +0100)]
ACPI: Grant access of MSR_IA32_THERM_CONTROL MSR to dom0

The purpose is to support dom0 throttling control via MSR.

Signed-off-by: Wei Gang <gang.wei@intel.com>
17 years agoCPUIDLE: Disable APIC timer intr during C3 while force hpetbroadcast
Keir Fraser [Thu, 11 Sep 2008 15:50:04 +0000 (16:50 +0100)]
CPUIDLE: Disable APIC timer intr during C3 while force hpetbroadcast

It can avoid C3 early exit, and also this is conceptually clearer, as
at given time we only want one clock source to drive timers.

Signed-off-by: Wei Gang <gang.wei@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86, shadow: Fix some SHADOW_PRINTK() callers.
Keir Fraser [Thu, 11 Sep 2008 14:17:31 +0000 (15:17 +0100)]
x86, shadow: Fix some SHADOW_PRINTK() callers.
Signed-off-by: Yoshi Tamura <tamura.yoshiaki@lab.ntt.co.jp>
17 years agoxendomains script: A few bug fixes.
Keir Fraser [Thu, 11 Sep 2008 14:16:11 +0000 (15:16 +0100)]
xendomains script: A few bug fixes.

Contributed-by: Artur Linhart <AL.LINUX@bcpraha.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
17 years agox86: Support CPU hotplug offline.
Keir Fraser [Thu, 11 Sep 2008 14:06:22 +0000 (15:06 +0100)]
x86: Support CPU hotplug offline.

Signed-off-by: Shan Haitao <haitao.shan@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoxm: domid casting bug
Keir Fraser [Thu, 11 Sep 2008 10:58:08 +0000 (11:58 +0100)]
xm: domid casting bug

- This patch fixes a small casting bug in xm.  The value of domid was
  not returned as an int, causing commands like 'xm vncviewer domid'
  to fail.

Signed-off-by: George Coker <gscoker@alpha.ncsc.mil>
17 years agoxsm: XSM foreigndom usage bug
Keir Fraser [Thu, 11 Sep 2008 10:56:49 +0000 (11:56 +0100)]
xsm: XSM foreigndom usage bug

- This patch corrects an unsafe/incorrect usage of FOREIGNDOM.  The
value of FOREIGNDOM is now passed through the XSM interface.
Corresponding updates to the Flask module are included in this patch.

- This patch also includes a minor header update to allow the Flask
  module to compile after recent updates to Xen.

Signed-off-by: George Coker <gscoker@alpha.ncsc.mil>
17 years agox86: Fix calibration rendezvous for cpu hotplug.
Keir Fraser [Wed, 10 Sep 2008 10:26:16 +0000 (11:26 +0100)]
x86: Fix calibration rendezvous for cpu hotplug.

Need to latch cpu_online_map.

From: Haitao Shan <haitao.shan@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoCPUIDLE: Port Linux menu governor to replace the initial ladder governor
Keir Fraser [Wed, 10 Sep 2008 10:18:36 +0000 (11:18 +0100)]
CPUIDLE: Port Linux menu governor to replace the initial ladder governor

The ladder governor has long pro/demotion delay shortcome while
applying to tickless mode, because it needs to count usage. Menu
governor chooses the next state simply via break-event prediction
including the factors of next timer event & last residency time etc,
so it would have faster response speed.

Signed-off-by: Gang Wei <gang.wei@intel.com>
17 years agoCPUIDLE: Adjust Cx residency to contain Cx exit latency & overhead.
Keir Fraser [Wed, 10 Sep 2008 10:17:13 +0000 (11:17 +0100)]
CPUIDLE: Adjust Cx residency to contain Cx exit latency & overhead.

Signed-off-by: Wei Gang <gang.wei@intel.com>
17 years agoCPUIDLE: Avoid remnant LAPIC timer intr while force hpetbroadcast
Keir Fraser [Wed, 10 Sep 2008 10:16:26 +0000 (11:16 +0100)]
CPUIDLE: Avoid remnant LAPIC timer intr while force hpetbroadcast

LAPIC will stop during C3, and resume to work after exit from
C3. Considering below case:
The LAPIC timer was programmed to expire after 1000us, but CPU enter
C3 after 100us and exit C3 at 9xxus.

   0us: reprogram_timer(1000us)
 100us: entry C3, LAPIC timer stop
 9xxus: exit C3 due to unexpected event, LAPIC timer continue running
10xxus: reprogram_timer(1000us), fail due to the past expiring time.
......: no timer softirq raised, no change to LAPIC timer.
......: if entry C3 again, HPET will be forced reprogramed to
 now+small_slop.
......: if entry C2, no change to LAPIC.
18xxus: LAPIC timer expires unexpectedly if no C3 entries after
 10xxus.

Signed-off-by: Wei Gang <gang.wei@intel.com>
17 years agoCPUIDLE: Avoid remnant HPET intr while force hpetbroadcast
Keir Fraser [Wed, 10 Sep 2008 10:09:08 +0000 (11:09 +0100)]
CPUIDLE: Avoid remnant HPET intr while force hpetbroadcast

Exit from C3 is mainly caused by HPET intr if force enable
hpetbroadcast. But it is still probably caused by other unexpected
events. In this case the HPET timer may still be alive while there is
no CPU in C3. Avoid those remnant HPET intr can save cpu handling time
and increase idle time.

Signed-off-by: Wei Gang <gang.wei@intel.com>
17 years agovtd: Add a command line param to enable/disable pass-through feature
Keir Fraser [Wed, 10 Sep 2008 09:53:09 +0000 (10:53 +0100)]
vtd: Add a command line param to enable/disable pass-through feature

Taking security into accout, it's not suitable to bypass VT-d
translation for Dom0 by default when the pass-through field in
extended capability register is set. This feature is for people/usages
who are not overly worried about security/isolation, but want better
performance.

This patch adds a command line param that controls if it's enabled or
disabled.

Signed-off-by: Weidong Han <weidong.han@intel.com>
17 years agox86, xend: Fix processing of cpuid config parameters
Keir Fraser [Wed, 10 Sep 2008 09:51:48 +0000 (10:51 +0100)]
x86, xend: Fix processing of cpuid config parameters

There is an python indentation issue keeping the full range of syntax
for the cpuid config file parameter from working correctly.  This
patch fixes that.  It also fixes some misspelling and a missing 'x' in
two of the example config files (must have 32 bits represented for
cpuid registers).

Signed-off-by: Bruce Rogers <brogers@novell.com>
17 years agox86: Remove MSI boot parameter -- now always on.
Keir Fraser [Wed, 10 Sep 2008 09:47:46 +0000 (10:47 +0100)]
x86: Remove MSI boot parameter -- now always on.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: Do not permit 'AUTO_ASSIGN' parameter to PHYSDEVOP_alloc_irq_vector.
Keir Fraser [Tue, 9 Sep 2008 16:28:05 +0000 (17:28 +0100)]
x86: Do not permit 'AUTO_ASSIGN' parameter to PHYSDEVOP_alloc_irq_vector.

It's not needed for MSI handling as Xen hides the vector allocation
and MSI-device programming.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoxc_domain_save: Do not poll-wait for guest to shutdown -- it should
Keir Fraser [Tue, 9 Sep 2008 14:33:27 +0000 (15:33 +0100)]
xc_domain_save: Do not poll-wait for guest to shutdown -- it should
already be suspended when the (*suspend)() function returns.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoSmall user manual fixes.
Keir Fraser [Tue, 9 Sep 2008 14:08:57 +0000 (15:08 +0100)]
Small user manual fixes.

From: Stephen Spector <stephen.spector@citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoioemu: Fix bug in map cache
Keir Fraser [Tue, 9 Sep 2008 14:05:58 +0000 (15:05 +0100)]
ioemu: Fix bug in map cache

This small patch fixes an issue leading to a crash (segfault, although
with earlier changesets I was seeing sigbus - not sure what changed)
in qemu-dm when the following conditions occur:

1. A valid mapping for a bucket on a low address exists

2. Immediately after accessing memory mapped in this bucket, an access
occurs to a high (beyond assigned ram) address beyond the 1GB limit
for 32bit map cache wrapping around to the previous bucket's entry
number.

3. The next call to map cache again accesses the low address.

In this scenario, the guest mem for the low bucket has been unmapped
by the remap_bucket caused by 2., but because the valid_mapping
bit-test fails, map_cache returns before last_address_index has been
updated. The subsequent call to map_cache therefore never remaps the
low, valid bucket and instead returns a vaddr pointing to memory that
has failed to get mapped.

Signed-off-by: Trolle Selander <trolle.selander@eu.citrix.com>
17 years agoioemu: various fixes to 18394:dade7f0bdc8d
Keir Fraser [Tue, 9 Sep 2008 14:02:51 +0000 (15:02 +0100)]
ioemu: various fixes to 18394:dade7f0bdc8d

- fix ioemu segv with old firmware
  Without notifying ioemu of address, ioemu will segv.

- fix qemu-dm segv with malicous firmware
  If notifying ioemu more than once, ioemu will segv.

Usually such cases don't happen, but malicious guest can
do it intentionally.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
17 years agolibxc: fix xc_memory_op(): handles XENMEM_remove_from_phsymap case.
Keir Fraser [Tue, 9 Sep 2008 14:02:32 +0000 (15:02 +0100)]
libxc: fix xc_memory_op(): handles XENMEM_remove_from_phsymap case.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
17 years agovtd.txt: Add caveat about assigning certain types of device.
Keir Fraser [Tue, 9 Sep 2008 13:54:56 +0000 (14:54 +0100)]
vtd.txt: Add caveat about assigning certain types of device.

From: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agovtd: Enable pass-through translation for Dom0
Keir Fraser [Tue, 9 Sep 2008 13:50:29 +0000 (14:50 +0100)]
vtd: Enable pass-through translation for Dom0

If pass-through field in extended capability register is set, set
pass-through translation type for Dom0, that means DMA requests with
Untranslated addresses are processed as pass-through in Dom0, needn't
translate DMA requests through a multi-level page-table.

Signed-off-by: Anthony Xu <anthony.xu@intel.com>
Signed-off-by: Weidong Han <weidong.han@intel.com>
17 years agostubdom: Fix README for renamed device-model config file.
Keir Fraser [Tue, 9 Sep 2008 13:47:36 +0000 (14:47 +0100)]
stubdom: Fix README for renamed device-model config file.
Sigend-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoRevert 18415:3e72ab517e44 (xend: move the call to XendDevices.destroy_device_state())
Keir Fraser [Tue, 9 Sep 2008 13:45:23 +0000 (14:45 +0100)]
Revert 18415:3e72ab517e44 (xend: move the call to XendDevices.destroy_device_state())

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
17 years agoxentrace 7/7: Add option to log to a circular buffer and dump to disk
Keir Fraser [Mon, 8 Sep 2008 15:02:13 +0000 (16:02 +0100)]
xentrace 7/7: Add option to log to a circular buffer and dump to disk
on signal.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Signed-off-by: Trolle Selander <trolle.selander@eu.citrix.com>
17 years agoxentrace 6/7: Updated formats file.
Keir Fraser [Mon, 8 Sep 2008 15:00:53 +0000 (16:00 +0100)]
xentrace 6/7: Updated formats file.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Signed-off-by: Trolle Selander <trolle.selander@eu.citrix.com>
17 years agoxentrace 5/7: Additional tracing for the shadow code.
Keir Fraser [Mon, 8 Sep 2008 14:58:04 +0000 (15:58 +0100)]
xentrace 5/7: Additional tracing for the shadow code.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Signed-off-by: Trolle Selander <trolle.selander@eu.citrix.com>
17 years agoxentrace 4/7: Add some missing things to the xentrace options string
Keir Fraser [Mon, 8 Sep 2008 14:52:50 +0000 (15:52 +0100)]
xentrace 4/7: Add some missing things to the xentrace options string

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Signed-off-by: Trolle Selander <trolle.selander@eu.citrix.com>
17 years agoxentrace 3/7: Remove vcpu / domain from HVM traces.
Keir Fraser [Mon, 8 Sep 2008 14:52:03 +0000 (15:52 +0100)]
xentrace 3/7: Remove vcpu / domain from HVM traces.

This information is now redundant, as it can be determined using
runstate changes and lost record changes.  This reduces log size for
long-running traces by 10-30%.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Signed-off-by: Trolle Selander <trolle.selander@eu.citrix.com>
17 years agoxentrace 2/7: Lost-records record includes currently running vcpu,
Keir Fraser [Mon, 8 Sep 2008 14:50:33 +0000 (15:50 +0100)]
xentrace 2/7: Lost-records record includes currently running vcpu,
and tsc of first lost record.

Including the current vcpu helps us identify who's currently
running on each processor, even if we've lost records.  The tsc of the
first lost record helps us identify how much time we've spent lost,
and also when a pcpu started experiencing lost records.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Signed-off-by: Trolle Selander <trolle.selander@eu.citrix.com>
17 years agoxentrace 1/7: Trace runstate changes.
Keir Fraser [Mon, 8 Sep 2008 14:47:47 +0000 (15:47 +0100)]
xentrace 1/7: Trace runstate changes.

Also, introduce SCHED_MIN and SCHED_VERBOSE, so that we can trace
just runstate changes if we want to.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Signed-off-by: Trolle Selander <trolle.selander@eu.citrix.com>
17 years agoxen/powernow: allow using lowest-power P-state
Keir Fraser [Mon, 8 Sep 2008 13:01:35 +0000 (14:01 +0100)]
xen/powernow: allow using lowest-power P-state

The MSR field used here indicates the highest numbered valid P-state,
not the first invalid one.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agox86: fix cpufreq_dom_mask
Keir Fraser [Mon, 8 Sep 2008 13:01:17 +0000 (14:01 +0100)]
x86: fix cpufreq_dom_mask

cpufreq_dom_mask must not be confined to the number of CPUs in the
system - there's nothing disallowing e.g. 1-based domain identifiers
to be used in _PSD. It still remains risky to assume that these
numbers are 'small' and/or not allocated sparsely.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agoxc_save: ignore the first suspend event channel notification
Keir Fraser [Mon, 8 Sep 2008 10:16:23 +0000 (11:16 +0100)]
xc_save: ignore the first suspend event channel notification

I've noticed that the suspend event channel becomes pending as soon as
it is bound. I'm not sure why or whether this is intentional, but it
means that the suspend function will return before the domain has
completed suspending unless the first notification is cleared. Without
this patch, xc_domain_save may find that the guest has not suspended
and sleep in 10ms chunks until it does. Typically this is several
milliseconds of wasted time.

From: Brendan Cully <brendan@cs.ubc.ca>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoxc_save: Clean up (*suspend)() callback hook.
Keir Fraser [Mon, 8 Sep 2008 10:13:03 +0000 (11:13 +0100)]
xc_save: Clean up (*suspend)() callback hook.
Sigend-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoxc_save: Janitorial work.
Keir Fraser [Mon, 8 Sep 2008 09:55:09 +0000 (10:55 +0100)]
xc_save: Janitorial work.

Remove an unused variable.
Replace errx by warnx when cleanup code follows.

From: Brendan Cully <brendan@cs.ubc.ca>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agolsevtchn: Improve this evtchn reporting tool.
Keir Fraser [Fri, 5 Sep 2008 10:56:35 +0000 (11:56 +0100)]
lsevtchn: Improve this evtchn reporting tool.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoioemu: fix offset of MSI-X memory-mapped table.
Keir Fraser [Fri, 5 Sep 2008 10:18:20 +0000 (11:18 +0100)]
ioemu: fix offset of MSI-X memory-mapped table.

Current code does not set dev->msix->table_off variable.
The offset of MSI-X memory mapped table is treated as 0.
The wrong region is unmapped from guest physical memory space.
As a result, guest device driver can't access memory mapped resource.

Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
17 years agoxsm: A few hacks to get XSM-disabled (aka dummy) mode working.
Keir Fraser [Thu, 4 Sep 2008 15:29:38 +0000 (16:29 +0100)]
xsm: A few hacks to get XSM-disabled (aka dummy) mode working.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoMore efficient implementation of SCHEDOP_poll when polling a single port.
Keir Fraser [Thu, 4 Sep 2008 13:38:26 +0000 (14:38 +0100)]
More efficient implementation of SCHEDOP_poll when polling a single port.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: smp_mb__{before,after}_clear_bit() are no-ops.
Keir Fraser [Thu, 4 Sep 2008 13:37:56 +0000 (14:37 +0100)]
x86: smp_mb__{before,after}_clear_bit() are no-ops.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoxsm: Fix __import__() usage on Python 2.4 and earlier.
Keir Fraser [Thu, 4 Sep 2008 10:55:48 +0000 (11:55 +0100)]
xsm: Fix __import__() usage on Python 2.4 and earlier.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoioemu: support PCI Express Capability Structure version 1.
Keir Fraser [Thu, 4 Sep 2008 10:28:17 +0000 (11:28 +0100)]
ioemu: support PCI Express Capability Structure version 1.
Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
17 years agoxsm, flask: sample flask policy
Keir Fraser [Thu, 4 Sep 2008 10:26:25 +0000 (11:26 +0100)]
xsm, flask: sample flask policy

- The patch includes a policy for xen that can be booted into
  enforcing mode and supports creation and management of
  paravirtualized guests.  The policy follows the dom0/domU usage
  model, extension to other models or the addition of management or IO
  permissions should be much more straightforward now. The option
  flask_enforcing=1 can be passed on the xen line in grub to boot
  into enforcing mode.

- The policy provides a basic policy for booting the platform and
  creating a domU with the label system_u:object_r:domU_t.  The policy
  can be easily extended to support new types by modifying the xen.te
  source file.

- The policy includes some basic macros which may be helpful in
  extending the policy.

- The policy is compatible with and requires the most recent XSM
  patch, xsm-flask-io-sysctl-hooks-090308.diff.

- The policy is not built as part of the make all as it requires the
  SELinux policy compiler which may/may not be installed on all
  systems.  Users must go into the tools/flask/policy directory and
  explicitly compile the policy.

Signed-off-by: George Coker <gscoker@alpha.ncsc.mil>
17 years agoxsm: refactor IO hooks/sysctl hooks
Keir Fraser [Thu, 4 Sep 2008 10:25:09 +0000 (11:25 +0100)]
xsm: refactor IO hooks/sysctl hooks

- The patch refactors the IO resource checks into the rangeset add/del
  code. This produces a much more architecture friendly implementation and
  ensures that HVM and paravirtualized guests are checked consistently.

- The patch removes the following hooks in support of the refactoring
  of the IO resource checks:
    - xsm_irq_permission
    - xsm_iomem_permission
    - xsm_ioport_permission

- The patch adds the following hooks in support of the refactoring of
  the IO resource checks:
    - xsm_add_range
    - xsm_remove_range

- These IO refactoring changes are transparent to any pre-existing
  Flask policies.

- The patch adds also adds hooks for sysctl functionality that was
  added since the last major XSM patch.  The following hooks were added:
    - xsm_set_target
    - xsm_debug_keys
    - xsm_getcpuinfo
    - xsm_availheap
    - xsm_firmware_info
    - xsm_acpi_sleep
    - xsm_change_freq
    - xsm_getidletime
    - xsm_sendtrigger
    - xsm_test_assign_device
    - xsm_assign_device
    - xsm_deassign_device
    - xsm_bind_pt_irq
    - xsm_pin_mem_cacheattr
    - xsm_ext_vcpucontext

Signed-off-by: George Coker <gscoker@alpha.ncsc.mil>
17 years agoxsm, python tools: remove autogenerated xsm.py
Keir Fraser [Thu, 4 Sep 2008 10:23:08 +0000 (11:23 +0100)]
xsm, python tools: remove autogenerated xsm.py

- The patch does away with the autogenerated xsm.py file and
introduces a config parameter in xend-config.sxp to determine the
security module. The parameter is (xsm_module_name {acm, dummy,
flask}).  The default setting/option is dummy.  .hgignore is also
updated to stop ignoring xsm.py on commits.

- The patch has created an xsconstant for XS_POLICY_FLASK and updated
  the toolchain to check the instance of XS_POLICY_USE.  XS_POLICY_USE
  evalauates to XS_POLICY_FLASK or XS_POLICY_ACM or XS_POLICY_DUMMY
  depending on configuration.

- Flask relies on the current value of ssidref returned by dominfo to
  ensure that the label to sid mapping is consistent.  ssidref had
  been pop'ed from the dominfo object.  The patch addresses this
  issue.

- Flask python module style cleanups.

Signed-off-by: George Coker <gscoker@alpha.ncsc.mil>
17 years agoCPUIDLE: Write to ARB_DISABLE conditionally to reduce some idle overheads.
Keir Fraser [Thu, 4 Sep 2008 10:19:17 +0000 (11:19 +0100)]
CPUIDLE: Write to ARB_DISABLE conditionally to reduce some idle overheads.

By protecting entry/exit with a spinlock we can safely determine
precisely when it is required that we assert/deassert ARB_DISABLE.

Signed-off-by: Wei Gang <gang.wei@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: Fix interpretation of get_l*e_linear_pagetable().
Keir Fraser [Wed, 3 Sep 2008 13:56:08 +0000 (14:56 +0100)]
x86: Fix interpretation of get_l*e_linear_pagetable().

Broken by get_page_type() preemption patch (c/s 18412).

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: Fix guest_handle_okay/guest_handle_subrange_okay
Keir Fraser [Wed, 3 Sep 2008 13:16:35 +0000 (14:16 +0100)]
x86: Fix guest_handle_okay/guest_handle_subrange_okay

The guest handle checks should use paging_* predicates, not shadow_*.
Also tidy up a few places where p2m definitions were being imported
via asm/guest_access.h -> asm/shadow.h -> asm/p2m.h

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
17 years agoRemove guest_physmap_max_mem_pages(), which is no longer usefully
Keir Fraser [Wed, 3 Sep 2008 13:14:18 +0000 (14:14 +0100)]
Remove guest_physmap_max_mem_pages(), which is no longer usefully
defined in any architecture.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
17 years agoACPI: Remove a redundant call to acpi_hw_register_read().
Keir Fraser [Wed, 3 Sep 2008 11:45:59 +0000 (12:45 +0100)]
ACPI: Remove a redundant call to acpi_hw_register_read().

Signed-off-by: Wei Gang <gang.wei@intel.com>
17 years agoFix for VCPU periodic timer.
Keir Fraser [Wed, 3 Sep 2008 10:02:57 +0000 (11:02 +0100)]
Fix for VCPU periodic timer.

Idle vcpu periodic timer is useless. It increased the lapic timer
interrupt number, which decreased the cpu idle residency. This patch
disables idle vcpu periodic timer via keeping v->periodic_period = 0.

The vcpu periodic timer may be expired 50us before expected time
because there is a 50us TIMER_SLOP used for soft timer (xen/common/timer.c,
timer_softirq_action()). This will cause vcpu_periodic_timer_work() be
continuously called tens of times in a single call of
timer_softirq_action() until (now > periodic_next_event). It brings
unnecessary overhead. This patch adds a similar time slop in vcpu
periodic timer to eliminate this overhead.

Signed-off-by: Wei Gang <gang.wei@intel.com>
17 years agoxend: move the call to XendDevices.destroy_device_state()
Keir Fraser [Wed, 3 Sep 2008 09:38:33 +0000 (10:38 +0100)]
xend: move the call to XendDevices.destroy_device_state()

This patch moves the call to XendDevices.destroy_device_state() to the
function _remove_domain. Previously only Xen-API calls were calling
the destroy_device_state() function.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
17 years agoxend: Fix Bug 1336
Keir Fraser [Tue, 2 Sep 2008 11:06:56 +0000 (12:06 +0100)]
xend: Fix Bug 1336

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
17 years agox86: allow Dom0 to control a few more MSR bits
Keir Fraser [Mon, 1 Sep 2008 10:29:01 +0000 (11:29 +0100)]
x86: allow Dom0 to control a few more MSR bits

Linux 2.6.27 adds code to enable extended config space accesses in the
Northbridge Configuration MSR; Xen should allow Dom0 to control the
respective bit.

Likewise, 2.6.26 added support to enable the MMIO config space access
method for certain Sun systems, so similarly Xen should allow Dom0 to
control the respective fields of the MMIO Configuration Base Address
Register.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agox86: make {get,put}_page_type() preemptible
Keir Fraser [Mon, 1 Sep 2008 09:52:05 +0000 (10:52 +0100)]
x86: make {get,put}_page_type() preemptible

This is only a first step - more call sites need to be hooked up.

Most of this is really Keir's work, I just took what he handed me and
fixed a few remaining issues.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years ago[IA64] use ioemu-remote as default on ia64.
Keir Fraser [Mon, 1 Sep 2008 09:49:00 +0000 (10:49 +0100)]
[IA64] use ioemu-remote as default on ia64.

Now ioemu-remote compiles for ia64 so that make it default.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
17 years agoioemu: fix multiple pci-attach/pci-detach by removing the meaningless irq_index
Keir Fraser [Mon, 1 Sep 2008 09:48:09 +0000 (10:48 +0100)]
ioemu: fix multiple pci-attach/pci-detach by removing the meaningless irq_index

For HVM guest, we can't do pci-attach/pci-detach for >64 times due to
the meaningless checking in pci_register_device(). I made a test of
300 times of attach/detach and everything now works well.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
17 years agocross-install: Only apply in tools directory, and automatically wrap $INSTALL.
Keir Fraser [Sat, 30 Aug 2008 07:36:02 +0000 (08:36 +0100)]
cross-install: Only apply in tools directory, and automatically wrap $INSTALL.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agostubdom: Absolute path for XEN_ROOT.
Keir Fraser [Sat, 30 Aug 2008 07:11:09 +0000 (08:11 +0100)]
stubdom: Absolute path for XEN_ROOT.

It may be used in subdirectories indirectly (e.g., as path component
of $(INSTALL)).

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agovtd: fix Dom0 S3 when VT-d is enabled.
Keir Fraser [Fri, 29 Aug 2008 15:16:33 +0000 (16:16 +0100)]
vtd: fix Dom0 S3 when VT-d is enabled.

Now if VT-d is enabled, when Dom0 does S3, Xen doesn't suspend/resume
the IOMMU states.

The patch adds the missing invocations of
iommu_suspend()/iommu_resume() and makes some nesessary fixes:
1) In iommu_set_root_entry(), we should not re-allocate the root-entry
when Xen returns from S3;
2) Define the array iommu_state correctly (u8 -> u32);
3) Only save/restore the necessary IOMMU registers.

The patch was tested on Weybridge.

NOTE: if we have some HVM guests which have assigned devices, and we
want to do Dom S3, we MUST do HVM S3 for each HVM guest first.
Namely, the steps are:
1) Use HVM S3 in guest to suspend the guest (for example, in Linux HVM
guest, this is "echo mem > /sys/power/state");
2) Use Dom0 S3 to suspend Dom0: "echo mem > /sys/power/state";
3) At some point, Dom0 resumes from S3 (for example, by pressing the
power button or using the acpi alarm);
4) Use "xm trigger HVM_DOM_ID s3resume" to resume every HVM guest
which were suspended previously.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
17 years agox86: constify microcode hypercall argument
Keir Fraser [Fri, 29 Aug 2008 15:11:05 +0000 (16:11 +0100)]
x86: constify microcode hypercall argument

Linux 2.6.27 marks the data pointer in its firmware struct 'const',
and hence, to avoid a compiler warning, Xen's microcode update
interface should be properly properly constified too.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agodocs: A small update in the vtpm documentation file.
Keir Fraser [Fri, 29 Aug 2008 15:08:09 +0000 (16:08 +0100)]
docs: A small update in the vtpm documentation file.

Signed-off-by: Stefan Berger <stefanB@us.ibm.com>
17 years agoUpdate the URL for the ACPI compiler sources.
Keir Fraser [Fri, 29 Aug 2008 15:07:36 +0000 (16:07 +0100)]
Update the URL for the ACPI compiler sources.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
17 years agoRun cross-compilation-aware install wrapper script.
Keir Fraser [Fri, 29 Aug 2008 15:06:41 +0000 (16:06 +0100)]
Run cross-compilation-aware install wrapper script.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoamd: Extended migration support
Keir Fraser [Fri, 29 Aug 2008 10:13:41 +0000 (11:13 +0100)]
amd: Extended migration support

This patch adds support for AMD's extended migration, aka CPUID
features and extended features masking.

Signed-off-by: Travis Betak <travis.betak@amd.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agodocs: Fix datamodel-graph of XenAPI
Keir Fraser [Fri, 29 Aug 2008 09:46:46 +0000 (10:46 +0100)]
docs: Fix datamodel-graph of XenAPI

"VTPM" is forgotten.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
17 years agopv-grub: fix example file
Keir Fraser [Fri, 29 Aug 2008 09:45:09 +0000 (10:45 +0100)]
pv-grub: fix example file

Apparently 64MB is too short for the domain builder.
No kernel option should be passed, as they are provided by menu.lst,
and would only confuse grub.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agox86: time_calibration_rendezvous must be invoked with @wait=1.
Keir Fraser [Thu, 28 Aug 2008 12:31:49 +0000 (13:31 +0100)]
x86: time_calibration_rendezvous must be invoked with @wait=1.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agostubdom: fix munmap's update_va_mapping flag passing, thus fixing
Keir Fraser [Thu, 28 Aug 2008 12:09:02 +0000 (13:09 +0100)]
stubdom: fix munmap's update_va_mapping flag passing, thus fixing
INVLPG passing

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agosoftirq: Add sanity assertion about NR_SOFTIRQS.
Keir Fraser [Thu, 28 Aug 2008 10:38:57 +0000 (11:38 +0100)]
softirq: Add sanity assertion about NR_SOFTIRQS.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: There are now two x86-specific softirqs.
Keir Fraser [Thu, 28 Aug 2008 10:38:02 +0000 (11:38 +0100)]
x86: There are now two x86-specific softirqs.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoUpdate Xen version for 3.4-unstable development phase
Keir Fraser [Thu, 28 Aug 2008 10:31:16 +0000 (11:31 +0100)]
Update Xen version for 3.4-unstable development phase

17 years agohvmloader: skip upper field of 64 bit base address register.
Keir Fraser [Thu, 28 Aug 2008 08:59:49 +0000 (09:59 +0100)]
hvmloader: skip upper field of 64 bit base address register.

Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
17 years agoioemu, passthru: make upper field of 64 bit bar writable.
Keir Fraser [Thu, 28 Aug 2008 08:58:01 +0000 (09:58 +0100)]
ioemu, passthru: make upper field of 64 bit bar writable.

Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
17 years agostubdom: add LANG=C for 'gcc -print-search-dirs'
Keir Fraser [Thu, 28 Aug 2008 08:55:40 +0000 (09:55 +0100)]
stubdom: add LANG=C for 'gcc -print-search-dirs'

Prevents unwanted localisation of pretty-printing.

Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
17 years agodocs: Update user manual for 3.3.
Keir Fraser [Thu, 28 Aug 2008 08:49:52 +0000 (09:49 +0100)]
docs: Update user manual for 3.3.

From: Stephen Spector <stephen.spector@citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoxend: Cleanup destroy and destroyDomain methods
Keir Fraser [Thu, 28 Aug 2008 08:44:13 +0000 (09:44 +0100)]
xend: Cleanup destroy and destroyDomain methods

When domains are destroyed, _prepare_phantom_paths() method
and _cleanup_phantom_devs() method are called twice as follows.

destroy()@XendDomainInfo.py
    _prepare_phantom_paths() --------------- 1
    _cleanupVm()
    destroyDomain()
        _prepare_phantom_paths() ----------- 2
        xc.domain_destroy_hook()
        xc.domain_pause()
        do_FLR()
        xc.domain_destroy()
        XendDomain.remove_domain()
        cleanupDomain()
        _cleanup_phantom_devs() ------------ 1
    _cleanup_phantom_devs() ---------------- 2
    XendDomain.domain_delete_by_dominfo()

This is a cleanup patch.  It combines destroyDomain() method
into destroy() method, then _prepare_phantom_paths() method and
_cleanup_phantom_devs() method are called only once.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
17 years agostubdom: make xc_map_foreign_ranges use malloc instead of stack space
Keir Fraser [Thu, 28 Aug 2008 08:40:10 +0000 (09:40 +0100)]
stubdom: make xc_map_foreign_ranges use malloc instead of stack space

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agolibxc: Use vcpu_guest_context_any_t instead of two pages
Keir Fraser [Wed, 27 Aug 2008 15:23:10 +0000 (16:23 +0100)]
libxc: Use vcpu_guest_context_any_t instead of two pages

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agohvmloader: Fix e820_malloc() after bug I introduced in c/s 18383
Keir Fraser [Wed, 27 Aug 2008 14:16:13 +0000 (15:16 +0100)]
hvmloader: Fix e820_malloc() after bug I introduced in c/s 18383
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agotools/xenmon/Makefile: Move LDFLAGS after $<
Keir Fraser [Wed, 27 Aug 2008 14:02:38 +0000 (15:02 +0100)]
tools/xenmon/Makefile: Move LDFLAGS after $<

gcc expects libraries needed for object files to be specified after
the object. Linking usually does not fail, unless it is optimized (for
instance, using -Wl,-as-needed).

The related Gentoo bug is 135145 [ https://bugs.gentoo.org/135145 ].

From: Robert Buchholz <rbu@gentoo.org>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agostubdom: add v?errx? and v?warnx? functions
Keir Fraser [Wed, 27 Aug 2008 13:57:51 +0000 (14:57 +0100)]
stubdom: add v?errx? and v?warnx? functions

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agoioemu: Add SEEK_STAT in all non-error cases except sleep request,
Keir Fraser [Wed, 27 Aug 2008 13:57:23 +0000 (14:57 +0100)]
ioemu: Add SEEK_STAT in all non-error cases except sleep request,
since our seek times are virtually 0.  Although this flag is
deprecated by newer ATA standards, Linux at least checks it for CD
drives, and would timeout in some cases if we do not set it.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agohvm: Use main memory for video memory.
Keir Fraser [Wed, 27 Aug 2008 13:53:39 +0000 (14:53 +0100)]
hvm: Use main memory for video memory.

When creating an HVM domain, if e.g. another domain is created before
qemu allocates video memory, the extra 8MB memory ballooning is not
available any more, because it got consumed by the other domain.

This fixes it by taking video memory from the main memory:

- make hvmloader use e820_malloc to reserve some of the main memory
  and notify ioemu of its address through the Xen platform PCI card.
- add XENMAPSPACE_mfn to the xen_add_to_physmap memory op, to allow
  ioemu to move the MFNs between the original position and the PCI
  mapping, when LFB acceleration is disabled/enabled
- add a remove_from_physmap memory op, to allow ioemu to unmap it
  completely for the case of old guests with acceleration disabled.
- add xc_domain_memory_translate_gpfn_list to libxc to allow ioemu to
  get the MFNs of the video memory.
- have xend save the PCI memory space instead of ioemu: if a memory
  page is there, the guest can access it like usual memory, so xend
  can safely be responsible to save it.  The extra benefit is that
  live migration will apply the logdirty optimization there too.
- handle old saved images, populating the video memory from ioemu if
  really needed.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agomini-os: Fix build failure with void* arithmetic.
Keir Fraser [Wed, 27 Aug 2008 12:31:01 +0000 (13:31 +0100)]
mini-os: Fix build failure with void* arithmetic.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoFall back to a timer linked list when the timer heap overflows.
Keir Fraser [Wed, 27 Aug 2008 12:24:35 +0000 (13:24 +0100)]
Fall back to a timer linked list when the timer heap overflows.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoUse 'gcc -v 2>&1 | tail -1' to extract gcc version.
Keir Fraser [Wed, 27 Aug 2008 10:47:02 +0000 (11:47 +0100)]
Use 'gcc -v 2>&1 | tail -1' to extract gcc version.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoxmalloc: Cannot be called in IRQ context so doesn't need IRQ-safe locking.
Keir Fraser [Wed, 27 Aug 2008 09:26:50 +0000 (10:26 +0100)]
xmalloc: Cannot be called in IRQ context so doesn't need IRQ-safe locking.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: Signal softirq-context calibration with an actual first-class
Keir Fraser [Wed, 27 Aug 2008 09:12:49 +0000 (10:12 +0100)]
x86: Signal softirq-context calibration with an actual first-class
softirq handle rather than kludging it with set_timer().

Should be faster and is definitely clearer. Also avoids us using
set_timer() in IRQ context (which is currently broken but soon won't
be).

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: Assert in_irq() while processing guest-bound interrupts.
Keir Fraser [Wed, 27 Aug 2008 09:11:33 +0000 (10:11 +0100)]
x86: Assert in_irq() while processing guest-bound interrupts.

Actually a fair amount of infrastructure is onvolved these days, and
we'd like subsystems we call into know that we're in IRQ context so
they can handle that or BUG/ASSERT if appropriate.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoMore precise regexp to extract version line from 'gcc -v'.
Keir Fraser [Wed, 27 Aug 2008 08:57:53 +0000 (09:57 +0100)]
More precise regexp to extract version line from 'gcc -v'.

Reported by Robert Buchholz <rbu@gentoo.org>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>