]> xenbits.xensource.com Git - people/pauldu/xen.git/log
people/pauldu/xen.git
16 years agox86, hvm: Expose host core/HT topology to HVM guests.
Keir Fraser [Tue, 30 Sep 2008 09:14:54 +0000 (10:14 +0100)]
x86, hvm: Expose host core/HT topology to HVM guests.

Based on an initial patch by Nitin Kamble <nitin.a.kamble@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agohvm: Remove extboot from virtual firmware.
Keir Fraser [Mon, 29 Sep 2008 14:45:38 +0000 (15:45 +0100)]
hvm: Remove extboot from virtual firmware.

Device model is not present in external qemu repository, and
functionality was never exposed through the toolstack.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agoxc_save: use correct size when unmapping live p2m.
Keir Fraser [Mon, 29 Sep 2008 10:00:29 +0000 (11:00 +0100)]
xc_save: use correct size when unmapping live p2m.

Otherwise we unmap a larger region than was mapped when saving 32 bit
guest from 64 bit tools, leading to badness.

The equivalent change was made to the restore code in
18329:ca7dd77d5365

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
16 years agodomctl: Fix the wrong return values when xsm_xxx() returns 0
Keir Fraser [Mon, 29 Sep 2008 08:43:05 +0000 (09:43 +0100)]
domctl: Fix the wrong return values when xsm_xxx() returns 0

In 18423: 44f039c4aee4,  if xsm_xxx() returns 0, there are some places
where the return value would be incorrect. The patch fixes them.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
16 years agoFix 32pae build: ld -> PRI64.
Keir Fraser [Sun, 28 Sep 2008 15:53:14 +0000 (16:53 +0100)]
Fix 32pae build: ld -> PRI64.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
16 years agoCPUIDLE: Initialize timer broadcast mechanism for C2
Keir Fraser [Fri, 26 Sep 2008 16:12:56 +0000 (17:12 +0100)]
CPUIDLE: Initialize timer broadcast mechanism for C2

Without this patch, while running on platforms on which the deepest
C-state is C2, acpi_processor_idle fns will call into NULL
function. This has been the case since 18518:e61c7833dc9d8.

