Add new hypercall "set_callback" taking a callback identifier and the
callback address.
This new hypercall incorporates the functionality of the existing set_callbacks
hypercall in a more flexible manner. set_callbacks is retained for compatibility.
Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
More simplifications to blkback:
1. Remove blkif->status field as it's really not needed.
2. Simplify connection logic.
3. Get rid of atomic_t io_pending. There's no need for
atomic r-m-w updates to the work-to-do flag, so replace
with an integer and add barriers where serialisation is
required.
Allow CONFIG_DEBUG_INFO to be specified when building
x86/64 XenLinux. Builds and boots fine. Leave the option
disabled by default, as with all other defconfigs.
Fix a problem that was caused by recent changes to the xenbus's
behavior that cause the .remove function not to be called anymore
during suspend. Due to that the driver allocated one more interrupt on
every suspend/resume cycle. Otherwise some code reformatting,
cleanups and improvements on allocation and freeing of data structure.
Update the user manual appendix to describe bow to get a mouse working
properly in a VNC window. Also add 'pae' configuration introduction for
HVM guests.
Signed-off-by: You, Yongkang <yongkang.you@intel.com> Signed-off-by: Dugger, Donald D <donald.d.dugger@intel.com>
Use PAGE_OFFSET instead of __PAGE_OFFSET in netfront.c.
__PAGE_OFFSET is not defined on all platforms.
Linux/ia64 and Linux/ppc don't have __PAGE_OFFSET definition.
Further workarounds for the broken string marshalling in xmlrpclib. Regardless
of the encoding used, one still may not include non-printable characters in an
XML document. When a dmesg contains a ^D character, something seen on one of
our test machines, an invalid XML document is generated.
Use a trick by David Mertz to work around this -- escape the string using
Python's repr function.
Backtrack on the new interface for reserved event-channel
ports, as binding them in user space via the evtchn driver
would be a pain. Instead extend VIRQs so they can be
classified as 'global' or 'per vcpu'. The former can only
be allocated once per guest, but can be re-bound to
an arbitrary VCPU.
There are a couple of bugs with the current handling of reads and writes
in the configuration space overlay functions. The wrong offset is passed
to the virtual field handlers. This patch uses the variable which
contains the correct offset. This patch also fixes the logic which
generates the actual value to write to a given virtual configuration
space field.
We had reports of reboot not working on certain machines (specifically
Compaq/HP notebooks), where Linux already has code to deal with
that. Apparently that code was either deleted during the original port
or got added to Linux after the original port was done. Anyway, this
patch adds the respective Linux code (slightly adjusted) to deal with
the same systems in Xen.
With the standard (XEN) prefix and the setting of 8 words per line,
stack dumps on i386 came out at 81 characters per line. The change to
xen/arch/x86/traps.c makes this 80 (without changing the look on the
screen), and the change to xen/drivers/char/console.c arranges for
soft line breaks not getting duplicated by hard line breaks, so
displaying 80 characters per line doesn't result in a subsequent blank
line.
HVM patch to add pio IOREQ_WRITE OVERLAP/REPZ support in hvm io.c
hvm_pio_assist(). Also, cleaned up a bit of duplicate code in the
functions. Simple guest tests (ide pio) pass now for overlapped/rep
write operations.
Signed-off-by: Tom Woller <thomas.woller@amd.com> Signed-off-by: Mats Petersson <mats.petersson@amd.com>
Simplify the Xen genapic code. Many genapic hooks have been
replaced with unconditional static 'sane' implementations.
Functions relating to interrupt/IPI delivery have been
grouped into two sets: physical delivery and logical-flat
delivery. All subarchitectures use physical delivery except
the basic default subarchitecture.
The main behavioural changes are:
1. Summit no longer uses logical-clustered delivery mode
2. Physical mode no longer makes any pretence to set the
LDR sanely. We never deliver interrupts in logical mode
so this really should not matter.
3. Sanity checking of phys_cpu_present_map is enabled
for all subarchitectures. Really we should have a sane
set of APIC IDs in the system, as we rely on them for
physical delivery mode.
4. We enable 'bigsmp' mode on any system with more than
eight CPUs. The previous xAPIC check was unnecessary,
since our bigsmp mode uses physical delivery, not
logical-clustered.
This all obviously needs testing on some big systems.
Workaround bug in xmlrpclib's string escaping. That library outputs invalid
UTF-8 if given a string containing high-bit characters, so instead pass in
Unicode strings, for which the escaping is correct.
This fixes a bug seen when the dmesg of a machine contains high bit characters,
but I'm sure there are other ways in which it might be triggered.
The attached patch fixes a race condition that occurs if after the
backend has been removed there are still requests pending. This patch
flushed all the pending requests.
Improve pygrub error reporting when opening ext2 fs is not possible
As reported in the thread:
http://lists.xensource.com/archives/html/xen-users/2006-03/msg00721.html,
pygrub does not open ext2 file systems in partitioned images or sub
partitions on e.g. CentOS/RHEL 4, because e2fsprogs ext2fs_open does not
support an offset into the file to be opened.
With this patch, the error is correctly reported instead of a generic
"unable to open file" (and leaving the user searching in the dark).
Remove send_IPI_all, send_IPI_allbutself and send_IPI_self
shortcutting IPI functions. They're either unused or used so
frequently that we may as well simplify things and always use
send_IPI_mask.
Handle failure to register the xen store event channel instead of
just not initialising xenbus/store when the supervisor_mode_kernel
feature flag is enabled.
When initialising grant tables only -ENOSYS is a valid reason
to fail so BUG_ON anything else like we did prior to changeset
9498.
Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
Make checksum handling in the virtual network drivers more robust.
Largely this involves making the logic symmetrical: for example,
not only should netfront be able to tell netback that a packet has
an empty protocol checksum field, but the reverse must also be true.
Another change is that the drivers only advertise IP checksum
offload functionality. There is currently no information
propagated across the device channel about the offset of the
protocol-specific checksum field. Therefore it is not safe to
defer checksum calculation for protocols the remote end may not
understand -- it will end up dropping having to drop the packet.
Yet another change is to allow netback to disable tx checksum
offload, just as we already could for netfront. Currently there is
no support for disabling rx checksum offload -- that would seem
to require some way of propagating the checksum-offload advertisement
(or lack of it) across the device channel, as it really ought to be
the transmitter that acts on it.
Thanks to Ian Jackson for pointing out some of the problems with
our checksum-offload handling. Several of the changes here are
due to his comments.
When dom0 fails to balloon enough memory to allow a new domain to start,
an exception is thrown. The test that decides which exception to throw
is backwards, resulting in strange error messages. The attached patch
fixes the problem.
Signed-off-by: Charles Coffing <ccoffing@novell.com>
Fix makefiles for hvmloader and vmxassist for FC5 on x86_64
systems.
In FC5, gcc has issues with the command lines used to build
hvmloader and vmxassist. Basically, the compiler doesn't
like the combination of -m64 and -m32. As these are 32 bit
apps, and intended to be, take a modified approach and simply
define XEN_TARGET_ARCH for 32 bits. This cleans up the
command line and builds the images correctly.
Add new boot parameter 'lowmem_emergency_pool' which creates
an emergency pool of pages below 4GB (i.e., in Xen's DMA pool)
which will ever be used to satisfy normal allocation requests.
This is particularly useful in an i386 PAE environment to ensure
that pages will always be available for allocation as
page-table base directories.
Usage, for example (to reserve 16MB):
lowmem_emergency_pool=16M
In a PAE environment, each reserved megabyte guarantees you should
be able to create up to 256 processes (counted across all guests).
16MB means you're good for 4096 processes.
Fix do_IRQ high bit masking.
Instead of setting the highest bit (which isn't easily done on native x86_64),
negate the interrupt vector stored in orig_{e,r}ax.
Also add patch for native build.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
Plumb network vif credit-based rate limiting thorugh xenbus
and xend into xm guest config files.
A new vif parameter 'rate' is supported, with an optional time window
paremeter for specifying granularity of credit replenishment. The default
window is 50ms. For example:
Currently, xm & xend allow an XAUTHORITY to be specified in the config
file. If that is not specified, then xm will pass the XAUTHORITY
environment variable back to xend instead. This is not sufficient,
since it is possible that XAUTHORITY is not set at all. This doesn't
cause a problem for most X apps, because xlib will use the fall-back of
$HOME/.Xauthority. But the viewer is started from xend, which almost
certainly doesn't have a reasonable HOME variable.
We fix this by always passing some value for
XAUTHORITY. In order of preference, that value is:
1. Use the value from the config file, if specified.
2. Use the value from the XAUTHORITY env variable, if set.
3. Use $HOME/.Xauthority, if HOME is set.
4. Look up the user's home directory via getpwuid, and append
"/.Xauthority"
Signed-off-by: Charles Coffing <ccoffing@novell.com>
Various softirq cleanups:
1. Make __softirq_pending a long, since PPC borrows the file
hardirq.h from us and they only do atomic ops on longs.
2. do_softirq() explicitly takes a void param list.
3. Remove idle_timestamp field from irq_cpustat. It's unused
and lets us simplify the idle loop a little bit.
Part 1 based on a patch from Hollis Blanchard at IBM.
Disable xen bus and grant tables when supervisor_mode_kernel is enabled.
Neither of these features are useful/available in this mode since only a
single domain is supported.
Do not attempt to initialise xen bus when supervisor_mode_kernel is
enabled.
Do not BUG_ON() failure to setup grant tables, future versions
of supervisor_mode_kernel may return -ENOSYS here.
Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
Remove the transaction parameter from xenbus_switch_state and move the state
switch out of a transaction, in the few cases where it is inside one.
In order to behave properly, it is necessary for a driver to know its own
xenbus state (see changeset 9469:b3cb19d2b07f, for example). This
value is stored as xenbus_device.state and updated by xenbus_switch_state.
If xenbus_switch_state occurs within a transaction, then there is a possibility
that the transaction would be aborted, leaving the state field dangerously out
of sync with the value currently in the store.
This fixes recent problems seen whereby bringing multiple devices up at the
same time results in some devices not coming up (often all of the even-numbered
ones, because of the pattern of transaction conflict).
Remove __HYPERVISOR_sched_op_new in favour of a header file interface version number system.
Define interface version in Kconfig and define it through CPPFLAGS for
C and assembly file compilation.
Add HYPERVISOR_{yield,block,shutdown} to remove direct use of sched_op
from guest code.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
The attached trivial patch fixes cases where a block device is mounted
read-only in domain 0, but still fails to be shared with a domU, because
it is mis-identified as being mounted writable. (On SUSE, CDs and DVDs
are auto-mounted not with merely permissions "ro", but
"ro,nosuid,nodev", hence the mis-identification.)
Signed-off-by: Charles Coffing <ccoffing@novell.com>
Check the return value of domain_lookup_by_name_or_id_nr for None (i.e. no
such domain) inside each of the public-facing functions. This fixes the
Internal errors seen when specifying an invalid domain.
domain_pincpu takes cpumap, which is a list, not a string, so there's no need
to try and split it up. Fixes xm vcpu-pin.
Fix the ProtocolError seen when the server throws an exception and running
under Python 2.3; traceback.format_exc was introduced in 2.4, so we can't use
it.
Free shadows of any pages which are released by a domain back to Xen.
This should fix the "Assertion '! IS_INVALID_M2P_ENTRY(gpfn)'"-crash in
free_shadow_page on domain destruction.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
Compute actual baud rate from UART divisor latch contents
when no baud rate is specified. Generalise the divisor
calculation based on external clock rate.
Remove vcpu_avail from the public S-Expression that's passed over the wire.
This trips up the XML-RPC layer on large SMP systems and isn't actually used
by xm.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Some fixes to IRET hypercall and failsafe callback handlers:
1. IRET hypercall must restore the event callback mask. This
was missing on x86/64, and both subarchitectures now restore
from EFLAGS.IF.
2. Failsafe callbacks are fixed to detect whether fault is due to
bad segment or due to IRET. In the latter case we now
immediatiately kill the process. This avoids infinite looping
between IRET hypercall and failsafe callback handler in the guest.
Clean up and fix VCPU hotplug and SMP save/restore.
1. No longer hold xenbus_lock while taking down VCPUs
in SMP suspend path. This allows block device hotplug
to continue working and so we will not deadlock on
paging in userspace hotplug code.
2. Track xenbus and local-admin permitted cpumasks for
VCPUs to bring online. So, if a local admin takes a
CPU down, that won't surprisingly get overridden next
time the kernel interrogates xenstore.