Commit Graph
18514 Commits
Author SHA1 Message Date
Keir Fraser bbc10fbb40 xm list: Return unique exit code for non-existent domain
This patch will make xm return a exit code of 3 if `xm list
<non_existant_domain>` is done rather than the generic code of 1.  I
used 3 because XendClient had a macro setup pointing
ERROR_INVALID_DOMAIN to 3.

From: "Shaun R." <mailinglists@unix-scripts.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-09-18 10:41:41 +01:00
Keir Fraser 549e1d9ec5 x86, amd, hvm: pass through one more cpuid cache description leaf
Add a missing CPUID leaf that contains AMD-specific cache info.
Without this, Windows can spin trying to prefetch memory buffers using
a stride length of zero.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-09-18 10:39:53 +01:00
Keir Fraser 19dc3860dc Remove internal tools/ioemu tree.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-09-18 10:32:40 +01:00
Keir Fraser f2878b5bb1 xc_save/xc_restore: Fix wrong data type
xc_interface_open() may return -1, but if we define xc_fd as unsigned
int, then -1 will be > 0.

Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-09-17 14:16:02 +01:00
Keir Fraser ff965b7ec9 x86: Allow continue_hypercall_on_cpu() to be called from within an
existing continuation handler. This fix is needed for the new method
of microcode re-programming.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-09-17 14:13:10 +01:00
Keir Fraser 5c4eccd644 xm: Remove obsolete mechanism using vncviewer -listen
Without this patch, vncviewer processes remain as follows.
This patch fixes it.

> # pgrep -fl vnc
> 4303 vncviewer -log *:stdout:0 -listen 5501
> 5089 vncviewer -log *:stdout:0 -listen 5502
> 5763 vncviewer -log *:stdout:0 -listen 5503

details:
Since 21dd1fdb73d8 there have been (as far as I can see) three
separate mechanisms for achieving a VNC display:
 1. xm spawns vncviewer after getting vnc display info
     from qemu-dm via xenstore  (introduced in 21dd1fdb73d8)
 2. xm spawns vncviewer -listen and qemu-dm connects to it
 3. qemu-dm spawns vncviewer (!)

The latter two are rather strange - No.3 is very strange indeed.
So I decided that rather than try to get No.2 or No.3 on track for
going into qemu upstream, No.2 and No.3 would be dropped.
After discussion on xen-devel the mechanism No.1 was introduced,
above.

No.1 is controlled by the --spawn-vncviewer (and --vncviewer-autopass)
command line options to xm, by analogy with the -c option.

Nos.2 and 3 are controlled by elements of the domain configuration
file - and their code still remains.  So if you turn all of the vnc
options on you can get several vncviewers (although only one of them
will work).

This patch removes the support for the passive connection mode No.2
After all ioemu-remote will never connect to such a vncviewer.
The options to engage this functionality were already removed from
the example config files by Keir in 18241:bf4ef45e6a38.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2008-09-17 13:11:40 +01:00
Keir Fraser 9a744273ce mini-os: adding some missing posix function declarations
Adding some missing posix function declarations, to get rid of some
qemu-remote compile time warnings.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2008-09-17 13:10:36 +01:00
Keir Fraser 42e7334de5 x86-64: enforce memory limits imposed by virtual memory layout
... which currently means:
- The 1:1 map cannot deal with more than 1Tb.
- The m2p table can handle at most 8Tb.
- The page_info array can cover up to e.g. 1.6Gb (<=3D 64 CPUs) or
  1Tb (193-256 CPUs).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2008-09-16 15:57:22 +01:00
Keir Fraser 578f44c3e2 x86: also fix powernow's dom_mask
Just like for the Intel/ACPI cpufreq code, powernow's dom_mask also
must not be confined to the number of CPUs in the system.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2008-09-16 15:54:17 +01:00
Keir Fraser acd6ae0ad4 Merge with IA64 tree. 2008-09-16 13:53:47 +01:00
Keir Fraser 8530055bc0 x86, microcode: Free microcode_info struct at end of hypercall.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-09-16 13:49:16 +01:00
Keir Fraser 524c71bcb7 x86, microcode: Do not run microcode update in IRQ context.
It's unnecessary, and also invalid since the update process tries to
allocate memory.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-09-16 13:40:59 +01:00
Isaku Yamahata 4ba317f9fa merge with xen-unstable.hg 2008-09-16 21:25:30 +09:00
Keir Fraser 7441a335e4 x86: Simplify RDMSR pass-through emulation for certain
explicitly-named MSRs (but keep the names in the source code in case
we tighten up RDMSR emulation later).

