Commit Graph
18461 Commits
Author SHA1 Message Date
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
Keir Fraser 06cfe5df7b 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>
2008-09-04 11:23:08 +01:00
Keir Fraser e4e909d6e2 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>
2008-09-04 11:19:17 +01:00
Keir Fraser 88c6403475 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>
2008-09-03 14:56:08 +01:00
Keir Fraser ad2a1f8b66 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>
2008-09-03 14:16:35 +01:00
Keir Fraser d2733e1598 Remove guest_physmap_max_mem_pages(), which is no longer usefully
defined in any architecture.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2008-09-03 14:14:18 +01:00
Keir Fraser e28712c338 ACPI: Remove a redundant call to acpi_hw_register_read().
Signed-off-by: Wei Gang <gang.wei@intel.com>
2008-09-03 12:45:59 +01:00
Keir Fraser 04250df046 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>
2008-09-03 11:02:57 +01:00
Keir Fraser 87fd15ceee 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>
2008-09-03 10:38:33 +01:00
Keir Fraser c93d35a368 xend: Fix Bug 1336
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-09-02 12:06:56 +01:00
Keir Fraser ab2d69651e 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>
2008-09-01 11:29:01 +01:00
Keir Fraser 76596d0d07 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>
2008-09-01 10:52:05 +01:00
Keir Fraser 3e5c069367 [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>
2008-09-01 10:49:00 +01:00