]> xenbits.xensource.com Git - xen.git/log
xen.git
17 years agox86: Change cache attributes of Xen 1:1 page mappings in response to
Keir Fraser [Wed, 7 Nov 2007 11:44:05 +0000 (11:44 +0000)]
x86: Change cache attributes of Xen 1:1 page mappings in response to
guest mapping requests.
Based on a patch by Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
17 years agoEnable loopback disk image files on readonly nfs filesystem.
Keir Fraser [Wed, 7 Nov 2007 09:22:31 +0000 (09:22 +0000)]
Enable loopback disk image files on readonly nfs filesystem.

When we losetup a file on readonly nfs filesystem, it fails with:
# losetup /dev/loop7 /data/vm/xen_el5_i386_para/system.raw
/data/vm/xen_el5_i386_para/system.raw: Permission denied

New version of losetup has add a "-r" option for readonly loop, which
Linux kernel has supported for a long time. Some distribution (EL5
update, Fedora 8, etc.) have shipped it. This patch benefit this
option while doesn't break the old versions of losetup.

Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
17 years agoHVM device passthru: Correct PCI_EXP_DEVCTL_FLR
Keir Fraser [Wed, 7 Nov 2007 09:21:16 +0000 (09:21 +0000)]
HVM device passthru: Correct PCI_EXP_DEVCTL_FLR

This patch corrects PCI_EXP_DEVCTL_FLR so that function level reset
will be really executed, and also replaces some magic numbers with
macros.

Signed-off-by: Anthony Xu <anthony.xu@intel.com>
Signed-off-by: Weidong Han <weidong.han@intel.com>
17 years agovt-d: Disable PMR on every vt-d engine.
Keir Fraser [Wed, 7 Nov 2007 09:13:48 +0000 (09:13 +0000)]
vt-d: Disable PMR on every vt-d engine.

Signed-off-by Gang Wei (Jimmy) <gang.wei@intel.com>
Signed-off-by Kevin Tian <kevin.tian@intel.com>

17 years agoxentrace: Add missing xentrace format entries for HVM guests.
Keir Fraser [Tue, 6 Nov 2007 16:04:13 +0000 (16:04 +0000)]
xentrace: Add missing xentrace format entries for HVM guests.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
17 years ago[PV-ON-HVM] Fix evtchn of unbind_from_irqhandler()
Keir Fraser [Tue, 6 Nov 2007 11:49:15 +0000 (11:49 +0000)]
[PV-ON-HVM] Fix evtchn of unbind_from_irqhandler()

When xm block-detach command was done on PV-ON-HVM, the response of
other disks was lost. It is because a wrong event channel was
invalidated when detaching it. Not the evtchn number but the irq
number is invalidated specifying it.

Signed-off-by: Takanori Kasai <kasai.takanori@jp.fujitsu.com>
Signed-off-by: Tomonari Horikoshi <t.horikoshi@jp.fujitsu.com>
Signed-off-by: Kazuhiro Suzuki <kaz@jp.fujitsu.com>
17 years agovt-d: Free memory of g2m_ioport_list.
Keir Fraser [Tue, 6 Nov 2007 09:43:22 +0000 (09:43 +0000)]
vt-d: Free memory of g2m_ioport_list.

This patch frees memory of g2m_ioport_list when remove g2m_ioport or
destroy iommu domain to avoid memory leak. In addtion, does some
cleanup on domctl.c.

Signed-off-by: Weidong Han <weidong.han@intel.com>
17 years agoUsers manual updates:
Keir Fraser [Tue, 6 Nov 2007 09:41:57 +0000 (09:41 +0000)]
Users manual updates:
 1) PAE as 32-bit Xen default
 2) IA64 and Power are supported
 3) AMD Virtualization is supported
 4) Add console_timestamps boot param

Signed-off-by: Atsushi SAKAI <sakaia@jp.fujitsu.com>
17 years agoxenstored: Recover from corrupt tdb on reboot
Keir Fraser [Tue, 6 Nov 2007 09:40:44 +0000 (09:40 +0000)]
xenstored: Recover from corrupt tdb on reboot

