xen.git
17 years agovmx:update DR6 on TRAP_debug VM exits.
Keir Fraser [Fri, 10 Oct 2008 09:06:49 +0000 (10:06 +0100)]
vmx:update DR6 on TRAP_debug VM exits.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
17 years agovt-d: Fix dma_set_pte_superpage
Keir Fraser [Fri, 10 Oct 2008 09:04:58 +0000 (10:04 +0100)]
vt-d: Fix dma_set_pte_superpage

Superpage bit is bit 7 in VT-d page table entry.

Signed-off-by: Weidong Han <weidong.han@intel.com>
17 years agoxend: Fix the detection of the upmost bridge in the python function find_parent().
Keir Fraser [Fri, 10 Oct 2008 09:03:28 +0000 (10:03 +0100)]
xend: Fix the detection of the upmost bridge in the python function find_parent().

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
17 years agocpufreq: remove unused variable cpu_count.
Keir Fraser [Fri, 10 Oct 2008 09:01:10 +0000 (10:01 +0100)]
cpufreq: remove unused variable cpu_count.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
17 years agoacpi/pmstat.c: refer to the array after range check.
Keir Fraser [Fri, 10 Oct 2008 09:00:54 +0000 (10:00 +0100)]
acpi/pmstat.c: refer to the array after range check.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
17 years ago[IA64] compile xenpm for ia64.
Keir Fraser [Fri, 10 Oct 2008 09:00:21 +0000 (10:00 +0100)]
[IA64] compile xenpm for ia64.

Now ia64 supports cpufreq, compile xenpm.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
17 years agohvmloader: smbios support for large memory guests
Keir Fraser [Thu, 9 Oct 2008 16:18:11 +0000 (17:18 +0100)]
hvmloader: smbios support for large memory guests

This reports more than one memory device if the memory for the guest
is larger than 16G.

Signed-off-by: Bill Rieske <brieske@novell.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agovtd: Make some pci access functions architecture independent.
Keir Fraser [Thu, 9 Oct 2008 11:47:31 +0000 (12:47 +0100)]
vtd: Make some pci access functions architecture independent.

Signed-off-by: Anthony Xu <anthony.xu@intel.com>
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
17 years agoRename evtchn_lock to event_lock, since it protects more than just
Keir Fraser [Thu, 9 Oct 2008 10:17:51 +0000 (11:17 +0100)]
Rename evtchn_lock to event_lock, since it protects more than just
event-channel state now.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoFix lock issue for hvm pass-through domain
Keir Fraser [Thu, 9 Oct 2008 10:14:52 +0000 (11:14 +0100)]
Fix lock issue for hvm pass-through domain

This patch protect the hvm_irq_dpci structure with evtchn_lock, thus
the access to domain's pirq_vector mapping is also protected.

Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
17 years agovt-d: Define a struct IO_xAPIC_route_entry to accommodate both ioapic
Keir Fraser [Thu, 9 Oct 2008 10:08:13 +0000 (11:08 +0100)]
vt-d: Define a struct IO_xAPIC_route_entry to accommodate both ioapic
and iosapic.

Signed-off-by: Anthony Xu <anthony.xu@intel.com>
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
17 years agoxenpm: Fix typo bug.
Keir Fraser [Thu, 9 Oct 2008 09:16:49 +0000 (10:16 +0100)]
xenpm: Fix typo bug.

From: Guanqun Lu <guanqun.lu@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86/mm: Use l1e_get_pfn() in destroy_grant_pte_mapping().
Keir Fraser [Thu, 9 Oct 2008 09:15:30 +0000 (10:15 +0100)]
x86/mm: Use l1e_get_pfn() in destroy_grant_pte_mapping().

On x86_64 system, (pte >> PAGE_SHIFT) is not always equal to page
frame number because high bits (63:52) of pte may be used as
flags. This patch corrects the conversion and errors as below
disappear when applied.
    (XEN) mm.c:3074:d0 PTE entry 200000a2ec6167 for address a1f09958
    doesn't match frame a2ec6

Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
17 years agoxend: Fix typo _gatherDom -> gatherDom.
Keir Fraser [Thu, 9 Oct 2008 09:06:50 +0000 (10:06 +0100)]
xend: Fix typo _gatherDom -> gatherDom.
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
17 years agoAllow to specify Linux kernel config file
Keir Fraser [Thu, 9 Oct 2008 09:05:41 +0000 (10:05 +0100)]
Allow to specify Linux kernel config file

