]> xenbits.xensource.com Git - xen.git/log
xen.git
17 years agox86, hvm: Clean up code style in stdvga code and do not compile for
Keir Fraser [Mon, 29 Oct 2007 09:17:38 +0000 (09:17 +0000)]
x86, hvm: Clean up code style in stdvga code and do not compile for
32-bit hypervisor (it doesn't work).
Signed-off-by: Keir Fraser <keir@xensource.com>
17 years agox86, vt-d: Move out isa irq mapping from hvm_do_IRQ_dpci()
Keir Fraser [Mon, 29 Oct 2007 09:16:59 +0000 (09:16 +0000)]
x86, vt-d: Move out isa irq mapping from hvm_do_IRQ_dpci()

Setting isa irq mapping in hvm_do_IRQ_dpci() costs time when each
interrupt occurs, and it doesn't update isa irq mapping when pci_link
is updated.

Signed-off-by: Weidong Han <weidong.han@intel.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
17 years agoxend, acm: Trigger a script when a resource's label changes
Keir Fraser [Mon, 29 Oct 2007 08:46:34 +0000 (08:46 +0000)]
xend, acm: Trigger a script when a resource's label changes

This patch triggers a script when a resource's label changes. The xend
config file should provide a variable 'resource-label-change-script'
that can then be launched.

Signed-off-by; Stefan Berger <stefanb@us.ibm.com>

17 years agoxend, acm: Fix bad indentation
Keir Fraser [Mon, 29 Oct 2007 08:45:58 +0000 (08:45 +0000)]
xend, acm: Fix bad indentation
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
17 years agoFix PVFB device initialization
Keir Fraser [Fri, 26 Oct 2007 16:16:14 +0000 (17:16 +0100)]
Fix PVFB device initialization

The final series of patches I sent out lost 2 hunks in the big
refactoring patches I did thanks to a messed up rebase/rediff :-( This
patch fixes the device nodename initialization so that watches work
correctly.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
17 years agox86: Replace FLUSH_LEVEL() parameter to flush_area() with rather
Keir Fraser [Fri, 26 Oct 2007 15:06:49 +0000 (16:06 +0100)]
x86: Replace FLUSH_LEVEL() parameter to flush_area() with rather
clearer FLUSH_ORDER(). Also remove bogus assertion.
Signed-off-by: Keir Fraser <keir@xensource.com>
17 years agoserial: Check index argument before indexing into an array.
Keir Fraser [Fri, 26 Oct 2007 14:14:38 +0000 (15:14 +0100)]
serial: Check index argument before indexing into an array.
Pointed out by Christoph Egger, and worth fixing for clarity even if
it's not necessarily a bug.
Signed-off-by: Keir Fraser <keir@xensource.com>
17 years agoFire watch for non-dom0 backend when frontend is removed from xenstore
Keir Fraser [Fri, 26 Oct 2007 10:48:58 +0000 (11:48 +0100)]
Fire watch for non-dom0 backend when frontend is removed from xenstore
in a transaction.
Signed-off-by: Max Zhen <max.zhen@sun.com>
17 years agox86/64: paravirt 32-on-64 call gate support
Keir Fraser [Fri, 26 Oct 2007 10:40:10 +0000 (11:40 +0100)]
x86/64: paravirt 32-on-64 call gate support

As we realized while trying out NetWare's ring 3 support, call gates
didn't work for 32-bit guests on 64-bit hypervisor. Since x86-64
doesn't know 16- or 32-bit call gates, the only option was to emulate
them. The code here was developed against 3.0.4, so hasn't been
checked for potential integration possibilities with the much improved
emulator; nevertheless I want to supply this patch.

As was realized in the course of creating this patch, 64-bit gates
don't work either, and will also need to be emulated if any
environment intends to use them. The patch changes behavior here in
that rather silently permitting the use of 64-bit gates (with possibly
difficult to understand exceptions happening on the first instruction
of the call/jump target) the call/jump itself will now fault, with the
error code indicating the gate that was attempted to be used. I intend
to complete the emulation to also cover 64-bit gates, but there is one
issue that first needs to be addressed: Whether a gate transitions
from user to kernel mode doesn't depend on the gate, but rather on the
descriptor referenced by the selector held in the gate. As the two can
change independently, this decision can be made only at the point of
use of the gate, and consequently descriptors for kernel code segments
must become distinguishable from user ones, which they currently
aren't as they both get their DPL forced to 3. An initial thought here
is to possibly leverage the otherwise meaningless conforming bit
(i.e. forcing it on for all user code segments, and off for kernel
ones, where then the distinction can be made at the point the
descriptor gets verified/fixed up based of the kernel supplied DPL
[wouldn't work for old guests when setting the DPL to 3 was still
required to be done by the guest]).

The patch also changes behavior of check_descriptor() in that no
modification is done to the descriptor anymore unless all verification
steps passed, and in that the selector RPL of selectors in call gates
no longer gets fixed up (a comment elsewhere in the code correctly
states that the RPL field here isn't used for anything by the
processor); really, this field is now used on 64-bits to store the
original DPL of the gate, because the architectural one now gets
forced to zero.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agoClean up xen/xsm/xsm_policy.c compilation warning on !x86.
Keir Fraser [Fri, 26 Oct 2007 09:57:03 +0000 (10:57 +0100)]
Clean up xen/xsm/xsm_policy.c compilation warning on !x86.
Signed-off-by: Atsushi SAKAI <sakaia@jp.fujitsu.com>
17 years agoLAPIC timer accounting fix
Keir Fraser [Fri, 26 Oct 2007 09:55:50 +0000 (10:55 +0100)]
LAPIC timer accounting fix

Offset emulated local APIC timer so it doesn't tick during guest's
timer related processing. Otherwise, guests using the local APIC for
process accounting can see long sequences of process ticks incorrectly
charged to interrupt processing.

Signed-off-by: Ben Guthro <bguthro@virtualron.com>
Signed-off-by: Gary Grebus <ggrebus@virtualiron.com>
17 years agox86: Fix 32-bit build, and remove pragma usage in public headers (and
Keir Fraser [Fri, 26 Oct 2007 09:55:32 +0000 (10:55 +0100)]
x86: Fix 32-bit build, and remove pragma usage in public headers (and
use of volatile too).
Signed-off-by: Keir Fraser <keir@xensource.com>
17 years agox86, hvm: Allow Cirrus VGA BIOS to clear framebuffer with minimal PIO writes.
Keir Fraser [Fri, 26 Oct 2007 09:41:07 +0000 (10:41 +0100)]
x86, hvm: Allow Cirrus VGA BIOS to clear framebuffer with minimal PIO writes.

Signed-off-by: Ben Guthro <bguthro@virtualron.com>
Signed-off-by: Gary Grebus <ggrebus@virtualiron.com>
17 years agox86, hvm, vt-d: Kill timer in iommu domain destroy
Keir Fraser [Fri, 26 Oct 2007 09:33:12 +0000 (10:33 +0100)]
x86, hvm, vt-d: Kill timer in iommu domain destroy
Signed-off-by: Weidong Han <weidong.han@intel.com>
17 years agox86, hvm: Improve standard VGA performance
Keir Fraser [Fri, 26 Oct 2007 09:32:20 +0000 (10:32 +0100)]
x86, hvm: Improve standard VGA performance

This patch improves the performance of Standard VGA,
the mode used during Windows boot and by the Linux
splash screen.

It does so by buffering all the stdvga programmed output ops
and memory mapped ops (both reads and writes) that are sent to QEMU.

We maintain locally essential VGA state so we can respond
immediately to input and read ops without waiting for
QEMU.  We snoop output and write ops to keep our state
up-to-date.

PIO input ops are satisfied from cached state without
bothering QEMU.

PIO output and mmio ops are passed through to QEMU, including
mmio read ops.  This is necessary because mmio reads
can have side effects.

I have changed the format of the buffered_iopage.
It used to contain 80 elements of type ioreq_t (48 bytes each).
Now it contains 672 elements of type buf_ioreq_t (6 bytes each).
Being able to pipeline 8 times as many ops improves
VGA performance by a factor of 8.

I changed hvm_buffered_io_intercept to use the same
registration and callback mechanism as hvm_portio_intercept
rather than the hacky hardcoding it used before.

In platform.c, I fixed send_timeoffset_req() to sets its
ioreq size to 8 (rather than 4), and its count to 1 (which
was missing).

Signed-off-by: Ben Guthro <bguthro@virtualron.com>
Signed-off-by: Robert Phillips <rphillips@virtualiron.com>
17 years agox86: Fix MTRR/PAT virtualisation on PAE
Keir Fraser [Fri, 26 Oct 2007 09:00:10 +0000 (10:00 +0100)]
x86: Fix MTRR/PAT virtualisation on PAE

Various 'long's should be 'u64's.

Signed-off-by: Disheng Su <disheng.su@intel.com>
17 years agohvm: Clean up firmware compilation warnings.
Keir Fraser [Fri, 26 Oct 2007 08:58:43 +0000 (09:58 +0100)]
hvm: Clean up firmware compilation warnings.
Signed-off-by: Atsushi SAKAI <sakaia@jp.fujitsu.com>
17 years agohvm, x86: Allow virtual timer mode to be specified.
Keir Fraser [Fri, 26 Oct 2007 08:56:54 +0000 (09:56 +0100)]
hvm, x86: Allow virtual timer mode to be specified.

In HVM config file:
timer_mode=0 # Default: virtual time is delayed when timer ticks are
             # missed dur to preemption
timer_mode=1 # Virtual time always equals wall time, even while missed
             # ticks are pending

From: Haitao Shan <haitao.shan@intel.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
17 years agoxentrace: Fix race in updating consumer ring index.
Keir Fraser [Thu, 25 Oct 2007 16:27:57 +0000 (17:27 +0100)]
xentrace: Fix race in updating consumer ring index.
From: George Dunlap <gdunlap@xensource.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
17 years agoia64, qemu-dm: Trivial build fix.
Keir Fraser [Thu, 25 Oct 2007 15:52:05 +0000 (16:52 +0100)]
ia64, qemu-dm: Trivial build fix.
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
17 years agopv-on-hvm: fixes for unmodified drivers build and modern Linux
Keir Fraser [Thu, 25 Oct 2007 14:54:19 +0000 (15:54 +0100)]
pv-on-hvm: fixes for unmodified drivers build and modern Linux

- The adjustments to README and overrides.mk are generic.
- The removal of explicit linux/config.h inclusion should also not
  cause any issues.
- The introduction of irq_handler_t should eliminiate warnings on
  2.6.19+ kernels (I didn't check they're there, but since the
  request_irq prototype changed, I'm sure there's at least
  one. However, as a result changes to the Linux tree are expected to
  be required.
- The change setup_xen_features -> xen_setup_features follows the
  naming in mainline 2.6.23 but would apparently also require changes
  to the Linux tree.
- The changes SA_* -> IRQF_ and  pci_module_init ->
  pci_register_driver should also not cause issues.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agoqemu: Add extra tracing around logdirty bitmap setup.
Keir Fraser [Thu, 25 Oct 2007 14:04:33 +0000 (15:04 +0100)]
qemu: Add extra tracing around logdirty bitmap setup.
Signed-off-by: Ben Guthro <bguthro@virtualron.com>
Signed-off-by: Gary Grebus <ggrebus@virtualiron.com>
17 years agohvm: In xenstore_process_logdirty_event(), if a stale shared memory
Keir Fraser [Thu, 25 Oct 2007 14:01:59 +0000 (15:01 +0100)]
hvm: In xenstore_process_logdirty_event(), if a stale shared memory
key is encountered reset 'seg' to NULL so the shared memory
initialization can be retried later.

Signed-off-by: Ben Guthro <bguthro@virtualron.com>
Signed-off-by: Robert Phillips <rphillips@virtualiron.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
17 years agohvm: Improve and limit the messages for unexpected mmio accesses to
Keir Fraser [Thu, 25 Oct 2007 13:57:08 +0000 (14:57 +0100)]
hvm: Improve and limit the messages for unexpected mmio accesses to
the platform device.

Signed-off-by: Ben Guthro <bguthro@virtualron.com>
Signed-off-by: Gary Grebus <ggrebus@virtualiron.com>
17 years agohvm,x86: Add more vmxassist opcodes for Ubuntu 7.0.4 support
Keir Fraser [Thu, 25 Oct 2007 13:55:37 +0000 (14:55 +0100)]
hvm,x86: Add more vmxassist opcodes for Ubuntu 7.0.4 support
Signed-off-by: Ben Guthro <bguthro@virtualron.com>
Signed-off-by: Gary Grebus <ggrebus@virtualiron.com>
17 years agopv-qemu 10/10: Make xenconsoled ignore doms with qemu-dm
Keir Fraser [Thu, 25 Oct 2007 13:45:47 +0000 (14:45 +0100)]
pv-qemu 10/10: Make xenconsoled ignore doms with qemu-dm

This patch writes a field /local/vm/DOMID/console/type taking the
value 'ioemu' or 'xenconsoled'. If xenconsoled sees a type that is
not its own, then it skips handling of that guest. The qemu-dm
process doesn't need to read this field since it will only attach
to the console if given the -serial pty arg which XenD already
ensures matches this xenstore field.

The overall behaviour is that if a paravirt guest has a qemu-dm
process running then that handles the console, otherwise the
xenconsoled handles it. The former is more functional, with the
exception of not currently supporting persistent logging to a
file at the same time as exposing a PTY.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
17 years agopv-qemu 9/10: XenD device model re-factoring
Keir Fraser [Thu, 25 Oct 2007 13:45:07 +0000 (14:45 +0100)]
pv-qemu 9/10: XenD device model re-factoring

This patches adapts XenD so that it is capable of starting a qemu-dm
device model for both paravirt and fullyvirt guests. A paravirt guest
will only be given a device model if it has a VFB configured, or the
user explicitly include the device_model option in the config
config. This avoids unnecessary overhead for those wanting a minimal
paravirt guest.

The bulk of this patch involves moving code from the HVMImageHandler
into the base ImageHandler class. The HVMImageHandler and
LinuxImageHandler subclasses now merely containing a couple of
overrides to set some specific command line flags. The most important
is -M xenpv, vs -M xenfv.

The XenConfig class has a minor refactoring to add a has_rfb() method
to avoid duplicating code in a couple of places. Instead of hardcoding
DEFAULT_DM it now uses the xen.util.auxbin APIs to locate it - this
works on platforms where qemu-dm is in /usr/lib64 instead of
/usr/lib. As before paravirt only gets a default qemu-dm if using a
VFB.

The vfbif.py class is trimmed out since it no longer needs to spawn a
daemon. A few other misc fixes deal with qemu-dm interactions when
saving/restoring, and in particular recovering from save failures (or
checkpointing).

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
17 years agopv-qemu 8/10: Add pv console to QEMU paravirt machine
Keir Fraser [Thu, 25 Oct 2007 13:42:40 +0000 (14:42 +0100)]
pv-qemu 8/10: Add pv console to QEMU paravirt machine

This patch adds a paravirt console driver to qemu-dm. This is used
when the QEMU machine type is 'xenpv', connecting to the ring buffer
provided by the guest kernel. The '-serial' command line flag controls
how the guest console is exposed.

For parity with xenconsoled the '-serial pty' arg can be used. For
guests which are running a qemu-dm device model, the xenconsoled
daemon is no longer needed for guest consoles. The code for the
xen_console.c is based on the original code in
tools/console/daemon/io.c, but simplified; since its only dealing with
a single guest there's no state tracking to worry about.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
17 years agopv-qemu 7/10: Async negotiation with xenfb frontend
Keir Fraser [Thu, 25 Oct 2007 13:41:35 +0000 (14:41 +0100)]
pv-qemu 7/10: Async negotiation with xenfb frontend

This patch re-factors the paravirt console xenfb_attach_dom
method. The original method blocks the caller until the front &
backends have both switched to the connected state. This isn't an
immediate problem, but patches which follow will extend qemu to also
handle the text console so blocking on graphics console startup will
block the text console processing.

The new code is basically a state machine. It starts off with a watch
waiting for the KBD backend to switch to 'initialized' mode, then does
the same for the FB backend. Now it waits for KBD & FB frontend
devices to initialize, reading & mapping the framebuffer & its config
at the appropriate step. When the KBD frontend finally reaches the
connected state it registers a graphical console with QEMU and sets up
the various framebuffer, mouse & keyboard event handlers. If a client
connects to the VNC server before this is completed, then they will
merely see a text console (or perhaps the monitor if configured that
way).

The main difference from previous versions of this patch, is that at
the suggestion of Markus Armbruster, I'vere-ordered the individual
static functions so they are in order-of-call, rather than
reversed. Although I now have to pre-declare them, it is much easier
to read the code. I have also fixed the keycode -> keysym translations
to match previous behaviour.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
17 years agopv-qemu 6/10: Merge private & public xenfb structs
Keir Fraser [Thu, 25 Oct 2007 13:40:19 +0000 (14:40 +0100)]
pv-qemu 6/10: Merge private & public xenfb structs

This patch merges the public & private structs from the paravirt FB
into a single struct. Since QEMU is the only consumer of this code
there is no need  for the artifical pub/priv split. Merging the two
will make it possible to more tightly integrate with QEMU's event
loop and do asynchronous non-blocking negoiation with the frontend
devices (see next patch).

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
17 years agopv-qemu 5/10: Refactor QEMU console integration
Keir Fraser [Thu, 25 Oct 2007 13:39:33 +0000 (14:39 +0100)]
pv-qemu 5/10: Refactor QEMU console integration

This patch moves a bunch of code out of the xen_machine_pv.c file and
into the xenfb.c file. This is simply a re-factoring to facilitate the
two patches which follow.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
17 years agopv-qemu 4/10: Refactor xenfb event handlers
Keir Fraser [Thu, 25 Oct 2007 13:38:47 +0000 (14:38 +0100)]
pv-qemu 4/10: Refactor xenfb event handlers

This patch is a simple code re-factoring to move the event loop
integration directly into the xenfb.c file. It is to facilitate
the patches which follow.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
17 years agopv-qemu: Remove standalone xenfb code
Keir Fraser [Thu, 25 Oct 2007 13:37:23 +0000 (14:37 +0100)]
pv-qemu: Remove standalone xenfb code

This patch removes all trace of the standalone paravirt framebuffer
daemon. With this there is no longer any requirement for
LibVNCServer. Everything is handled by the QEMU device model. The
xenfb.c and xenfb.h files are now moved (without code change) into
tools/ioemu/hw/ & the temporary Makefile hack from the previous patch
is removed.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
17 years agopv-qemu 2/10: Add a QEMU machine type for paravirt guests
Keir Fraser [Thu, 25 Oct 2007 13:35:04 +0000 (14:35 +0100)]
pv-qemu 2/10: Add a QEMU machine type for paravirt guests

This patch adds a paravirt machine type to QEMU. This can be requested
by passing the arg '-M xenpv' to qemu-dm. Aside from -d, and
-domain-name, the only other args that are processed are the VNC / SDL
graphics related args. Any others will be ignored. A tweak to
helper2.c was made to stop it setting up a file handler watch when
there are no CPUs registered.

The paravirt machine is in hw/xen_machine_pv.c and registers an
instance of the xenfb class, integrating it with the QEMU event loop
and key/mouse handlers. A couple of methods were adding to xenfb.h to
allow direct access to the file handles for xenstore & the event
channel.

The vfbif.py device controller is modified to launch qemu-dm instead
of the old xen-vncfb / sdlfb daemons.

When receiving framebuffer updates from the guest, the update has to
be copied into QEMU's copy of the framebuffer. This is because QEMU
stores the framebuffer in the format that is native to the SDL
display, or VNC client. This is not neccessarily the same as the guest
framebuffer which is always 32bpp. If there is an exact depth match we
use memcpy for speed, but in the non-matching case we have to fallback
to slow code to convert pixel formats. It fully supports all features
of the paravirt framebuffer including the choice between absolute &
relative pointers. The overall VIRT memory image size is about same as
old xen-vncfb, but the resident memory size is a little increased due
to copy of the framebuffer & some QEMU static state overhead. Most of
this is shared across QEMU processes.

To avoid both moving the xenfb.c and making changes to it in the same
patch, this just uses a Makefile hack to link against the xenfb.o from
the tools/xenfb/ directory. This will be removed in the following
patch.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
17 years agopv-qemu 1/10: Add a QEMU machine type for fullvirt guests
Keir Fraser [Thu, 25 Oct 2007 13:33:01 +0000 (14:33 +0100)]
pv-qemu 1/10: Add a QEMU machine type for fullvirt guests

This patch does a (no functional change) re-arrangement of the code
for starting up a fully virtualized guest. In particular it creates a
new QEMU machine type for Xen fullyvirt guests which can be specified
with '-M xenfv'. For compatibility this is in fact made to be the
default. The code for setting up memory maps is moved out of vl.c, and
into hw/xen_machine_fv.c. This is basically to ensure that it can be
easily skipped when we add a paravirt machine type in the next patch.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
17 years agox86: Save/restore new syscall/sysenter context info.
Keir Fraser [Thu, 25 Oct 2007 13:24:52 +0000 (14:24 +0100)]
x86: Save/restore new syscall/sysenter context info.
Signed-off-by: Keir Fraser <keir@xensource.com>
17 years ago[XEN] Remove dead code.
Tim Deegan [Thu, 25 Oct 2007 11:39:22 +0000 (12:39 +0100)]
[XEN] Remove dead code.
No vcpu ever runs with guest_table == phys_table any more.
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
17 years agoxen: Fix new domctl/sysctl structs to be 32-/64-bit invariant.
Keir Fraser [Thu, 25 Oct 2007 10:38:04 +0000 (11:38 +0100)]
xen: Fix new domctl/sysctl structs to be 32-/64-bit invariant.
Signed-off-by: Keir Fraser <keir@xensource.com>
17 years agoxend: fix hvm domain restore failure when using vncdisplay option.
Keir Fraser [Thu, 25 Oct 2007 08:44:11 +0000 (09:44 +0100)]
xend: fix hvm domain restore failure when using vncdisplay option.
Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
17 years agox86: GDTR must be reset after using real-mode BIOS services. Some
Keir Fraser [Thu, 25 Oct 2007 08:43:42 +0000 (09:43 +0100)]
x86: GDTR must be reset after using real-mode BIOS services. Some
BIOSes clobber GDTR. While we're here reset IDTR too, although it's
not really necessary.
Signed-off-by: John Byrne <john.l.byrne@hp.com>
Sigend-off-by: Keir Fraser <keir@xensource.com>
17 years agovt-d: add a vt-d howto setup document
Keir Fraser [Thu, 25 Oct 2007 08:27:00 +0000 (09:27 +0100)]
vt-d: add a vt-d howto setup document

docs/misc/vtd.txt is a vt-d how-to document that should answer
questions about how to use vt-d with latest Xen.

Signed-off-by: Allen Kay <allen.m.kay@intel.com>
17 years agoxend, acm: small fixes
Keir Fraser [Thu, 25 Oct 2007 08:25:03 +0000 (09:25 +0100)]
xend, acm: small fixes

Check that the policy is of type ACM and return an error if it is not.
Reworked the way the label of a domain is read.

Signed-off-by; Stefan Berger <stefanb@us.ibm.com>

17 years agoxend, acm: Put the __UNLABELED__ label into the mapfile if policy specifies it
Keir Fraser [Thu, 25 Oct 2007 08:24:28 +0000 (09:24 +0100)]
xend, acm: Put the __UNLABELED__ label into the mapfile if policy specifies it

Put the __UNLABELED__ label into the mapfile if policy specifies this
label rather than keeping the NULL_LABEL there. Also lock the map file
when it's rewritten and propagate the return code from compiling the
policy to callers.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
17 years agoxend: Reworked initialization of XSPolicy administration class
Keir Fraser [Thu, 25 Oct 2007 08:23:27 +0000 (09:23 +0100)]
xend: Reworked initialization of XSPolicy administration class

Rather than picking up the current policy from the managed policies
file the hypervisor is asked for the name of the current policy.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
17 years agoxm-test: various fixes
Keir Fraser [Thu, 25 Oct 2007 08:22:28 +0000 (09:22 +0100)]
xm-test: various fixes
- recently I added an other_config field to the VTPM record which now
needs to be accounted for otherwise the test determines a bad key
- the dry-run command was throwing a different type of exception
(ACMError) than what was caught (XSMError)
- the tests based on the raw Xen-API need to build the PV_args
parameters from the old 'root' and 'extra' parameters.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
17 years agox86: Remove dependency on stdbool.h.
Keir Fraser [Wed, 24 Oct 2007 16:21:17 +0000 (17:21 +0100)]
x86: Remove dependency on stdbool.h.
Signed-off-by: Keir Fraser <keir@xensource.com>
17 years agox86: Remove CALLBACKTYPE_sysexit.
Keir Fraser [Wed, 24 Oct 2007 16:15:54 +0000 (17:15 +0100)]
x86: Remove CALLBACKTYPE_sysexit.

Looking at the Linux patch as an example, it adds more code and
complexity than it removes, for no obvious performance benefit.

Signed-off-by: Keir Fraser <keir@xensource.com>
17 years agox86-64: syscall/sysenter support for 32-bit apps for both 32-bit apps
Keir Fraser [Wed, 24 Oct 2007 14:22:57 +0000 (15:22 +0100)]
x86-64: syscall/sysenter support for 32-bit apps for both 32-bit apps
in 64-bit pv guests and 32on64.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
17 years agominios: xenbus wait fixup
Keir Fraser [Wed, 24 Oct 2007 13:36:18 +0000 (14:36 +0100)]
minios: xenbus wait fixup
From: Samuel Thibault <samuel.thibault@xensource.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
17 years agominios: Make NSEC_TO_USEC/NSEC_TO_SEC macros expression safe.
Keir Fraser [Wed, 24 Oct 2007 13:35:19 +0000 (14:35 +0100)]
minios: Make NSEC_TO_USEC/NSEC_TO_SEC macros expression safe.
From: Samuel Thibault <samuel.thibault@xensource.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
17 years agox86/64: Fix the build.
Keir Fraser [Wed, 24 Oct 2007 13:10:01 +0000 (14:10 +0100)]
x86/64: Fix the build.
Signed-off-by: Keir Fraser <keir@xensource.com>
17 years agox86, dom0: Allow get idle time stats by mask.
Keir Fraser [Wed, 24 Oct 2007 09:49:03 +0000 (10:49 +0100)]
x86, dom0: Allow get idle time stats by mask.
Signed-off-by: Kevin Tian <kevin.tian@intel.com>
17 years agox86, cpufreq: Allow dom0 kernel to govern cpufreq via the Intel
Keir Fraser [Wed, 24 Oct 2007 09:20:03 +0000 (10:20 +0100)]
x86, cpufreq: Allow dom0 kernel to govern cpufreq via the Intel
Enahanced SpeedStep MSR.
From: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
17 years agomerge with xen-unstable.hg (staging)
Alex Williamson [Tue, 23 Oct 2007 17:27:56 +0000 (11:27 -0600)]
merge with xen-unstable.hg (staging)

17 years ago[IA64] Prevent softlock when destroying VTi domain
Alex Williamson [Tue, 23 Oct 2007 16:21:31 +0000 (10:21 -0600)]
[IA64] Prevent softlock when destroying VTi domain

Prevent softlock up when VTi domain destruction by making
relinquish_memory() continuable.  It was assumed that
mm_teardown() frees most of page_list so that the list which
is passed to relinquish_memory() is short.  However the
assumption isn't true for VTi domain case because qemu-dm
maps all the domain pages.  To avoid softlock up message,
make relinquish_memory() continuable.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
17 years agoAdd definitions for machine check MSRs introduced in AMD Family 0x10 (Barcelona).
Keir Fraser [Tue, 23 Oct 2007 15:12:14 +0000 (16:12 +0100)]
Add definitions for machine check MSRs introduced in AMD Family 0x10 (Barcelona).
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
17 years agoxentop: build fix for *bsd.
Keir Fraser [Tue, 23 Oct 2007 13:42:50 +0000 (14:42 +0100)]
xentop: build fix for *bsd.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
17 years agolibxc: check length on string copy (strcpy -> strncpy).
Keir Fraser [Tue, 23 Oct 2007 13:42:06 +0000 (14:42 +0100)]
libxc: check length on string copy (strcpy -> strncpy).
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
17 years agohvm, vt-d: Add memory cache-attribute pinning domctl for HVM
Keir Fraser [Tue, 23 Oct 2007 13:38:47 +0000 (14:38 +0100)]
hvm, vt-d: Add memory cache-attribute pinning domctl for HVM
guests. Use this to pin virtual framebuffer VRAM as attribute WB, even
if guest tries to map with other attributes.
Signed-off-by: Disheng Su <disheng.su@intel.com>
17 years agoUse $(SHELL) to find shell to run get-fields.sh script.
Keir Fraser [Tue, 23 Oct 2007 12:47:01 +0000 (13:47 +0100)]
Use $(SHELL) to find shell to run get-fields.sh script.
Signed-off-by: Keir Fraser <keir@xensource.com>
17 years agox86: Fix xentrace of hypercalls in debug builds of Xen.
Keir Fraser [Tue, 23 Oct 2007 08:41:06 +0000 (09:41 +0100)]
x86: Fix xentrace of hypercalls in debug builds of Xen.

Based on a patch by Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>

Signed-off-by: Keir Fraser <keir@xensource.com>
17 years agovt-d: Fix a bug in pmr register disabling code.
Keir Fraser [Tue, 23 Oct 2007 08:31:03 +0000 (09:31 +0100)]
vt-d: Fix a bug in pmr register disabling code.
Signed-off-by: Allen Kay <allen.m.kay@intel.com>
17 years agoxenmon: Fix security vulnerability CVE-2007-3919.
Keir Fraser [Tue, 23 Oct 2007 08:26:43 +0000 (09:26 +0100)]
xenmon: Fix security vulnerability CVE-2007-3919.

The xenbaked daemon and xenmon utility communicate via a mmap'ed
shared file. Since this file is located in /tmp, unprivileged users
can cause arbitrary files to be truncated by creating a symlink from
the well-known /tmp filename to e.g., /etc/passwd.

The fix is to place the shared file in a directory to which only root
should have access (in this case /var/run/).

This bug was reported, and the fix suggested, by Steve Kemp
<skx@debian.org>. Thanks!

Signed-off-by: Keir Fraser <keir@xensource.com>
17 years agox86: small boot-time changes:
Keir Fraser [Mon, 22 Oct 2007 20:06:11 +0000 (21:06 +0100)]
x86: small boot-time changes:
 * use memory 0x8c000-0x90000 to avoid trampling the area above
 0x90000 -- some bootloaders may leave droppings in that region
 * reserve 2kB for vga mode table -- limit of 128 VESA modes could
 overflow the original 1kB allocation
 * remove unnecessary alignment of trampoline GDT

17 years agomerge with xen-unstable.hg (staging)
Alex Williamson [Mon, 22 Oct 2007 19:57:08 +0000 (13:57 -0600)]
merge with xen-unstable.hg (staging)

17 years ago[IA64] Fix MMIO readb operation
Alex Williamson [Mon, 22 Oct 2007 18:30:17 +0000 (12:30 -0600)]
[IA64] Fix MMIO readb operation

We should do clean before read operation.  Otherwise, read one byte
data may get garbage data sometimes.

Signed-off-by: Zhang Xin <xing.z.zhang@intel.com>
17 years ago[IA64] Don't share privregs with hvm domain
Alex Williamson [Mon, 22 Oct 2007 18:26:53 +0000 (12:26 -0600)]
[IA64] Don't share privregs with hvm domain

Don't share privregs with hvm domain and twist IA64 xen dump core format
slightly.  Xen shares privregs pages with IA64 HVM domain for xm dump-core
to dump the pages.  However sharing the page allows hvm guest domain
peek/destroy the page contents that might cause xen crash.  And the xen
dump core file doesn't need privregs page because cpu context should be
obtained from vcpu context in case of IA64 HVM domain.

Although this patch modify xen dump core format, current crash utility
(at least crash 4.0-4.7) doesn't look into .xen_ia64_mmapped_regs section
and I don't know any other tools to understand xen dump core file.
So this format modification doesn't cause incompatibility issue.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
17 years ago[IA64] Kdump: 64-bit aligned access to elf-note data
Alex Williamson [Mon, 22 Oct 2007 18:19:42 +0000 (12:19 -0600)]
[IA64] Kdump: 64-bit aligned access to elf-note data

xen_core_regs, as passed by kexec_crash_save_info(), is 32-bit aligned as
it is the data section of an ELF-note. In order to ensure 64-bit aligned
access when xen_core_regs is filled in, shift it a bit and then memmove()
the data back into the 32-bit aligned location after the values have been
written.

Without this change kdump panics on an unaligned-access.

Signed-off-by: Simon Horman <horms@verge.net.au>
17 years agovt-d: Fix PCI=device parsing.
Keir Fraser [Mon, 22 Oct 2007 13:26:45 +0000 (14:26 +0100)]
vt-d: Fix PCI=device parsing.
Signed-off-by: Weidong Han <weidong.han@intel.com>
17 years agoA few small fixes for xenstored:
Keir Fraser [Mon, 22 Oct 2007 13:22:39 +0000 (14:22 +0100)]
A few small fixes for xenstored:
 - Proper sizeof parameter to snprintf
 - Return proper xs_domain_dev for netbsd.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
17 years agoia64: Fix ia64 PV domain creation with new vhpt-size parameter.
Keir Fraser [Mon, 22 Oct 2007 13:21:13 +0000 (14:21 +0100)]
ia64: Fix ia64 PV domain creation with new vhpt-size parameter.
Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
17 years agohvm/x86: MTRR/PAT virtualisation.
Keir Fraser [Mon, 22 Oct 2007 13:19:22 +0000 (14:19 +0100)]
hvm/x86: MTRR/PAT virtualisation.
Signed-off-by: Disheng Su <disheng.su@intel.com>
17 years agox86: Allow NMI callback CS to be specified via set_trap_table()
Keir Fraser [Mon, 22 Oct 2007 12:04:32 +0000 (13:04 +0100)]
x86: Allow NMI callback CS to be specified via set_trap_table()
hypercall.
Based on a patch by Jan Beulich.
Signed-off-by: Keir Fraser <keir@xensource.com>
17 years agoAllow a guest to send NMIs to its VCPUs.
Keir Fraser [Mon, 22 Oct 2007 10:11:04 +0000 (11:11 +0100)]
Allow a guest to send NMIs to its VCPUs.
Signed-off-by: Keir Fraser <keir@xensource.com>
17 years agoia64: make buffered pio aware of save/restore.
Keir Fraser [Mon, 22 Oct 2007 08:42:49 +0000 (09:42 +0100)]
ia64: make buffered pio aware of save/restore.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
17 years agoia64: Add HVM_PARAM_BUFPIOREQ_PFN constant.
Keir Fraser [Mon, 22 Oct 2007 08:41:25 +0000 (09:41 +0100)]
ia64: Add HVM_PARAM_BUFPIOREQ_PFN constant.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
17 years agox86: Allow BOOT_TRAMPOLINE to be changed without needing manual
Keir Fraser [Mon, 22 Oct 2007 06:44:25 +0000 (07:44 +0100)]
x86: Allow BOOT_TRAMPOLINE to be changed without needing manual
modification of the trampoline GDT. Adjust trampoline base to
0x94000.
Signed-off-by: Keir Fraser <keir@xensource.com>
17 years ago[IA64] Enable switch to PHY_D mmu mode
Alex Williamson [Sun, 21 Oct 2007 21:58:00 +0000 (15:58 -0600)]
[IA64] Enable switch to PHY_D mmu mode

Last patch for PHY_D mmu mode

Signed-off-by: Tristan Gingold <tgingold@free.fr>
17 years ago[IA64] phy_d mode in thash_vhpt_insert
Alex Williamson [Sun, 21 Oct 2007 21:56:36 +0000 (15:56 -0600)]
[IA64] phy_d mode in thash_vhpt_insert

Handle PHY_D mode in thash_vhpt_insert
Indentation.

Signed-off-by: Tristan Gingold <tgingold@free.fr>
17 years ago[IA64] Handle phy_d mode in vmx_hpw_miss
Alex Williamson [Sun, 21 Oct 2007 21:55:10 +0000 (15:55 -0600)]
[IA64] Handle phy_d mode in vmx_hpw_miss

Handle PHY_D mmu mode.
Indentation.
Avoid code duplication in vmx_hpw_miss.

Signed-off-by: Tristan Gingold <tgingold@free.fr>
17 years ago[IA64] New features for xenitp
Alex Williamson [Sun, 21 Oct 2007 21:52:25 +0000 (15:52 -0600)]
[IA64] New features for xenitp

Add auto-repeat feature
(Just press enter to re-execute the last go/sstep/cb/disass command).
Do not flush stdout in the signal handler.
Single step over a breakpoint.
Can quit with domain paused (quit paused)
'disp db' now displays watchpoint.

Signed-off-by: Tristan Gingold <tgingold@free.fr>
17 years ago[IA64] vti domain save/restore: libxc: implement vti domain save/restore
Alex Williamson [Sun, 21 Oct 2007 20:57:13 +0000 (14:57 -0600)]
[IA64] vti domain save/restore: libxc: implement vti domain save/restore

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
17 years ago[IA64] ti domain save/restore: libxc: add support set/get_hvmcontext support
Alex Williamson [Sun, 21 Oct 2007 20:45:20 +0000 (14:45 -0600)]
[IA64] ti domain save/restore: libxc: add support set/get_hvmcontext support

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
17 years ago[IA64] vti domain save/restore: implement hvm_save/load. work in progress.
Alex Williamson [Sun, 21 Oct 2007 20:39:07 +0000 (14:39 -0600)]
[IA64] vti domain save/restore: implement hvm_save/load. work in progress.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
17 years ago[IA64] vti domain save/restore: implement arch_get/set_info_guest() more
Alex Williamson [Sun, 21 Oct 2007 19:38:57 +0000 (13:38 -0600)]
[IA64] vti domain save/restore: implement arch_get/set_info_guest() more

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
17 years ago[IA64] vti domain save/restore: clean up vti break fault handler
Alex Williamson [Sun, 21 Oct 2007 19:38:05 +0000 (13:38 -0600)]
[IA64] vti domain save/restore: clean up vti break fault handler

It isn't necessary to set pUStk and pKStk like other VTi fault handlers.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
17 years agomerge with xen-unstable.hg
Alex Williamson [Sun, 21 Oct 2007 18:10:25 +0000 (12:10 -0600)]
merge with xen-unstable.hg

17 years agohvm: Fix PCI-passthru string parsing.
Keir Fraser [Sat, 20 Oct 2007 08:30:00 +0000 (09:30 +0100)]
hvm: Fix PCI-passthru string parsing.
Fixes crash of xend during HVM domain ccreation.
Signed-off-by: Keir Fraser <keir@xensource.com>
17 years agoReplace sysctl.physinfo.sockets_per_node with more directly useful
Keir Fraser [Fri, 19 Oct 2007 17:00:10 +0000 (18:00 +0100)]
Replace sysctl.physinfo.sockets_per_node with more directly useful
sysctl.physinfo.nr_cpus. This also avoids miscalculation of
sockets_per_node by Xen where the number of CPUs in the system is
clipped.
From: Elizabeth Kon <eak@us.ibm.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
17 years agoAvoid passing uninitialised ACPI tables to dom0 when checksums fail.
Keir Fraser [Fri, 19 Oct 2007 16:47:12 +0000 (17:47 +0100)]
Avoid passing uninitialised ACPI tables to dom0 when checksums fail.

If during boot, ACPI checksum failures disable ACPI support in Xen,
pass 'acpi=off' to the domain 0 kernel to avoid a fatal page fault
as domain 0 attempts to access the uninitialized ACPI tables.

Signed-off-by: David Lively <dlively@virtualiron.com>
Signed-off-by: Steve Ofsthun <sofsthun@virtualiron.com>
17 years agox86: Fix EFLAGS adjustment for emulated instructions.
Keir Fraser [Fri, 19 Oct 2007 16:44:20 +0000 (17:44 +0100)]
x86: Fix EFLAGS adjustment for emulated instructions.
Issue flagged by David Lively <dlively@virtualiron.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
17 years agoFix x86/64 build for *BSD.
Keir Fraser [Fri, 19 Oct 2007 13:49:08 +0000 (14:49 +0100)]
Fix x86/64 build for *BSD.
 - Config.mk: uname -m prints "amd64". Deal with this.
 - do not assume python is always in /usr/bin
 - get-fields.sh: make it portable and non-bash specific
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
17 years agox86: Fix get_page_from_l1e() and avoid host crash on 'xm save'.
Keir Fraser [Fri, 19 Oct 2007 13:30:10 +0000 (14:30 +0100)]
x86: Fix get_page_from_l1e() and avoid host crash on 'xm save'.
Signed-off-by: Keir Fraser <keir@xensource.com>
17 years agox86: Remove io_apic fake-vector style of IRQ acknowledgement. Not
Keir Fraser [Fri, 19 Oct 2007 10:32:18 +0000 (11:32 +0100)]
x86: Remove io_apic fake-vector style of IRQ acknowledgement. Not
needed now that pass-through IRQs can use the 'new' ack method.
Signed-off-by: Keir Fraser <keir@xensource.com>
17 years agovt-d: Allow pass-through of shared interrupts.
Keir Fraser [Fri, 19 Oct 2007 10:26:58 +0000 (11:26 +0100)]
vt-d: Allow pass-through of shared interrupts.
Signed-off-by: Xiaohui Xin <xiaohui.xin@intel.com>
Signed-off-by: Kevin Tian <kevin.tian@intel.com>
17 years agovt-d: Detect and report failure to assign a pass-thru PCI device.
Keir Fraser [Fri, 19 Oct 2007 08:31:03 +0000 (09:31 +0100)]
vt-d: Detect and report failure to assign a pass-thru PCI device.
Signed-off-by: Weidong Han <weidong.han@intel.com>
17 years agoia64: configure VHPT size per domain: ia64 part
Keir Fraser [Fri, 19 Oct 2007 08:28:21 +0000 (09:28 +0100)]
ia64: configure VHPT size per domain: ia64 part
Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
17 years agoia64: configure VHPT size per domain: common part
Keir Fraser [Fri, 19 Oct 2007 08:27:55 +0000 (09:27 +0100)]
ia64: configure VHPT size per domain: common part
Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
17 years agoxen, xsm: Remove private function prototype from public header.
Keir Fraser [Thu, 18 Oct 2007 15:17:53 +0000 (16:17 +0100)]
xen, xsm: Remove private function prototype from public header.
Signed-off-by: Keir Fraser <keir@xensource.com>
17 years agotools: Remove bogus external uses of xc_private.h. Clean up libflask.
Keir Fraser [Thu, 18 Oct 2007 14:12:03 +0000 (15:12 +0100)]
tools: Remove bogus external uses of xc_private.h. Clean up libflask.
Signed-off-by: Keir Fraser <keir@xensource.com>