[IA64] make xenLinux/ia64 privcmd mmap not to use dom0 memory
xenLinux/ia64 privcmd mmap uses pseudo physical address space.
it used alloc_pages() to allocate the space.
It wastes dom0 memory and sometimes several hundreds megabytes is
allocated depending on domU memory size.
With this patch xenLinux/ia64 trys to find the region which can be
used safely and uses the reasion.
[IA64] Final patch to make evtchn fully working for xen/ia64
OK, this is the last one of patch sets, which enables xen/ia64 to work
on event channel mechanism fully. Now user may observe /proc/interrupts
of dom0 as:
Based on this patch, dom0's performance is not affected, while domU's
network output is seen with several percents increase. More important,
now xen/ia64 can progress a base step towards driver domain support!
New memory_op subops which return the apparent or actual physical address map.
The new subops return a memory map in e820 format. This will allow the
removal of some Xen special casing in the Linux port by using the same
code as native.
Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
[LOADER] More sanity checks when parsing Elf images to avoid
out-of-bounds array accesses when loading the image. Signed-off-by: Keir Fraser <keir@xensource.com>
[ACM] Replace the union structure parameter of the ACM hypercalls
with command-specific request structures. It aligns the ACM
hypercalls with the way parameters are passed in the event channel
hypercalls.
Advantages include backward-compatibility regarding old guests when
new calls are added and clarity of the code.
[LOADER] Another change to the elf_paddr_offset/virt_base logic.
This avoids using zero to indicate 'undefined'. Instead we use
an explicit boolean to indicate whether suitable defaults should
be used. As well as making the logic clearer (I believe) it also
avoids problems if anyone ever explicitly specifies virt_base
(and also elf_paddr_offset) as zero.
[IA64] sparse-merge: check SPARSEDIR for modifications
Check SPARSEDIR for modifications before allowing the merge.
This removes the need for the FIXME. Additionally clean up
empty diffs at the end of the run.
Here's another sparse-merge patch to allow ARCH to be set on the
command-line, and to add -C to the final hg update since it's probably
switching between branches.
[LOADER] Remove check for VIRT_BASE existence: it's not needed
to prevent xend crashign (when Aravindh's latest patch is
applied) and breaks ia64. Also, ensure we set a reasonable
default for elf_paddr_offset.
[BUILDER] Always build initial PAE pagetables with a fourth mid-level
pgdir. This is required for Xen to be able to insert its own protected
mappings. At the same time, clean up 32b and pae pagetable-size
calculations to use the helper macro already used for x86/64.
Based on an original patch from Bruce Rogers at Novell.
The enforce_dom0_cpus test sets the number of vcpus for the Dom0 and
checks to see if they have been set correctly. We found that on
multi-proc systems, it takes a certain amount of time for the number of
vcpus to change.
This patch checks the number of vcpus inside a loop until it is correct
or 20 seconds elapse, whichever happens first. If after 20 seconds the
number of vcpus is not changed correctly, an error is raised.
Several page allocations, done in the hypervisor when starting an HVM
domain, are not checked. This can cause the physical machine to crash
when starting the HVM domain during low-memory conditions.
Kudos to Charles Arnold for catching the problem with
shadow_direct_map_init.
Signed-off-by: Charles Coffing <ccoffing@novell.com>
[XEND] An empirical and more conservative memory-overhead estimate for PV and HVM guests.
This patch calculates the overhead needed for HVM domains. If HVM is
supported by the hardware, I add a little ballooning overhead to
paravirtualized VMs also, to avoid low-memory situations. (There are
various unchecked alloc_domheap_pages calls in shadow*.c that I am
trying to avoid tripping over for now...) The values in this patch work
fine on 32 bit; I may update them later based on feedback and/or testing
on 64 bit.
Signed-off-by: Charles Coffing <ccoffing@novell.com>
[XEND] separate concept of initial memory size and overhead memory size.
When a domain (whether para- or fully-virtualized) reports how much
overhead memory it requires (via getDomainMemory in image.py), all such
memory was immediately allocated to the domain itself. This is
certainly incorrect for HVM domains, since additional
increase_reservation calls are made later in qemu. Since all ballooned
memory is already taken, qemu will fail. The fix is to treat the
requested memory size and the overhead size as separate values. The
requested memory size is immediately allocated to the new domain; the
overhead is left unallocated for whatever else might need it later.
Signed-off-by: Charles Coffing <ccoffing@novell.com>
Since network_tx_buf_gc unconditionally calls network_maybe_wake_tx at
the end, there is no need to call it again right after a call to
network_tx_buf_gc.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Fix a crash in gdbserver-xen where it references unmapped memory if
the page directory / page table pages are not present (for example
through dereferencing NULL in the gdb session). Changes:
- map_domain_va_32 has been rewritten to match map_domain_va_pae and
map_domain_va_64.
- All three functions have been extended to handle multiple vCPUs,
(untested, but shuld work), and check for _PAGE_PRESENT.
- Keir's workaround for the compile error in map_domain_va_64 has been
removed and hopefully fixed.
Signed-Off-By: Simon Kagstrom <simon.kagstrom@bth.se>
[NET] front: Give netfront a procectomy. The existing /proc interface
for tuning is buggy (network device names can change), and would
not be accepted in mainline.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
[NET] front: Network devices need to be freed by free_netdev not kfree.
Also, fix some missing unwinds in error path.
Still not convinced there aren't some lurking double free's in the error
paths here.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
[NET] front: Remove tx_full and unnecessary queue operations
The tx_full variable merely mirrors information already present in
the XOFF bit on the net device. The net device architecture itself
is quite mature and can be trusted by Xen to maintain its state
correctly.
Also, it's pointless to stop the queue in close_netdev since it can
be waken up anyway since there could be a softirq running on another
CPU. All of this is handled by unregister_netdev anyway.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
SVM patch to add a host save area per core for the hypervisor and also
for the microcode. The microcode area is not guaranteed to be
compatible with the vmcb layout, therefore will require it's own
"scratch pad". Consolidate the per core areas into a single structure.
Allow to specify different time-of-day clock offsets for HVM guests.
There are some usage scenarios in which differing user domains want
to be using different base TOD clocks. This patch adds the ability
to specify the base TOD time difference. The patch also adds a
hook point to notify another entity when the domain changes this
offset. This might occur, for instance, on a Linux domain using
hwclock -w.
Theoretically a 0 VIRT_BASE is okay. Change the bail code when
parsing elf headers to bail only when VIRT_BASE is not specified
at all. Signed-off-by: Keir Fraser <keir@xensource.com>
When doing local migration, a timing-related problem occurred due to the
frontend switching to the Closed state, which could end up having
the .remove function being called after the backend has shut down. This
now fixes the problem by switching to the Closing state.
The other part of the patch cleans up freeing of memory.
VTPM_TOOLS: Restructured handlers for better clearity and created an ipc
abstraction needed for expansion to hot plug and migration support. Also
fixed a bug in savestate.
This patch fixes the Linux builder so that it dies gracefully when
trying to load malformed ELF images. Signed-off-by: Aravindh Puthiyaparambil <aravindh.puthiyaparambil@unisys.com>
This patch fixes the x86_64 __xen_guest section allowing Mini-OS to run again. Signed-off-by: Aravindh Puthiyaparambil <aravindh.puthiyaparambil@unisys.com>
This small patch intends to fix domain pause/unpause bug.
Current xm pause operation will do sync_vcpu_execstate to
sync vcpu status, but it saves dom0's fpu and other registers
to VTi domain or domainU due to xm pause from control panel.
Because sync_vcpu_execstate was called after vcpu_sleep which
has saved all status when schedule out ,in addition, currently
no lazy states need to be saved in IPF side, so sync_vcpu_execstate
would need do nothing now.
Signed-off-by: Kevin Tian <kevin.tian@intel.com> Signed-off-by: Zhang xiantao <xiantao.zhang@intel.com>
This patch will fix VTi domain destroy bug. On tip, we couldn't
destroy VTi successfully at times. It was caused by misusing
vhpt base address for VTi domain in vhpt_flush function.
This script automates merging the sparse tree to new upstream
kernel revisions. When possible the files are automatically
patched to the new version, if that fails, the xen and upstream
patches are tried in reverse order, if that fails, the method
producing the smallest reject is left for manual merging.
Run as:
# LINUXPATH=$HOME/linux-2.6 sparse-merge
Where LINUXPATH is a local mercurial tree of the upstream kernel
(available from http://www.kernel.org/hg/linux-2.6). NEWTAG and
OLDTAG may also be specified if the autodetection does not work.
By default, NEWTAG will be the latest upstream version. If NEWTAG
or OLDTAG is an extra-version (ex. 2.6.16.13), ketchup will be
used to update the mercurial tree and add the appropriate tag.
Signed-off-by: Alex Williamson <alex.williamson@hp.com> Signed-off-by: Aron Griffis <aron@hp.com>
[IA64] Allow multiple-time mmap of the privcmd device
Allow multiple-time mmap of the privcmd device. The old implemntation
doesn't allow multiple-time mmap for a same struct file_struct.
However xend or qemu does multiple-time mmap.
This patch affects only dom0 vp model. With this patch multiple domu can
boot simultaneously and vti domain can boot on vp model dom0.
* oprofile_set_active() calls set_active() method without holding
start_sem. This is clearly wrong, as xenoprof_set_active() makes
several hypercalls. oprofile_start(), for instance, could run in
the middle of xenoprof_set_active().
* adomain_write(), adomain_read() and xenoprof_set_active() access
global active_domains[] and adomains without synchronization. I
went for a simple, obvious fix and created another mutex. Instead,
one could move the shared data into oprof.c and protect it with
start_sem, but that's more invasive.
Also clean up the code dealing with /dev/oprofile/active_domains:
* Use parameters instead of global variables to pass domain ids
around. Give those globals internal linkage.
* Allocate buffers dynamically to conserve stack space.
* Treat writes with size zero exactly like a write containing no
domain id. Before, zero-sized write was ignored, which is not the
same.
* Parse domain ids as unsigned numbers. Before, the first one was
parsed as signed number.
Because ispunct()-punctuation is ignored between domain ids, signs
are still silently ignored except for the first number. Hmm.
* Make parser accept whitespace as domain separator, because that's
what you get when reading the file.
* EINVAL on domain ids overflowing domid_t. Before, they were
silently truncated.
* EINVAL on too many domain ids. Before, the excess ones were
silently ignored.
* Reset active domains on failure halfway through setting them.
* Fix potential buffer overflow in adomain_read(). Couldn't really
happen because buffer was sufficient for current value of
MAX_OPROF_DOMAINS.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Fix the tools build:
1. xenctrl.h needs to include stddef.h to define size_t
2. tbctl is broken -- remove it since xenmon and xentrace
both automatcially enable tracing now
3. Fix setsize after xc_tbug interface changes
Prevent an oops in Dom0 that occurs when a CD device, specified as one
of the 'hardrives' in the 'disk=' line of a para-virtualized guest's
def file, has no media when the guest is started.
The oops occurs in vbd.c when vbd_size() is called from connect() (in
xenbus.c) and the vbd pointer is really an error code that comes from
the failed open that occurred in vbd_create().