The env variable XEN_LINUX_CONFIG is used to specify this
file.

Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
17 years agox86: Remove bogus assertion from free_domain_pirqs().
Keir Fraser [Wed, 8 Oct 2008 13:00:58 +0000 (14:00 +0100)]
x86: Remove bogus assertion from free_domain_pirqs().
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: Define __per_cpu_shift label to help kdump/crashdump.
Keir Fraser [Wed, 8 Oct 2008 12:11:06 +0000 (13:11 +0100)]
x86: Define __per_cpu_shift label to help kdump/crashdump.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: Continue to allocate vectors across LAPIC priority levels, since
Keir Fraser [Wed, 8 Oct 2008 10:59:01 +0000 (11:59 +0100)]
x86: Continue to allocate vectors across LAPIC priority levels, since
it's easy to do. It's not really necessary for modern non-buggy APICs
though.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: Free MSI vector when a pirq is unmapped.
Keir Fraser [Wed, 8 Oct 2008 10:51:39 +0000 (11:51 +0100)]
x86: Free MSI vector when a pirq is unmapped.

Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: Move pirq logic to irq.c.
Keir Fraser [Wed, 8 Oct 2008 09:48:48 +0000 (10:48 +0100)]
x86: Move pirq logic to irq.c.

Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoflask: Fix a problem in xend code when starting a guest with XSM/Flask enabled.
Keir Fraser [Wed, 8 Oct 2008 09:03:47 +0000 (10:03 +0100)]
flask: Fix a problem in xend code when starting a guest with XSM/Flask enabled.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
17 years agoflask: Add 2 permissions to the default flask policy to get a VIF-enabled guest to...
Keir Fraser [Wed, 8 Oct 2008 09:03:09 +0000 (10:03 +0100)]
flask: Add 2 permissions to the default flask policy to get a VIF-enabled guest to work

This adds two more permissions to the default Flask policy to get a VM
with a network interface to work.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
17 years agoflask: Fix to default policy to get simple VM running
Keir Fraser [Wed, 8 Oct 2008 09:02:27 +0000 (10:02 +0100)]
flask: Fix to default policy to get simple VM running

This fix gets to the default Flask/XSM policy gets a simple guest VM
(Ramdisk only, no VIF) running.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
17 years agopygrub: fix the parameter `default' and `timeout' in elilo.conf
Keir Fraser [Fri, 3 Oct 2008 08:42:11 +0000 (09:42 +0100)]
pygrub: fix the parameter `default' and `timeout' in elilo.conf

This patch fixes two issues related to the parameter `default' and
`timeout' in elilo.conf:

- LiloConf.py cannot interpret the parameter `default' and
  `timeout'. The first kernel always boot up even if the second kernel
  is specified by `default'. And `timeout' is ignored.

  This issue is introduced by cset 15953:70bb28b62ffb.

- If two kernels or more are installed, the last kernel cannot boot
  up even if it is specified by `default'.

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
17 years agoxend: Allow guest write access to /local/domain/x/memory
Keir Fraser [Fri, 3 Oct 2008 08:37:35 +0000 (09:37 +0100)]
xend: Allow guest write access to /local/domain/x/memory
Required for xenballoond, and tools do not need to trust any values
written in that subdirectory.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agolibblktap: Remove trailing null byte in xs_printf
Keir Fraser [Thu, 2 Oct 2008 11:56:55 +0000 (12:56 +0100)]
libblktap: Remove trailing null byte in xs_printf

xs_printf writes the terminating null byte of the passed string to
Xenstore. When reading, the null byte is returned in the following
form which confuses tools:

sector-size = "512\000"

This patch removes the null byte from the data to write.

Signed-off-by: Kevin Wolf <kwolf@suse.de>
17 years agoEliminate code duplication with rcu_lock_domain_by_id().
Keir Fraser [Thu, 2 Oct 2008 10:39:36 +0000 (11:39 +0100)]
Eliminate code duplication with rcu_lock_domain_by_id().

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
17 years agoxc_ptrace: Allow gdbserver to connect to a guest before APs are
Keir Fraser [Thu, 2 Oct 2008 10:32:08 +0000 (11:32 +0100)]
xc_ptrace: Allow gdbserver to connect to a guest before APs are
brought online.

Signed-off-by: Kip Macy <kmacy@freebsd.org>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoxend: Make only selected subdirs of /local/domain/<domid> writable by the guest.
Keir Fraser [Thu, 2 Oct 2008 09:37:28 +0000 (10:37 +0100)]
xend: Make only selected subdirs of /local/domain/<domid> writable by the guest.

This protects critical data like
/local/domain/<domid>/console/{tty,limit}. It also means we can trust
.../vm, and hence do not need /vm_path. Various parts of the previous
two changesets disappear.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoxend: Fixes after backend xenstore config changes.
Keir Fraser [Wed, 1 Oct 2008 13:07:17 +0000 (14:07 +0100)]
xend: Fixes after backend xenstore config changes.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoxend: Move some backend configuration info.
Keir Fraser [Wed, 1 Oct 2008 12:35:39 +0000 (13:35 +0100)]
xend: Move some backend configuration info.

This patch moves some dom0 variables and backend device
configuration from frontend directories to
/local/domain/<backdomid>/backend or /vm.

Also,
- /vm_path/<domid> is introduced, referencing the /vm path
- /vm_path/device/backend holds the backend device location,
  rather than storing it in the frontend directory

Signed-off-by: Pascal Bouchareine <pascal@gandi.net>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years ago[IA64] Compilation fix to cpufreq stuff.
Keir Fraser [Wed, 1 Oct 2008 08:31:13 +0000 (09:31 +0100)]
[IA64] Compilation fix to cpufreq stuff.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 years agoMerge with IA64 tree.
Keir Fraser [Tue, 16 Sep 2008 12:53:47 +0000 (13:53 +0100)]
Merge with IA64 tree.

17 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>
17 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>
17 years agomerge with xen-unstable.hg
Isaku Yamahata [Tue, 16 Sep 2008 12:25:30 +0000 (21:25 +0900)]
merge with xen-unstable.hg

17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>
17 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>