Signed-off-by: Wei Gang <gang.wei@intel.com>
16 years agohvm: Default timer_mode=1 (do not delay virtual time for missed
Keir Fraser [Fri, 26 Sep 2008 16:09:36 +0000 (17:09 +0100)]
hvm: Default timer_mode=1 (do not delay virtual time for missed
ticks). Most guests prefer this mode compared with screwing with
progress of virtual time.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agox86 shadow: Add FreeBSD mappings guest heuristics.
Keir Fraser [Fri, 26 Sep 2008 14:33:51 +0000 (15:33 +0100)]
x86 shadow: Add FreeBSD mappings guest heuristics.

This patch adds FreeBSD mappings heuristics to allow faster page
promotion.

Also, remove code for unsync va heuristic, not needed anymore.

Signed-off-by: Gianluca Guida <gianluca.guida@eu.citrix.com>
16 years agox86 and ia64: move cpufreq notify code to commone place
Keir Fraser [Fri, 26 Sep 2008 13:05:41 +0000 (14:05 +0100)]
x86 and ia64: move cpufreq notify code to commone place

This patch move the cpufreq notify code from x86 specfic place to
common place, since it can be used by both x86 and ia64 cpufreq
driver.

Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
Signed-off-by: Yu Ke <ke.yu@intel.com>
16 years agoX86 and IA64: Update cpufreq statistic logic for supporting both x86
Keir Fraser [Fri, 26 Sep 2008 13:05:09 +0000 (14:05 +0100)]
X86 and IA64: Update cpufreq statistic logic for supporting both x86
and ia64

Signed-off-by: Yu, Ke <ke.yu@intel.com>
Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
16 years agoX86 and IA64: Rebase cpufreq logic for supporting both x86 and ia64
Keir Fraser [Fri, 26 Sep 2008 13:04:38 +0000 (14:04 +0100)]
X86 and IA64: Rebase cpufreq logic for supporting both x86 and ia64
arch

Rebase cpufreq logic for supporting both x86 and ia64 arch:
1. move cpufreq arch-independent logic into common dir
(xen/drivers/acpi
and xen/drivers/cpufreq dir);
2. leave cpufreq x86-dependent logic at xen/arch/x86/acpi/cpufreq dir;

Signed-off-by: Yu, Ke <ke.yu@intel.com>
Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
16 years agovtd: Fix check for interrupt remapping of ioapic RTE
Keir Fraser [Fri, 26 Sep 2008 10:12:29 +0000 (11:12 +0100)]
vtd: Fix check for interrupt remapping of ioapic RTE

For IOAPIC interrupt remapping, it only needs to remap ioapci RTE,
should not remap other IOAPIC registers, which are IOAPIC ID, VERSION
and Arbitration ID. This patch adds the check for this and only remap
ioapci RTE.

Signed-off-by: Anthony Xu <anthony.xu@intel.com>
Signed-off-by: Weidong Han <weidong.han@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agox86, hvm: Remove warning on emulated write to read-only page.
Keir Fraser [Thu, 25 Sep 2008 16:41:29 +0000 (17:41 +0100)]
x86, hvm: Remove warning on emulated write to read-only page.

The bugs in this area seem to have been fixed now, and gPXE makes
legitimate best-effort attempts to modify its embedded static data.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agox86: Clean up and fix 18539:31f09a5e24cf8
Keir Fraser [Thu, 25 Sep 2008 13:37:52 +0000 (14:37 +0100)]
x86: Clean up and fix 18539:31f09a5e24cf8
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agoxm: Fix xm start -c / --vncviewer
Keir Fraser [Thu, 25 Sep 2008 12:07:43 +0000 (13:07 +0100)]
xm: Fix xm start -c / --vncviewer

In xm start the --vncviewer option has no effect, instead -c tries to
both connect to the console and start vncviewer. Additionally, to
start vncviewer it uses the domid variable which is only defined a few
lines later. Thus xm start -c doesn't work at all.

This patch fixes both problems.

Signed-off-by: Kevin Wolf <kwolf@suse.de>
16 years agohvm firmware: Replace etherboot with modern gPXE ROMs.
Keir Fraser [Thu, 25 Sep 2008 11:09:10 +0000 (12:09 +0100)]
hvm firmware: Replace etherboot with modern gPXE ROMs.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agox86: Fix guest_physmap_add_entry checks
Keir Fraser [Thu, 25 Sep 2008 09:26:08 +0000 (10:26 +0100)]
x86: Fix guest_physmap_add_entry checks

guest_physmap_add_entry() checks to see if the given mfn and gpfn
range in the p2m and m2p tables is already mapped before overwriting
the maps, and attempts to do something reasonable so that we don't
have any "dangling" pointers.

Unfortunately, these checks got broken when the page_order argument
was added.  Each individual p2m and m2p entry needs to be checked, not
just the first page in a page order.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
16 years agox86: Add xenpm utility to list CPU power info.
Keir Fraser [Thu, 25 Sep 2008 09:21:40 +0000 (10:21 +0100)]
x86: Add xenpm utility to list CPU power info.

Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agox86 pmstat: Fix get_pm_info hypercall argument checking.
Keir Fraser [Thu, 25 Sep 2008 09:12:17 +0000 (10:12 +0100)]
x86 pmstat: Fix get_pm_info hypercall argument checking.

Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agox2apic: Clean up send_IPI_mask_x2apic() and add a memory barrier.
Keir Fraser [Thu, 25 Sep 2008 09:03:04 +0000 (10:03 +0100)]
x2apic: Clean up send_IPI_mask_x2apic() and add a memory barrier.

The barrier is required to prevent the WRMSR from executing before the
processor has written synchronising data to be received by remote
CPUs.

At the same time remove needless wmb() from on_selected_cpus(). We now
assume send_IPI_mask() is a sufficient compiler and CPU memory
barrier.

Original patch by Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agoFix direct use of 'make' -> $(MAKE)
Keir Fraser [Wed, 24 Sep 2008 11:47:33 +0000 (12:47 +0100)]
Fix direct use of 'make' -> $(MAKE)
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
16 years agox86: Properly synchronise updates to pirq-to-vector mapping.
Keir Fraser [Wed, 24 Sep 2008 11:36:55 +0000 (12:36 +0100)]
x86: Properly synchronise updates to pirq-to-vector mapping.

Per-domain irq mappings are now protected by d->evtchn_lock and by the
per-vector irq_desc lock.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agox86: change _PAGE_GNTTAB
Keir Fraser [Wed, 24 Sep 2008 09:23:51 +0000 (10:23 +0100)]
x86: change _PAGE_GNTTAB

Since Linux started to use one of the 3 low available bits, _PAGE_IO
needed to be moved to a different one. Not remembering about
_PAGE_GNTTAB in debug hypervisors, I ended up assigning it to the same
bit, which made the kernel fail on the debug hypervisor. However,
rather than fixing the kernel it seems more appropriate for the
hypervisor to stay away from these bits, not the least because its
definition was anyway accompanied by a warning that this may be
incompatible with certain OSes.

While obviously the hypervisor has to use some bit (and it's therefore
unavoidable that there's some risk of collision), using one of the
high available bits seems to be the better choice over using one of
the three low ones. Since in 32-bit mode these bits are reserved, the
patch disables the functionality here. The only reasonable alternative
I would see is to disable the functionality by default, but add a
command line option to specify which bit to use.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
16 years agox86/PCI-MSI: fix log messages
Keir Fraser [Wed, 24 Sep 2008 09:20:49 +0000 (10:20 +0100)]
x86/PCI-MSI: fix log messages

XENLOG_G_* should not be used in invocations of gdprintk().

Also change the wording in a few places and consistently print the
target domain. It remains questionable whether the code should be this
verbose in the first place, especially now that MSI is on by default.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
16 years agoia64: fix make install under tools/debugger/xenitp
Keir Fraser [Wed, 24 Sep 2008 09:19:07 +0000 (10:19 +0100)]
ia64: fix make install under tools/debugger/xenitp

This patch fixes the following error with make install under
the directory, tools/debugger/xenitp by checking whether
the variable is length zero string.

> # make install
> ../../../tools/cross-install -d -m0755 -p //usr/bin
> [ -z " xenitp" ] || ../../../tools/cross-install -d -m0755 -p
> //usr/lib/xen/bin
> ../../../tools/cross-install -d -m0755 -p //usr/share/man/man1
> ../../../tools/cross-install -d -m0755 -p //usr/share/man/man8
> ../../../tools/cross-install -m0755 -p   //usr/bin
> install: too few arguments
> Try `install --help' for more information.
> make: *** [install] Error 1

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
16 years agominios: blkfront should set protocol node
Keir Fraser [Wed, 24 Sep 2008 09:18:20 +0000 (10:18 +0100)]
minios: blkfront should set protocol node

From: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agoxm docs: Added new,delete,dump-core,resume,suspend,uptime and fixed others
Keir Fraser [Wed, 24 Sep 2008 09:17:18 +0000 (10:17 +0100)]
xm docs: Added new,delete,dump-core,resume,suspend,uptime and fixed others

Signed-off-by: Bill Rieske <brieske@novell.com>
16 years agohvm, save/restore: Skip page batches which contain no valid pages.
Keir Fraser [Tue, 23 Sep 2008 16:11:33 +0000 (17:11 +0100)]
hvm, save/restore: Skip page batches which contain no valid pages.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agoacm, xend: Catch bad vlan identifiers
Keir Fraser [Tue, 23 Sep 2008 11:30:42 +0000 (12:30 +0100)]
acm, xend: Catch bad vlan identifiers

Add code to intercept badly formatted VLAN identifiers or
those that are out of range.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
16 years agolibxc: Wrapper functions for cpu online/offline
Keir Fraser [Mon, 22 Sep 2008 15:10:25 +0000 (16:10 +0100)]
libxc: Wrapper functions for cpu online/offline

Signed-off-by: Shan Haitao <haitao.shan@intel.com>
16 years agox86: Add sysctl for cpu online/offline
Keir Fraser [Mon, 22 Sep 2008 15:07:04 +0000 (16:07 +0100)]
x86: Add sysctl for cpu online/offline

Signed-off-by: Shan Haitao <haitao.shan@intel.com>
16 years agox86: fix powernow
Keir Fraser [Mon, 22 Sep 2008 14:56:12 +0000 (15:56 +0100)]
x86: fix powernow

... by allocating the necessary cpufreq_policy structures.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
16 years agoAdd debug key 'e' for event channel information
Keir Fraser [Mon, 22 Sep 2008 14:50:59 +0000 (15:50 +0100)]
Add debug key 'e' for event channel information

Signed-off-by: Jan Beulich <jbeulich@novell.com>
16 years agoacpi: mark several more items __init/__initdata
Keir Fraser [Mon, 22 Sep 2008 14:33:42 +0000 (15:33 +0100)]
acpi: mark several more items __init/__initdata

Remove unused acpi_reallocate_root_table()

Signed-off-by: Jan Beulich <jbeulich@novell.com>
16 years agox86/cpufreq: don't use static array for large per-CPU data structures
Keir Fraser [Mon, 22 Sep 2008 14:24:03 +0000 (15:24 +0100)]
x86/cpufreq: don't use static array for large per-CPU data structures

... as this is rather wasteful when Xen is configured to support many
CPUs but is running on systems having only a few.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
16 years agodomctl: don't allow certain operations on Dom0
Keir Fraser [Mon, 22 Sep 2008 14:20:25 +0000 (15:20 +0100)]
domctl: don't allow certain operations on Dom0

XEN_DOMCTL_setvcpucontext, XEN_DOMCTL_max_vcpus, and
XEN_DOMCTL_setdebugging don't seem to allow Dom0 as the subject domain
(based on the criteria that they pause that domain in order to do
their job).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agovsprintf: Better size_t input checking, and fix return values of
Keir Fraser [Mon, 22 Sep 2008 14:15:19 +0000 (15:15 +0100)]
vsprintf: Better size_t input checking, and fix return values of
[v]scnprintf() when size <= 0.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agoFix misc issues related to allowing support of more CPUs
Keir Fraser [Mon, 22 Sep 2008 13:37:31 +0000 (14:37 +0100)]
Fix misc issues related to allowing support of more CPUs

This mainly means removing stack variables that (should) depend on
NR_CPUS (other than cpumask_t ones) and adjusting certain array sizes.

There's at least one open tools issue: The 'xm vcpu-pin' path assumes
a maximum of 64 CPU-s in many places.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
16 years agoxentop: Fix display of long domain names.
Keir Fraser [Mon, 22 Sep 2008 13:04:27 +0000 (14:04 +0100)]
xentop: Fix display of long domain names.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agoi386: make double fault TSS per-CPU
Keir Fraser [Mon, 22 Sep 2008 13:00:24 +0000 (14:00 +0100)]
i386: make double fault TSS per-CPU

As a follow-up to the per-CPU-GDT patch, this also makes the double
fault TSS (and the associated stack) per-CPU.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
16 years agox86: make GDT per-CPU
Keir Fraser [Mon, 22 Sep 2008 12:46:57 +0000 (13:46 +0100)]
x86: make GDT per-CPU

The major issue with supporting a significantly larger number of
physical CPUs appears to be the use of per-CPU GDT entries - at
present, x86-64 could support only up to 126 CPUs (with code changes
to also use the top-most GDT page, that would be 254). Instead of
trying to go with incremental steps here, by converting the GDT itself
to be per-CPU, limitations in that respect go away entirely.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
16 years agox86,amd,microcode: fix hypercall return code
Keir Fraser [Mon, 22 Sep 2008 12:41:07 +0000 (13:41 +0100)]
x86,amd,microcode: fix hypercall return code

Make the hypercall return failure if the microcode didn't apply.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
16 years agoCPUIDLE: Handle C2 LAPIC timer & TSC stop
Keir Fraser [Mon, 22 Sep 2008 10:24:02 +0000 (11:24 +0100)]
CPUIDLE: Handle C2 LAPIC timer & TSC stop

ACPI C2 is quite possible mapped to CPU C3 or deeper state, so
thinking from worst cases, enable C3 like entry/exit handling for C2
by default. Option 'lapic_timer_c2_ok' can be used to select simple C2
entry/exit only if the user make sure that LAPIC tmr & TSC will not be
stop during C2.

Signed-off-by: Wei Gang <gang.wei@intel.com>
16 years agoCPUIDLE: Support multiple C3 states
Keir Fraser [Mon, 22 Sep 2008 10:21:31 +0000 (11:21 +0100)]
CPUIDLE: Support multiple C3 states

There may be multiple ACPI C3 states reported by BIOS. Those C3 states
may be different on latency & power. So made some modification to
support this case.

Signed-off-by: Wei Gang <gang.wei@intel.com>
16 years agoxenctx: fix xenctx --all option on x86
Keir Fraser [Mon, 22 Sep 2008 10:16:56 +0000 (11:16 +0100)]
xenctx: fix xenctx --all option on x86

Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
16 years agoxend: Refactor vmmetrics destruction.
Keir Fraser [Mon, 22 Sep 2008 10:15:39 +0000 (11:15 +0100)]
xend: Refactor vmmetrics destruction.

Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
16 years agopvgrub: Allow to work with a partitionless virtual disc.
Keir Fraser [Thu, 18 Sep 2008 09:43:08 +0000 (10:43 +0100)]
pvgrub: Allow to work with a partitionless virtual disc.

From: Bastian Blank <bastian@waldi.eu.org>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agoxm list: Return unique exit code for non-existent domain
Keir Fraser [Thu, 18 Sep 2008 09:41:41 +0000 (10:41 +0100)]
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>
16 years agox86, amd, hvm: pass through one more cpuid cache description leaf
Keir Fraser [Thu, 18 Sep 2008 09:39:53 +0000 (10:39 +0100)]
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>
16 years agoRemove internal tools/ioemu tree.
Keir Fraser [Thu, 18 Sep 2008 09:32:40 +0000 (10:32 +0100)]
Remove internal tools/ioemu tree.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agoxc_save/xc_restore: Fix wrong data type
Keir Fraser [Wed, 17 Sep 2008 13:16:02 +0000 (14:16 +0100)]
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>
16 years agox86: Allow continue_hypercall_on_cpu() to be called from within an
Keir Fraser [Wed, 17 Sep 2008 13:13:10 +0000 (14:13 +0100)]
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>
16 years agoxm: Remove obsolete mechanism using vncviewer -listen
Keir Fraser [Wed, 17 Sep 2008 12:11:40 +0000 (13:11 +0100)]
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>
16 years agomini-os: adding some missing posix function declarations
Keir Fraser [Wed, 17 Sep 2008 12:10:36 +0000 (13:10 +0100)]
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>
16 years agox86-64: enforce memory limits imposed by virtual memory layout
Keir Fraser [Tue, 16 Sep 2008 14:57:22 +0000 (15:57 +0100)]
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>
16 years agox86: also fix powernow's dom_mask
Keir Fraser [Tue, 16 Sep 2008 14:54:17 +0000 (15:54 +0100)]
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>
16 years agoMerge with IA64 tree.
Keir Fraser [Tue, 16 Sep 2008 12:53:47 +0000 (13:53 +0100)]
Merge with IA64 tree.

16 years agox86, microcode: Free microcode_info struct at end of hypercall.
Keir Fraser [Tue, 16 Sep 2008 12:49:16 +0000 (13:49 +0100)]
x86, microcode: Free microcode_info struct at end of hypercall.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agox86, microcode: Do not run microcode update in IRQ context.
Keir Fraser [Tue, 16 Sep 2008 12:40:59 +0000 (13:40 +0100)]
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>
16 years agomerge with xen-unstable.hg
Isaku Yamahata [Tue, 16 Sep 2008 12:25:30 +0000 (21:25 +0900)]
merge with xen-unstable.hg

16 years agox86: Simplify RDMSR pass-through emulation for certain
Keir Fraser [Tue, 16 Sep 2008 12:18:32 +0000 (13:18 +0100)]
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>
16 years agox86, microcode: More code cleanups.
Keir Fraser [Tue, 16 Sep 2008 12:09:04 +0000 (13:09 +0100)]
x86, microcode: More code cleanups.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agostubdom/ioemu link farm creation fixes
Keir Fraser [Tue, 16 Sep 2008 11:44:26 +0000 (12:44 +0100)]
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>
16 years agox86, microcode: Clean up for Xen coding style, and disable for now
Keir Fraser [Tue, 16 Sep 2008 10:26:19 +0000 (11:26 +0100)]
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>
16 years agoAvoid parallel invocation of git for ioemu-remote.
Keir Fraser [Mon, 15 Sep 2008 16:10:43 +0000 (17:10 +0100)]
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>
16 years agox86: Fix 32-bit build after AMD microcode update patch.
Keir Fraser [Mon, 15 Sep 2008 14:44:38 +0000 (15:44 +0100)]
x86: Fix 32-bit build after AMD microcode update patch.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agoxsm: dummy module - implement missing stub
Keir Fraser [Mon, 15 Sep 2008 10:36:20 +0000 (11:36 +0100)]
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>
16 years agovtd: minor edge case memory leak
Keir Fraser [Mon, 15 Sep 2008 10:35:20 +0000 (11:35 +0100)]
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>
16 years agox86, shadow: Allow removing writable mappings from splintered page tables.
Keir Fraser [Mon, 15 Sep 2008 10:34:42 +0000 (11:34 +0100)]
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>
16 years agox86, shadow: Fix comment about Linux direct-map address.
Keir Fraser [Sat, 13 Sep 2008 07:15:26 +0000 (08:15 +0100)]
x86, shadow: Fix comment about Linux direct-map address.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agox86, shadow: Add new location of Linux direct-map to the places to
Keir Fraser [Fri, 12 Sep 2008 15:45:37 +0000 (16:45 +0100)]
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>
16 years agox86: microcode update support for AMD CPUs
Keir Fraser [Fri, 12 Sep 2008 13:18:13 +0000 (14:18 +0100)]
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>
16 years ago$(XEN_ROOT) absolutification fixes for ioemu-remote (incl stubdom)
Keir Fraser [Fri, 12 Sep 2008 12:15:36 +0000 (13:15 +0100)]
$(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>
16 years agoCheck the existence of serial port before using
Keir Fraser [Fri, 12 Sep 2008 10:43:47 +0000 (11:43 +0100)]
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>
16 years agostubdom: compile stubdom with qemu-remote
Keir Fraser [Fri, 12 Sep 2008 09:41:51 +0000 (10:41 +0100)]
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>
16 years agox86, cpu hotplug: flush softirq work when going offline
Keir Fraser [Fri, 12 Sep 2008 09:40:19 +0000 (10:40 +0100)]
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>
16 years agox86: Clean up cpufreq core logic
Keir Fraser [Fri, 12 Sep 2008 09:34:50 +0000 (10:34 +0100)]
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>
16 years agomerge with xen-unstable.hg
Isaku Yamahata [Fri, 12 Sep 2008 05:47:40 +0000 (14:47 +0900)]
merge with xen-unstable.hg

16 years ago[IA64] fix XENMEM_add_to_physmap with XENMAPSPACE_mfn
Isaku Yamahata [Fri, 12 Sep 2008 05:32:45 +0000 (14:32 +0900)]
[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>
16 years agoxenstore: Fix a memory leak in 'xs_is_domain_introduced'.
Keir Fraser [Thu, 11 Sep 2008 17:00:06 +0000 (18:00 +0100)]
xenstore: Fix a memory leak in 'xs_is_domain_introduced'.

Signed-off-by: Konrad Rzeszutek <konrad@virtualiron.com>
16 years agoACPI: Grant access of MSR_IA32_THERM_CONTROL MSR to dom0
Keir Fraser [Thu, 11 Sep 2008 15:51:13 +0000 (16:51 +0100)]
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>
16 years agoCPUIDLE: Disable APIC timer intr during C3 while force hpetbroadcast
Keir Fraser [Thu, 11 Sep 2008 15:50:04 +0000 (16:50 +0100)]
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>
16 years agox86, shadow: Fix some SHADOW_PRINTK() callers.
Keir Fraser [Thu, 11 Sep 2008 14:17:31 +0000 (15:17 +0100)]
x86, shadow: Fix some SHADOW_PRINTK() callers.
Signed-off-by: Yoshi Tamura <tamura.yoshiaki@lab.ntt.co.jp>
16 years agoxendomains script: A few bug fixes.
Keir Fraser [Thu, 11 Sep 2008 14:16:11 +0000 (15:16 +0100)]
xendomains script: A few bug fixes.

Contributed-by: Artur Linhart <AL.LINUX@bcpraha.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
16 years agox86: Support CPU hotplug offline.
Keir Fraser [Thu, 11 Sep 2008 14:06:22 +0000 (15:06 +0100)]
x86: Support CPU hotplug offline.

Signed-off-by: Shan Haitao <haitao.shan@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agoxm: domid casting bug
Keir Fraser [Thu, 11 Sep 2008 10:58:08 +0000 (11:58 +0100)]
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>
16 years agoxsm: XSM foreigndom usage bug
Keir Fraser [Thu, 11 Sep 2008 10:56:49 +0000 (11:56 +0100)]
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>
16 years agox86: Fix calibration rendezvous for cpu hotplug.
Keir Fraser [Wed, 10 Sep 2008 10:26:16 +0000 (11:26 +0100)]
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>
16 years agoCPUIDLE: Port Linux menu governor to replace the initial ladder governor
Keir Fraser [Wed, 10 Sep 2008 10:18:36 +0000 (11:18 +0100)]
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>
16 years agoCPUIDLE: Adjust Cx residency to contain Cx exit latency & overhead.
Keir Fraser [Wed, 10 Sep 2008 10:17:13 +0000 (11:17 +0100)]
CPUIDLE: Adjust Cx residency to contain Cx exit latency & overhead.

Signed-off-by: Wei Gang <gang.wei@intel.com>
16 years agoCPUIDLE: Avoid remnant LAPIC timer intr while force hpetbroadcast
Keir Fraser [Wed, 10 Sep 2008 10:16:26 +0000 (11:16 +0100)]
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>
16 years agoCPUIDLE: Avoid remnant HPET intr while force hpetbroadcast
Keir Fraser [Wed, 10 Sep 2008 10:09:08 +0000 (11:09 +0100)]
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>
16 years agovtd: Add a command line param to enable/disable pass-through feature
Keir Fraser [Wed, 10 Sep 2008 09:53:09 +0000 (10:53 +0100)]
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>
16 years agox86, xend: Fix processing of cpuid config parameters
Keir Fraser [Wed, 10 Sep 2008 09:51:48 +0000 (10:51 +0100)]
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>
16 years agox86: Remove MSI boot parameter -- now always on.
Keir Fraser [Wed, 10 Sep 2008 09:47:46 +0000 (10:47 +0100)]
x86: Remove MSI boot parameter -- now always on.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agox86: Do not permit 'AUTO_ASSIGN' parameter to PHYSDEVOP_alloc_irq_vector.
Keir Fraser [Tue, 9 Sep 2008 16:28:05 +0000 (17:28 +0100)]
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>
16 years agoxc_domain_save: Do not poll-wait for guest to shutdown -- it should
Keir Fraser [Tue, 9 Sep 2008 14:33:27 +0000 (15:33 +0100)]
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>
16 years agoSmall user manual fixes.
Keir Fraser [Tue, 9 Sep 2008 14:08:57 +0000 (15:08 +0100)]
Small user manual fixes.

From: Stephen Spector <stephen.spector@citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agoioemu: Fix bug in map cache
Keir Fraser [Tue, 9 Sep 2008 14:05:58 +0000 (15:05 +0100)]
ioemu: Fix bug in map cache

This small patch fixes an issue leading to a crash (segfault, although
with earlier changesets I was seeing sigbus - not sure what changed)
in qemu-dm when the following conditions occur:

1. A valid mapping for a bucket on a low address exists

2. Immediately after accessing memory mapped in this bucket, an access
occurs to a high (beyond assigned ram) address beyond the 1GB limit
for 32bit map cache wrapping around to the previous bucket's entry
number.

3. The next call to map cache again accesses the low address.

In this scenario, the guest mem for the low bucket has been unmapped
by the remap_bucket caused by 2., but because the valid_mapping
bit-test fails, map_cache returns before last_address_index has been
updated. The subsequent call to map_cache therefore never remaps the
low, valid bucket and instead returns a vaddr pointing to memory that
has failed to get mapped.

Signed-off-by: Trolle Selander <trolle.selander@eu.citrix.com>
16 years agoioemu: various fixes to 18394:dade7f0bdc8d
Keir Fraser [Tue, 9 Sep 2008 14:02:51 +0000 (15:02 +0100)]
ioemu: various fixes to 18394:dade7f0bdc8d

- fix ioemu segv with old firmware
  Without notifying ioemu of address, ioemu will segv.

- fix qemu-dm segv with malicous firmware
  If notifying ioemu more than once, ioemu will segv.

Usually such cases don't happen, but malicious guest can
do it intentionally.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>