Also add MSR_AMD_PATCHLEVEL MSR as explicitly required (for Solaris).

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-09-16 13:18:32 +01:00
Keir Fraser 5f9a78e337 x86, microcode: More code cleanups.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-09-16 13:09:04 +01:00
Keir Fraser 59bbc091e9 stubdom/ioemu link farm creation fixes
Replace the stubdom/ioemu link farm creation in stubdom/Makefile,
with code which arranges that:
 * No symlinks are made for output files - in particular, any
   symlinks for .d files would be written through by the compiler
   and cause damage to the original tree and other strange
   behaviours
 * All subdirectories are made as local subdirectories rather than
   links
 * Any interrupted or half-completed creation of the link farm
   leaves the directory in a state where the link farming will be
   restarted
 * We use make's inherent ability to test for the existence of files
   rather than using [ -f ... ] at the start of the rule's commands
 * The list of files to be excluded from the link farm can be
   easily updated
etc.

This should fix some problems particularly with parallel builds,
or by-hand builds where directories are entered in other than the
usual order.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2008-09-16 12:44:26 +01:00
Keir Fraser a552727163 x86, microcode: Clean up for Xen coding style, and disable for now
(until allocations in irq context are fixed).

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-09-16 11:26:19 +01:00
Keir Fraser 689db5e9fb Avoid parallel invocation of git for ioemu-remote.
The stubdom and tools directories both run `make ioemu-dir-find' in
tools.  In a parallel build, both these invocations can run
concurrently because we're doing recursive make.

This change fixes this problem by adding a suitable dependencies in
the top-level Makefile for the recursion into tools/ and stubdom/,
ensuring that the git fetch happens once, first.

The bug was introduced in 18472/18474.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2008-09-15 17:10:43 +01:00
Keir Fraser c694aed7c4 x86: Fix 32-bit build after AMD microcode update patch.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-09-15 15:44:38 +01:00
Keir Fraser 6266fa7f24 xsm: dummy module - implement missing stub
- This minor patch implements the missing stub function
security_label_to_details in the dummy module.  This stub function is
necessary to create domains with network interfaces for modules that
do not implement the security_label_to_details function.

Signed-off-by: George Coker <gscoker@alpha.ncsc.mil>
2008-09-15 11:36:20 +01:00
Keir Fraser 51fec0a9c7 vtd: minor edge case memory leak
Fixes an (unlikely) memory leak where mapped VT-d root entries are not
unmapped on allocation failure code path.

Signed-off-by: Ross Philipson <ross.philipson@citrix.com>
2008-09-15 11:35:20 +01:00
Keir Fraser b42db2ecdf x86, shadow: Allow removing writable mappings from splintered page tables.
The moving of the pagetable mapping in the linux kernel exposed the
fact that under the linux kernel sh_rm_write_access_from_sl1p was
always failing.

Linux seems to use big pages to access page tables, so we should
instruct the shadow code to be able to remove writable mappings from
splintered pagetables as well, avoiding using OS heuristic (which were
failing in 2.6.27 before George patch, leading to brute-force search
at each resync).

Signed-off-by: Gianluca Guida <gianluca.guida@eu.citrix.com>
2008-09-15 11:34:42 +01:00
Keir Fraser e7a8975119 x86, shadow: Fix comment about Linux direct-map address.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-09-13 08:15:26 +01:00
Keir Fraser bb401a4e5c x86, shadow: Add new location of Linux direct-map to the places to
look for writable mappings.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2008-09-12 16:45:37 +01:00
Keir Fraser bd7c09c0f8 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>
2008-09-12 14:18:13 +01:00
Keir Fraser 30c988711c $(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>
2008-09-12 13:15:36 +01:00
Keir Fraser 8d701af28f 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>
2008-09-12 11:43:47 +01:00
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
Isaku Yamahata 500b8042b6 merge with xen-unstable.hg 2008-09-12 14:47:40 +09:00
Isaku Yamahata f35ae1e3d3 [IA64] fix XENMEM_add_to_physmap with XENMAPSPACE_mfn
In case of XENMEM_add_to_physmap with XENMAPSPACE_mfn,
it triggers BUG_ON(). In fact it breaks some assumptions.
Update BUG_ON() conditions.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2008-09-12 14:32:45 +09: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