Xen cannot work when xenstored's tdb is corrupt.  When that happens
somehow (and we've seen it happen), even reboot doesn't recover from
it.  It could: there is no state in tdb that needs to be persisted
across reboots.

This patch arranges that tdb is removed before xenstored is started,
provided it doesn't already run.  This is safe, because:

* xenstored cannot be restarted.  If it dies, Xen's screwed until
  reboot.

* /usr/sbin/xend always starts xenstored anyway.

* xenstored locks its pid-file (see write_pidfile() in
  tools/xenstore/xenstored_core.c), and refuses to start when it
  can't.

* My patch makes /usr/sbin/xend remove tdb iff it can lock the
  pid-file.  In other words, it removes tdb only when xenstored is not
  running, and locks it out until it is done.

  Bonus fix: it also removes stale copies of the tdb xenstored tends
  to leave behind when it exits uncleanly.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
17 years agoxend: Fix startup crash for some network configurations.
Keir Fraser [Tue, 6 Nov 2007 09:39:25 +0000 (09:39 +0000)]
xend: Fix startup crash for some network configurations.
From: Guillaume Rousse <Guillaume.Rousse@inria.fr>
Signed-off-by: Keir Fraser <keir@xensource.com>
17 years ago[SHADOW] Fix error paths in guest-pagetable walker.
Keir Fraser [Mon, 5 Nov 2007 16:38:47 +0000 (16:38 +0000)]
[SHADOW] Fix error paths in guest-pagetable walker.
Real hardware sets PFEC_page_present regardless of the access bits,
and doesn't write back _PAGE_ACCESSED except after a successful walk.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
17 years agoSmall cleanups to console-input-redirect code in Xen.
Keir Fraser [Mon, 5 Nov 2007 16:37:48 +0000 (16:37 +0000)]
Small cleanups to console-input-redirect code in Xen.
Signed-off-by: Keir Fraser <keir@xensource.com>
17 years agoioemu: Clean up compile warnings.
Keir Fraser [Mon, 5 Nov 2007 13:23:55 +0000 (13:23 +0000)]
ioemu: Clean up compile warnings.
Signed-off-by: Atsushi SAKAI <sakaia@jp.fujitsu.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
17 years agoxm: fix "xm labels type=any" command error
Keir Fraser [Mon, 5 Nov 2007 13:15:56 +0000 (13:15 +0000)]
xm: fix "xm labels type=any" command error
Signed-off-by: Syunsuke HAYASHI <syunsuke@jp.fujitsu.com>
17 years agocpufreq, amd: Xen support for architectural AMD pstate driver
Keir Fraser [Mon, 5 Nov 2007 10:45:07 +0000 (10:45 +0000)]
cpufreq, amd: Xen support for architectural AMD pstate driver

With the third generation Opteron parts, AMD switched to an
architecturally defined interface for PowerNow! that uses
different MSRs than previous versions.

Add support in msr-index.h and traps.c for the new interface.

Signed-off-by: Mark Langsdorf <mark.langsdorf@amd.com>
17 years agox86, hvm: Minor fix of hvm_set_pci_link_route().
Keir Fraser [Mon, 5 Nov 2007 10:16:30 +0000 (10:16 +0000)]
x86, hvm: Minor fix of hvm_set_pci_link_route().
Signed-off-by: Weidong Han <weidong.han@intel.com>
17 years agox86, hvm: More fixes to no-missed-tick-accounting mode.
Keir Fraser [Mon, 5 Nov 2007 10:09:10 +0000 (10:09 +0000)]
x86, hvm: More fixes to no-missed-tick-accounting mode.
Signed-off-by: Keir Fraser <keir@xensource.com>
17 years agoMerge.
Keir Fraser [Fri, 2 Nov 2007 16:38:11 +0000 (16:38 +0000)]
Merge.

17 years agohvm: Timer fixes:
Keir Fraser [Fri, 2 Nov 2007 16:34:54 +0000 (16:34 +0000)]
hvm: Timer fixes:
 1. Do not record more than one pending interrupt in
 no-missed-tick-accounting mode. We do not stack up missed interrupts
 in this timer mode.
 2. Always record all missed ticks when we are in a
 missed-tick-accounting mode. Do not have a ceiling for this as it
 simply causes guests to lose track of wall time.
 3. General bits of cleanup and simplification.
From: Dave Winchell <dwinchell@virtualiron.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
17 years agox86, svm: Add hunk I missed from Jan's debug-register handling
Keir Fraser [Fri, 2 Nov 2007 16:06:06 +0000 (16:06 +0000)]
x86, svm: Add hunk I missed from Jan's debug-register handling
patch. We need to handle SVM debug-register read access intercepts.
Signed-off-by: Keir Fraser <keir@xensource.com>
17 years ago[SHADOW] Make the guest PT walker more complete.
Tim Deegan [Fri, 2 Nov 2007 15:41:57 +0000 (15:41 +0000)]
[SHADOW] Make the guest PT walker more complete.

We now check access rights and write back the _PAGE_ACCESSED and
_PAGE_DIRTY bits into the guest entries as we walk the tables.
This makes the shadow fault handler simpler, and the various emulation
paths more correct.

This patch doesn't add checking and write-back to the HAP pagetable walker;
it just fixes up its arguments to match the new shadow one.

Signed-off-by: Tim Deegan <Tim.Deegan@eu.citrix.com>
17 years agoLive migration with MMIO pages: fix shadow pte propagation.
Keir Fraser [Fri, 2 Nov 2007 10:37:59 +0000 (10:37 +0000)]
Live migration with MMIO pages: fix shadow pte propagation.
Signed-off-by: Kieran Mansley <kmansley@solarflare.com>
17 years agox86_emulate: Allow to build outside Xen tree (in tools/test).
Keir Fraser [Fri, 2 Nov 2007 10:22:22 +0000 (10:22 +0000)]
x86_emulate: Allow to build outside Xen tree (in tools/test).
Signed-off-by: Keir Fraser <keir@xensource.com>
17 years agosolaris: Fix Solaris tools build.
Keir Fraser [Fri, 2 Nov 2007 10:16:37 +0000 (10:16 +0000)]
solaris: Fix Solaris tools build.
Signed-off-by: John Levon <john.levon@sun.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
17 years agoxen: Remove stdint.h include. Xen defines its own types.
Keir Fraser [Fri, 2 Nov 2007 09:53:28 +0000 (09:53 +0000)]
xen: Remove stdint.h include. Xen defines its own types.
Signed-off-by: Keir Fraser <keir@xensource.com>
17 years agoioemu: Remove dependency on linux/input.h
Keir Fraser [Fri, 2 Nov 2007 09:44:45 +0000 (09:44 +0000)]
ioemu: Remove dependency on linux/input.h
Signed-off-by: Keir Fraser <keir@xensource.com>
17 years agox86, svm: Adds nested paging performance counter to svmexit
Keir Fraser [Fri, 2 Nov 2007 09:30:51 +0000 (09:30 +0000)]
x86, svm: Adds nested paging performance counter to svmexit
PERFCOUNTER_ARRAY while keeping array compacted.
Signed-off-by: Stephen Wilson <stephen.wilson@amd.com>
17 years agoMerge with ia64/xen-unstable.hg
Keir Fraser [Fri, 2 Nov 2007 09:16:57 +0000 (09:16 +0000)]
Merge with ia64/xen-unstable.hg

17 years agoFix use-after-free in xenconsoled.
Keir Fraser [Thu, 1 Nov 2007 16:34:43 +0000 (16:34 +0000)]
Fix use-after-free in xenconsoled.

shutdown_domain() MUST NOT call cleanup_domain(), just flagging them
as dead is enough.  cleanup_domains() for dead domains is called by
the main loop in handle_io() in a safe way already.

shutdown_domain() calling cleanup_domain() too leads struct domain
being accessed after freeing and to a double-free.

Fixed by simply dropping the cleanup_domain() call and by making the
functions called by the main loop in handle_io() ignore dead domains.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
17 years agoioemu: ioemu portion of buffered-io fix.
Keir Fraser [Thu, 1 Nov 2007 16:34:20 +0000 (16:34 +0000)]
ioemu: ioemu portion of buffered-io fix.
Signed-off-by: Robert Phillips <rphillips@virtualiron.com>
Signed-off-by: Ben Guthro <bguthro@virtualiron.com>
17 years ago[IA64] Add support for 4 & 8 byte buffered io
Alex Williamson [Thu, 1 Nov 2007 16:30:12 +0000 (10:30 -0600)]
[IA64] Add support for 4 & 8 byte buffered io

The data structure handles it better now.

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
17 years agox86: Fix various problems with debug-register handling.
Keir Fraser [Thu, 1 Nov 2007 16:16:25 +0000 (16:16 +0000)]
x86: Fix various problems with debug-register handling.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
17 years agomerge with xen-unstable.hg (staging)
Alex Williamson [Thu, 1 Nov 2007 15:07:16 +0000 (09:07 -0600)]
merge with xen-unstable.hg (staging)

17 years ago[IA64] Implement some PAL procedures
Alex Williamson [Thu, 1 Nov 2007 15:00:27 +0000 (09:00 -0600)]
[IA64] Implement some PAL procedures

This patch implements:
 - PAL_PREFETCH_VISIBILITY
 - PAL_MC_DRAIN
 - PAL_BRAND_INFO
 - PAL_GET_PSTATE
 - PAL_CACHE_SHARED_INFO

These PAL procedures are necessary for Windows 2008.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
17 years ago[IA64] Update pal.h and pal.S to linux-2.6.21
Alex Williamson [Thu, 1 Nov 2007 14:55:01 +0000 (08:55 -0600)]
[IA64] Update pal.h and pal.S to linux-2.6.21

Current pal.h is based on linux-2.6.13 and
some procedures are missing. (e.g. PAL_GET_PSTATE)

This patch just updates pal.h and pal.S to linux-2.6.21.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
17 years ago[IA64] Fix ia64_sal_get_state_info() emulation bug
Alex Williamson [Thu, 1 Nov 2007 14:50:03 +0000 (08:50 -0600)]
[IA64] Fix ia64_sal_get_state_info() emulation bug

It is possible to double-free the sal queue entry when multiple
ia64_sal_get_state_info() from Dom0 are called simultaniously.
In the worst case, the kernel might panic.

Signed-off-by: Kazuhiro Suzuki <kaz@jp.fujitsu.com>
17 years agox86/64: Fix the build.
Keir Fraser [Thu, 1 Nov 2007 10:56:56 +0000 (10:56 +0000)]
x86/64: Fix the build.
Signed-off-by: Keir Fraser <keir@xensource.com>
17 years agox86, hvm: Fix stdvga and buffered-io code.
Keir Fraser [Thu, 1 Nov 2007 09:48:14 +0000 (09:48 +0000)]
x86, hvm: Fix stdvga and buffered-io code.

Corrected a bug in the stdvga code where it did not properly handle 32
bit operations. The buf_ioreq_t can now store 32 bits of data.

Signed-off-by: Robert Phillips <rphillips@virtualiron.com>
Signed-off-by: Ben Guthro <bguthro@virtualiron.com>
17 years agoacm, xend: Follow linked files.
Keir Fraser [Thu, 1 Nov 2007 09:37:47 +0000 (09:37 +0000)]
acm, xend: Follow linked files.
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
17 years agoxend: Fix missing boolean xend config options
Keir Fraser [Thu, 1 Nov 2007 09:36:46 +0000 (09:36 +0000)]
xend: Fix missing boolean xend config options

If a boolean option was missing in the SCF database, we weren't
processing the default value correctly.

Signed-off-by: John Levon <john.levon@sun.com>
17 years agoPV-on-HVM: Define BLOCKING_NOTIFIER_HEAD macro for old Linux kernels.
Keir Fraser [Thu, 1 Nov 2007 09:33:56 +0000 (09:33 +0000)]
PV-on-HVM: Define BLOCKING_NOTIFIER_HEAD macro for old Linux kernels.
Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
17 years agoxenperf: Fix typo in mlock() invocation.
Keir Fraser [Wed, 31 Oct 2007 16:21:18 +0000 (16:21 +0000)]
xenperf: Fix typo in mlock() invocation.
Signed-off-by: Stephen Wilson <stephen.wilson@amd.com>
17 years agoia64: Fix the build after guest_physmap_add_page() changes.
Keir Fraser [Wed, 31 Oct 2007 15:57:03 +0000 (15:57 +0000)]
ia64: Fix the build after guest_physmap_add_page() changes.
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
17 years agohvm: Fail attempts to add pages to guest pseudophys memory map above
Keir Fraser [Wed, 31 Oct 2007 10:07:42 +0000 (10:07 +0000)]
hvm: Fail attempts to add pages to guest pseudophys memory map above
4GB when running with AMD NPT on PAE host.
From: Wei Huang <Wei.Huang2@amd.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
17 years agox86, hvm: Allow HAP to be enabled on 32-bit Xen (but still disabled by default).
Keir Fraser [Wed, 31 Oct 2007 09:36:45 +0000 (09:36 +0000)]
x86, hvm: Allow HAP to be enabled on 32-bit Xen (but still disabled by default).

HAP remains disabled on 32-bit Xen by default because AMD NPT
restrictions mean that guests are restricted to a 4GB pseudophysical
memory map with AMD NPT on 32-bit host.

Signed-off-by: Wei Huang <wei.huang2@amd.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
17 years agox86, hvm: Fix 'no_missed_tick_accoutning' timer mode.
Keir Fraser [Wed, 31 Oct 2007 09:14:49 +0000 (09:14 +0000)]
x86, hvm: Fix 'no_missed_tick_accoutning' timer mode.
From: Haitao Shan <haitao.shan@intel.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
17 years agomerge with xen-unstable.hg (staging)
Alex Williamson [Tue, 30 Oct 2007 21:34:44 +0000 (15:34 -0600)]
merge with xen-unstable.hg (staging)

17 years ago[IA64] Make Xen relocatable
Alex Williamson [Tue, 30 Oct 2007 17:33:55 +0000 (11:33 -0600)]
[IA64] Make Xen relocatable

1. Put xenheap at 0xf400000004000000, then xenheap doesn't
   overlap with identity mapping.
2. Xen itself can be relocated by OS loader if there is no
   low memory in platform.
3. Use another DTR for mapping xenheap

Signed-off-by: Anthony Xu <anthony.xu@intel.com>
17 years ago[IA64] Simplify emulate_io_inst
Alex Williamson [Tue, 30 Oct 2007 17:21:23 +0000 (11:21 -0600)]
[IA64] Simplify emulate_io_inst

Simplify emulate_io_inst: no more per insn memory access.
So a breakpoint/debug event can be put at a single place.

Signed-off-by: Tristan Gingold <tgingold@free.fr>
17 years ago[IA64] Increase NITRS/NDTRS to 12
Alex Williamson [Tue, 30 Oct 2007 17:17:28 +0000 (11:17 -0600)]
[IA64] Increase NITRS/NDTRS to 12

Bump NITRS/NDTRS to 12.
(VMS needs at least 9 DTRS).

Signed-off-by: Tristan Gingold <tgingold@free.fr>
17 years ago[IA64] xenitp: typo fix
Alex Williamson [Tue, 30 Oct 2007 17:15:23 +0000 (11:15 -0600)]
[IA64] xenitp: typo fix

Signed-off-by: Tristan Gingold <tgingold@free.fr>
17 years ago[IA64] Enable dbr for VTi domain
Alex Williamson [Tue, 30 Oct 2007 17:14:21 +0000 (11:14 -0600)]
[IA64] Enable dbr for VTi domain

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
17 years agoia64: Fix after stdvga performance changes to bufioreq struct.
Keir Fraser [Tue, 30 Oct 2007 16:25:58 +0000 (16:25 +0000)]
ia64: Fix after stdvga performance changes to bufioreq struct.
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
17 years agox86, hvm: Flush local TLB after any change to linear pagetable mapping.
Keir Fraser [Tue, 30 Oct 2007 16:15:17 +0000 (16:15 +0000)]
x86, hvm: Flush local TLB after any change to linear pagetable mapping.

This was not needed when vmenter/vmexit always had the side effect of
flushing host TLBs.

But, with SVM ASIDs, it is possible to:
 (1) Update CR3 update,
 (2) vmenter the guest, and
 (3) and vmexit due to a page fault
all without an intervening host TLB flush.

Then the page fault code could use the linear pagetable
to read a top-level shadow page table entry.

But, without this change, it would fetch the wrong value
due to a stale TLB.

Signed-off-by: Robert Phillips <rphillips@virtualiron.com>
Signed-off-by: Ben Guthro <bguthro@virtualiron.com>
17 years agox86, hvm: New timer mode 'no missed-tick accounting'.
Keir Fraser [Tue, 30 Oct 2007 16:11:47 +0000 (16:11 +0000)]
x86, hvm: New timer mode 'no missed-tick accounting'.
From: Haitao Shan <haitao.shan@intel.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
17 years agoRefactor buildconfigs/mk.* to make the common rules separate from the
Ian Campbell [Tue, 30 Oct 2007 16:02:33 +0000 (16:02 +0000)]
Refactor buildconfigs/mk.* to make the common rules separate from the
-xen specific configuration.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
17 years agoALLOW_INTERFACE_MISMATCH defaults to "y" so don't specify it
Ian Campbell [Tue, 30 Oct 2007 16:01:07 +0000 (16:01 +0000)]
ALLOW_INTERFACE_MISMATCH defaults to "y" so don't specify it
everywhere.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
17 years agoAlways use ketchup for tarball sources, since the only non-user was
Ian Campbell [Tue, 30 Oct 2007 16:01:07 +0000 (16:01 +0000)]
Always use ketchup for tarball sources, since the only non-user was
the paravirt tree.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
17 years agoRemove the linux-2.6-paravirt build target since it is obsolete now the code is
Ian Campbell [Tue, 30 Oct 2007 16:01:07 +0000 (16:01 +0000)]
Remove the linux-2.6-paravirt build target since it is obsolete now the code is
upstream.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
17 years agox86: cache current vcpu in some trap-handling functions.
Keir Fraser [Tue, 30 Oct 2007 11:05:36 +0000 (11:05 +0000)]
x86: cache current vcpu in some trap-handling functions.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
17 years agovt-d: Do dpci eoi outside of irq_lock.
Keir Fraser [Tue, 30 Oct 2007 10:39:52 +0000 (10:39 +0000)]
vt-d: Do dpci eoi outside of irq_lock.

Deadlock may occur if do hvm_dpci_eoi() inside of irq_lock on MP
platform. For example, there are two physical cpus. If interrupt is
injected on cpu0, but vcpu is migrated to cpu1 and it does eoi inside
of irq_lock, then IPI will be issued to cpu0. At the same time, cpu0
may have disabled irq and is acquiring the same irq_lock. In addition,
current code cannot guarantee do hvm_dpci_eoi() inside of irq_lock
when timeout. This patch does hvm_dpci_eoi() outside of irq_lock, and
solves above problems.

Signed-off-by: Xiaohui Xin <xiaohui.xin@intel.com>
Signed-off-by: Weidong Han <weidong.han@intel.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
17 years agoUpdate README file for Xen 3.2, and add tboot makefile targets and
Keir Fraser [Tue, 30 Oct 2007 10:17:40 +0000 (10:17 +0000)]
Update README file for Xen 3.2, and add tboot makefile targets and
readme decsription.
Signed-off-by: Keir Fraser <keir@xensource.com>
17 years agoIntel(R) Trusted Execution Technology (Intel(R) TXT) support for Xen.
Keir Fraser [Tue, 30 Oct 2007 10:13:43 +0000 (10:13 +0000)]
Intel(R) Trusted Execution Technology (Intel(R) TXT) support for Xen.
Signed-off-by: Joseph Cihula <joseph.cihula@intel.com>
17 years agoacm, xm: Propagate error codes.
Keir Fraser [Tue, 30 Oct 2007 09:33:49 +0000 (09:33 +0000)]
acm, xm: Propagate error codes.

Fix propagation of error codes to the shell in some of the security
related xm commands.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
17 years agoqemu vnc auth 4/4: XenD config for VNC TLS protocol
Keir Fraser [Tue, 30 Oct 2007 09:32:10 +0000 (09:32 +0000)]
qemu vnc auth 4/4: XenD config for VNC TLS protocol

This patch adds support to XenD for configuring the previously added
TLS encryption and x509 certificate validation. At this time I have
only enabled this config to be done system-wide via
/etc/xen/xend-config.sxp. Since it requires the admin to add
certificates on the local FS, there's not much point in making it per
VM. The x509 certificates are located in /etc/xen/vnc. Since this
requires a special VNC client program (GTK-VNC,
virt-viewer/virt-manager or VeNCrypt viewer) the use of TLS is
disabled by default. Admins can enable it if they are using a suitable
client.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
17 years agoqemu vnc auth 3/4: Add VNC auth support from upstream QEMU
Keir Fraser [Tue, 30 Oct 2007 09:30:49 +0000 (09:30 +0000)]
qemu vnc auth 3/4: Add VNC auth support from upstream QEMU

This patch adds in the upstream QEMU VNC authentication code. This
spports the previous VNC password auth scheme, as well as the VeNCrypt
protocol extension. The latter allows for performing a TLS handshake,
and client verification of the server identify using x509
certificates. It is also possible for the server to request a client
certificate and validate that as a simple auth scheme. The code
depends on GNU TLS for SSL APIs, and the configure script will
auto-detect this.

The image.py code is changed to  deal with the new syntax for the -vnc
option.  In particular password authentication is now enabled by
giving the 'password' flag,

eg -vnc 0.0.0:1,password

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
17 years agoqemu vnc auth 2/4: Revert current VNC auth support
Keir Fraser [Tue, 30 Oct 2007 09:24:17 +0000 (09:24 +0000)]
qemu vnc auth 2/4: Revert current VNC auth support

This patch reverts the current Xen specific implementation of VNC
authentication from the QEMU code. This is basically reverting
11840:02506a744315. The idea here is to get the VNC code back to more
closely match upstream QEMU, before applying the upstream auth
patches.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
17 years agoqemu vnc auth 1/4: QEMU event handler bug fix
Keir Fraser [Tue, 30 Oct 2007 09:22:27 +0000 (09:22 +0000)]
qemu vnc auth 1/4: QEMU event handler bug fix

This patch pulls in an upstream QEMU fix for dealing with a problem in
the event dispatcher where a write callback gets unregistered while a
write event is pending from poll. Without this the QEMU process with
deference a NULL pointer and crash.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
17 years agoxend: Reduce xenstore transactions when listing domains
Keir Fraser [Tue, 30 Oct 2007 09:19:43 +0000 (09:19 +0000)]
xend: Reduce xenstore transactions when listing domains

In summary, this allows a xenstore transaction object to be passed
around the various device controllers, so that they don't have to do
lots of singleton transactions. Transactions have very heavy I/O
impact from xenstored so reducing their number is important.

When running 3 guests, this patch reduces the impact of 'xm list
--long' from 176 transactions, scaling O(n) with guests, to 26
transactions with O(1) scaling.

I have previously attempted to also address the same issue with 'xm
create' but that's much harder since the device front/back handshake
requires that XenD use a number of small transactions. So i've not
changed anything here.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
17 years agox86: allow pv guests to disable TSC for applications
Keir Fraser [Mon, 29 Oct 2007 16:49:02 +0000 (16:49 +0000)]
x86: allow pv guests to disable TSC for applications

Linux, under CONFIG_SECCOMP, has been capable of hiding the TSC from
processes for quite a while. This patch enables this to actually work
for pv kernels, by allowing them to control CR4.TSD (and, as a simple
thing to do at the same time, CR4.DE).

Applies cleanly only on top of the previously submitted debug register
handling patch.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Also clean up CR4 and EFER handling, and hack-n-slash header file
inclusion madness to get the tree building again.

Signed-off-by: Keir Fraser <keir@xensource.com>
17 years agox86: Remove dead code from arch_get_info_guest().
Keir Fraser [Mon, 29 Oct 2007 15:05:27 +0000 (15:05 +0000)]
x86: Remove dead code from arch_get_info_guest().
Signed-off-by: Keir Fraser <keir@xensource.com>
17 years agoxenconsoled: Rate-limit activity caused by each domU.
Keir Fraser [Mon, 29 Oct 2007 14:43:19 +0000 (14:43 +0000)]
xenconsoled: Rate-limit activity caused by each domU.
Allow each domU to fire its event channel at most 30 times every 200ms.
Signed-off by: Daniel P. Berrange <berrange@redhat.com>

17 years agoAllow incremental access to hypervisor console log.
Keir Fraser [Mon, 29 Oct 2007 12:56:27 +0000 (12:56 +0000)]
Allow incremental access to hypervisor console log.
Signed-off-by: Keir Fraser <keir@xensource.com>
17 years agox86: Clean up NMI delivery logic. Allow set_trap_table vector 2 to be
Keir Fraser [Mon, 29 Oct 2007 09:49:39 +0000 (09:49 +0000)]
x86: Clean up NMI delivery logic. Allow set_trap_table vector 2 to be
specified as not disabling event delivery, just like any other vector.
Signed-off-by: Keir Fraser <keir@xensource.com>
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>