Commit Graph
18473 Commits
Author SHA1 Message Date
Keir Fraser fbf6c4db1e 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>
2008-09-12 10:41:51 +01:00
Keir Fraser e17887baa3 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>
2008-09-12 10:40:19 +01:00
Keir Fraser ea9aa98036 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>
2008-09-12 10:34:50 +01:00
Keir Fraser b0a9e1205f xenstore: Fix a memory leak in 'xs_is_domain_introduced'.
Signed-off-by: Konrad Rzeszutek <konrad@virtualiron.com>
2008-09-11 18:00:06 +01:00
Keir Fraser ae79b4c5e5 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>
2008-09-11 16:51:13 +01:00
Keir Fraser 9672d65ba3 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>
2008-09-11 16:50:04 +01:00
Keir Fraser 73ac5efa28 x86, shadow: Fix some SHADOW_PRINTK() callers.
Signed-off-by: Yoshi Tamura <tamura.yoshiaki@lab.ntt.co.jp>
2008-09-11 15:17:31 +01:00
Keir Fraser e8ca11f2f6 xendomains script: A few bug fixes.
Contributed-by: Artur Linhart <AL.LINUX@bcpraha.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2008-09-11 15:16:11 +01:00
Keir Fraser f3922f4084 x86: Support CPU hotplug offline.
Signed-off-by: Shan Haitao <haitao.shan@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-09-11 15:06:22 +01:00
Keir Fraser a3e1f638ca 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>
2008-09-11 11:58:08 +01:00
Keir Fraser 3f88f7f2b9 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>
2008-09-11 11:56:49 +01:00
Keir Fraser 7dbee4c5cd 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>
2008-09-10 11:26:16 +01:00
Keir Fraser 246127c0bc 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>
2008-09-10 11:18:36 +01:00
Keir Fraser 9851c8e77e CPUIDLE: Adjust Cx residency to contain Cx exit latency & overhead.
Signed-off-by: Wei Gang <gang.wei@intel.com>
2008-09-10 11:17:13 +01:00
Keir Fraser 789dc790f3 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>
2008-09-10 11:16:26 +01:00
Keir Fraser e862b83e84 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>
2008-09-10 11:09:08 +01:00
Keir Fraser bd9e91b6d9 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>
2008-09-10 10:53:09 +01:00
Keir Fraser 4b4f92e98d 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>
2008-09-10 10:51:48 +01:00
Keir Fraser ddf4a60539 x86: Remove MSI boot parameter -- now always on.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-09-10 10:47:46 +01:00
Keir Fraser 2c4bad2fa2 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>
2008-09-09 17:28:05 +01:00
Keir Fraser 792f9bc05e 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>
2008-09-09 15:33:27 +01:00
Keir Fraser 5b9353e8c2 Small user manual fixes.
From: Stephen Spector <stephen.spector@citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-09-09 15:08:57 +01:00
Keir Fraser 93bce41b77 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>
2008-09-09 15:05:58 +01:00
Keir Fraser 8a64d79e8d 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>
2008-09-09 15:02:51 +01:00
Keir Fraser 03a0c0a048 libxc: fix xc_memory_op(): handles XENMEM_remove_from_phsymap case.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2008-09-09 15:02:32 +01:00
Keir Fraser f8983a45fb 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>
2008-09-09 14:54:56 +01:00
Keir Fraser 0b073ae437 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>
2008-09-09 14:50:29 +01:00
Keir Fraser 660036c0eb stubdom: Fix README for renamed device-model config file.
Sigend-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-09-09 14:47:36 +01:00
Keir Fraser a69a857adb Revert 18415:3e72ab517e44 (xend: move the call to XendDevices.destroy_device_state())
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2008-09-09 14:45:23 +01:00
Keir Fraser 652f427342 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>
2008-09-08 16:02:13 +01:00
Keir Fraser be608b5e9b 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>
2008-09-08 16:00:53 +01:00
Keir Fraser 9a86ac1aa3 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>
2008-09-08 15:58:04 +01:00
Keir Fraser a9318ed8b2 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>
2008-09-08 15:52:50 +01:00
Keir Fraser 3908585ffe 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>
2008-09-08 15:52:03 +01:00
Keir Fraser 5c55dc3c8b 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>
2008-09-08 15:50:33 +01:00
Keir Fraser 8658aba023 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>
2008-09-08 15:47:47 +01:00
Keir Fraser 5b83873778 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>
2008-09-08 14:01:35 +01:00
Keir Fraser 9b5a8c7b09 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>
2008-09-08 14:01:17 +01:00
Keir Fraser 0705c231d9 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>
2008-09-08 11:16:23 +01:00
Keir Fraser 112dcc7dd0 xc_save: Clean up (*suspend)() callback hook.
Sigend-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-09-08 11:13:03 +01:00
Keir Fraser a2567b2631 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>
2008-09-08 10:55:09 +01:00
Keir Fraser 406b8494bb lsevtchn: Improve this evtchn reporting tool.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-09-05 11:56:35 +01:00
Keir Fraser b95d528041 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>
2008-09-05 11:18:20 +01:00
Keir Fraser 8790685cfd xsm: A few hacks to get XSM-disabled (aka dummy) mode working.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-09-04 16:29:38 +01:00
Keir Fraser ef4c6b079c More efficient implementation of SCHEDOP_poll when polling a single port.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-09-04 14:38:26 +01:00
Keir Fraser 7942f5f67d x86: smp_mb__{before,after}_clear_bit() are no-ops.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-09-04 14:37:56 +01:00
Keir Fraser 1df7998ba6 xsm: Fix __import__() usage on Python 2.4 and earlier.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-09-04 11:55:48 +01:00
Keir Fraser a8c72fbc90 ioemu: support PCI Express Capability Structure version 1.
Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
2008-09-04 11:28:17 +01:00
Keir Fraser 3129d6f2ea 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>
2008-09-04 11:26:25 +01:00
Keir Fraser aff2988ad5 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>
2008-09-04 11:25:09 +01:00