Commit Graph
573 Commits
Author SHA1 Message Date
kaf24@firebug.cl.cam.ac.uk 2fb80a5353 Watch events may get lost, the xenstored response races against the new
watch being added to the watch list in register_xenbus_watch().  Fixed 
by adding the watch to the list unconditionally, and remove it in the 
error case.
2005-10-31 17:07:14 +01:00
emellor@leeni.uk.xensource.com 07237aa4f3 Merged. 2005-10-30 19:23:36 +01:00
emellor@leeni.uk.xensource.com 0ac3c6cbd5 Move misplaced netif_free declaration.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-30 17:17:21 +01:00
kaf24@firebug.cl.cam.ac.uk 2e4f771f0c Once grant refs run out, netfront prints a nice message, but doesn't set
err properly to notify the caller, and the domU crashes. (See bug 183 for
details).

Signed-off-by: Jim Dykman <dykman@us.ibm.com>
2005-10-30 16:43:05 +01:00
emellor@leeni.uk.xensource.com 5b4535ea04 Change the grant table interface so that gnttab_end_foreign_access_ref returns
an error code if the page is still in use, and gnttab_end_foreign_access takes
a page to free.  This allows us to cope with frontends wanting to end access
while backends are still using pages by, eventually, placing the page and
grant table entry on a list, for freeing later.  At the moment, the page and
grant table entry are leaked, with a diagnostic.

Tidied up netfront.c's clean-up code.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-30 16:33:05 +01:00
emellor@leeni.uk.xensource.com d684300900 Added cast to silence warning on 64-bit.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-30 16:25:52 +01:00
emellor@leeni.uk.xensource.com e8fa801c79 Remove out: label, to silence warning.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-30 15:42:02 +01:00
emellor@leeni.uk.xensource.com ff9465e411 Merged. 2005-10-30 14:00:35 +01:00
emellor@leeni.uk.xensource.com d4a37a51af Don't schedule work for reboot if work is already scheduled. This fixes a
problem whereby migrated domains would shut themselves down immediately,
because the watch from the removal of the control/shutdown node would fire
after the workqueue had started, but before the domain was suspended, meaning
that an additional piece of work was scheduled, which ran immediately after the
domain was resumed. 

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-30 13:52:38 +01:00
kaf24@firebug.cl.cam.ac.uk 80e5f07b52 Fix floating-point corruption (a nasty race in fp task-switch
exception handling).
Signed-off-by: Keir Fraser <keir@xensource.com>
2005-10-30 10:45:49 +01:00
kaf24@firebug.cl.cam.ac.uk e16adc291f Add a commented-out sanity check for lazy fpu switching.
Signed-off-by: Keir Fraser <keir@xensource.com>
2005-10-30 09:39:55 +01:00
kaf24@firebug.cl.cam.ac.uk 1464591d5f merge 2005-10-29 09:51:35 +01:00
kaf24@firebug.cl.cam.ac.uk c1273bcc25 Clean up the 'initial mapping' area properly on x86/64.
We must completely blow away mappings of the original
p2m table and the initrd. Those areas eventually get freed
to the memory allocator and other uses of that memory will
get really confused by spurious redundant mappings in the 
init mapping area.

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-10-28 17:11:59 +01:00
kaf24@firebug.cl.cam.ac.uk 596789e95a Fix sizeof_vcpu_shift in x86/64 xen_entry.S.
Signed-off-by: Keir Fraser <keir@xensource.com>
2005-10-28 16:41:11 +01:00
kaf24@firebug.cl.cam.ac.uk 650fa32a00 BUG_ON() is a macro very very similar to assert(), and it's a really bad
idea in general to put statements with side-effects inside such a construct
(for example the BUG_ON() could be compiled away for non-debug builds).

The patch below fixes this for the drivers/xen tree.

I chose the general construct to store the respective return values in a
local var instead of an if (...) BUG(); because it looks like most of these
BUG_ON()'s need to be replaced by real error handling when going towards
production releases anyway, and then the local variable is going to be
needed anyway. (and besides the if construct tends to get unreable due to
the unlikely() etc).

Please apply.

Greetings,
   Arjan van de Ven
2005-10-27 17:09:01 +01:00
emellor@leeni.uk.xensource.com 655b6990ad Merged. 2005-10-25 11:24:01 +01:00
djm@kirby.fc.hp.com e74b8e2460 Remove dup prologue lines 2005-10-24 11:32:45 -06:00
emellor@leeni.uk.xensource.com 35b62f2630 Remove recently added uses of errno, as these cause trouble on ia64 builds.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-24 18:21:38 +01:00
djm@kirby.fc.hp.com b92c88b847 Need additional include for ia64 2005-10-24 10:46:39 -06:00
djm@kirby.fc.hp.com ee52af859f Necessary change to make ia64 dom0 rework:
- All even channels on xen/ia64 shares one common interrupt vector
	- xen_start_info is initialized only after xen_init, so adjust
	  sequence to avoid access before initialization

Signed-off-by Kevin Tian <kevin.tian@intel.com>
2005-10-24 09:15:53 -06:00
vhanquez@kneesa.uk.xensource.com 9b6fdc5d38 compute the correct totalram_pages when the balloon increase or decrease the
reservation. memory reports should be more correct now.

From: Satoshi Uchida <s-uchida@ap.jp.nec.com>
Signed-off-by: Vincent Hanquez <vincent@xensource.com>
2005-10-24 12:57:37 +01:00
emellor@leeni.uk.xensource.com 4384b3fc70 Instead of writing errors to
/local/domain/0/backend/<devclass>/<dom>/<devid>/error, write them instead to
/local/domain/0/error/backend/<yada>.  This is not the best place for them
perhaps, but it moves them out of the backend directory, on which the drivers
have a watch.  This fixes the problem whereby writing an error will trigger a
watch, causing the error message to be written again, and repeat.  Fixes bug
#286.
 
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-23 22:34:13 +01:00
kaf24@firebug.cl.cam.ac.uk 73e4aa4e2b Fix allocation of phys_to_machine_mapping array during
x86/64 linux boot. The original builder-provided array
must be made read-only in the initial mapping.
Signed-off-by: Keir Fraser <keir@xensource.com>
2005-10-21 16:22:09 +01:00
kaf24@firebug.cl.cam.ac.uk 4e1cf7ae5f Fix early bootstrap of secondary VCPUs on x86/64.
Signed-off-by: Keir Fraser <keir@xensource.com>
2005-10-21 14:33:46 +01:00
emellor@leeni.uk.xensource.com e5edf96441 Break common network code in xen-network-common.sh, and common vif hotplugging
code into vif-common.sh.

Fix the antispoofing in network-bridge to allow forwarding from physical
device to bridge, and vif0.0 to eth0.

Change the interface between netback driver and vif hotplugging scripts.  The
mac address and bridge details are read from the store directly by the script,
so that the kernel driver does not need to get involved.

Remove an awful lot of cruft from vif-bridge.  Move the iptables handling into
vif-common.sh, and fix it so that the new vif can get past the antispoofing
entries.  Merge vif-nat and vif-route into this structure too.

Use ip instead of ifconfig to get necessary details.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-21 12:06:17 +01:00
kaf24@firebug.cl.cam.ac.uk 36e3401c27 New function direct_kernel_remap_pfn_range(). Like
direct_remap_pfn_range but doesn't take a vma and implicitly
maps into init_mm.
Signed-off-by: Keir Fraser <keir@xensource.com>
2005-10-20 12:10:14 +01:00
kaf24@firebug.cl.cam.ac.uk 1283fe84f2 Add slack to balloon driver to allow to counteract low-mem
address space allocations in backend drivers.
Signed-off-by: Keir Fraser <keir@xensource.com>
2005-10-19 13:59:15 +01:00
kaf24@firebug.cl.cam.ac.uk 5e91bc5c8a Fix -xen builds.
Signed-off-by: Keir Fraser <keir@xensource.com>
2005-10-18 19:28:16 +01:00
kaf24@firebug.cl.cam.ac.uk 1a7490299e Domain0 doesn't do initial VCPU hotplug via xenstore.
Signed-off-by: Keir Fraser <keir@xensource.com>
2005-10-18 19:07:03 +01:00
kaf24@firebug.cl.cam.ac.uk e85a40dd36 Remove 'n_vcpu' field from start_info structure. Domain0
simply creates a CPU on every physical CPU. Other domains
read the initial VCPU configuration from xenstore.

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-10-18 19:02:14 +01:00
kaf24@firebug.cl.cam.ac.uk 0a105191a0 Merge i386/x86_64 smpboot.c into a simplified common Xen version.
Signed-off-by: Keir Fraser <keir@xensource.com>
2005-10-18 17:40:31 +01:00
kaf24@firebug.cl.cam.ac.uk 5cf031e58d alloc_netif() must return a ERR_PTR() on error, not NULL.
Signed-off-by: Keir Fraser <keir@xensource.com>
2005-10-18 15:40:29 +01:00
kaf24@firebug.cl.cam.ac.uk f2fabb9e4e Fix x86_64 smp boot:
The local_setup_timer prototype was bad. The call from start
secondary() to it was calling with out the CPU parameter. Eventually the
CPU parameter received by the local_setup_timer is bogus (big negative
number). With such a big cpu number the per_cpu macro was trying to
access totally wrong memory location (per cpu data offset for big -ve no
cpu) causing the unhandled page fault. Because the dom0 was panicking
the error information on the serial console was also not going through,
giving just clueless hang.  With hyper call based debug statement I
could find out what was going wrong in the dom0.

Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
2005-10-18 11:07:55 +01:00
emellor@leeni.uk.xensource.com ce4bbfbf11 Merged. 2005-10-17 16:23:26 +01:00
emellor@leeni.uk.xensource.com 706fcdf4de Have xenstored initialise its connections, meaning that xend can be out of
that loop completely -- the xc_init_store, initDomainStore calls can all go.

Have xenstored understand where the local domain information goes.  Xend no
longer has to generate a path and pass it to xenstored through
xs_introduce_domain -- we just allow xenstored to generate the path, and then
call GetDomainPath later.  There is still some work required to tidy this up.

Change the uuid module to generate uuids as lists of bytes, not in the
stringified form.  Added a unit test for that module.

Change the semantics of Xend restart, relying on these changes to the
xenstored semantics and earlier changes to add an opaque handle to the
hypervisor's domain-specific data block.  The semantics are now clearer, as
Xend can validate whether the details in the store match the current live
domain.

Added a usage statement to xenstored.

Some of this code is by Steven Hand.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-17 16:22:05 +01:00
kaf24@firebug.cl.cam.ac.uk dc66fe31f3 Remove useless SIF_XXX_BE_DOMAIN driver flags.
Signed-off-by: Keir Fraser <keir@xensource.com>
2005-10-17 15:54:28 +01:00
kaf24@firebug.cl.cam.ac.uk 3afe806f6f Make the event-channel pending and mask arrays consist of
longs. Thi sensures appropriate alignment for architectures
that require it, and also allows us to naturally support up
to 4096 event channels per 64-bit guest.

Moved 'n_vcpu' field from shared_info to start_info. Really it
ought to disappear altogether as the info can be derived from
xenstore.

Fix a weird bug in XendDomainInfo where 'vcpus' information for
a domain defaults to floating point value 1.0 rather than integer
1. This looks like a Python bug to me, but in any case it is
'fixed' by explicitly converting the default value to an integer.

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-10-17 15:15:17 +01:00
kaf24@firebug.cl.cam.ac.uk 689c39e019 Force RTC driver to fail to load in domU by preventing it
from binding to IRQ8.
Signed-off-by: Keir Fraser <keir@xensource.com>
2005-10-17 14:02:36 +01:00
kaf24@firebug.cl.cam.ac.uk 8ac022c344 Fix local_irq_save() and irqs_disabled() to be preemption-safe.
Signed-off-by: Keir Fraser <keir@xensource.com>
2005-10-16 11:45:51 +01:00
kaf24@firebug.cl.cam.ac.uk 1fbda75445 Detect failure to create shutdown process and retry twice
per second until it succeeds.
Signed-off-by: Keir Fraser <keir@xensource.com>
2005-10-15 16:25:05 +01:00
iap10@freefall.cl.cam.ac.uk 6a5cdc1492 Enable hotplug cpus in -xen x86_32 kernel.
Suggested by Ryan Harper
Signed-off-by: ian@xensource.com
2005-10-15 00:20:35 +01:00
kaf24@firebug.cl.cam.ac.uk 37df894164 machine_specific_memory_setup() makes the following call to setup e820:
add_memory_region(0, PFN_PHYS(max_pfn), E820_RAM);

Since max_pfn is (rightly) an unsigned long, we overflow for the current
definition of PFN_PHYS. Attached is my preferred solution as it will
hopefully avoid similar situations that may come up in the future.

Signed-off-by: srparish@us.ibm.com
2005-10-14 22:15:21 +01:00
iap10@firebug.cl.cam.ac.uk 5dc12fe242 Remove unused x86_64 functions.
Signed-off-by: ian@xensource.com
2005-10-14 01:42:34 +01:00
jrb44@plym.cl.cam.ac.uk 1109d74507 Fixed 64 bit Linux build.
Fixes from Ian Pratt. extern declaration of bind_ipi was out of sync with
the definition of the function.

Signed-off-by: James Bulpin <james@xensource.com>
2005-10-13 20:16:02 +01:00
kaf24@firebug.cl.cam.ac.uk 9394398ccf Cleanup CPU hotplug and save/restore. Next step is to
simplify SMP initial boot and then should be easy to merge
i386 and x86/64 smpboot.c.

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-10-13 17:08:59 +01:00
kaf24@firebug.cl.cam.ac.uk 349f04a5df NS_PER_TICK must be a s64 quantity. It is compared with
possibly -ve values which we do not want to 'promote' to
big +ve values.

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-10-13 08:38:49 +01:00
kaf24@firebug.cl.cam.ac.uk dfc0b259c1 Add memory barriers to console ring accesses. Similar to what
Rusty uses for xenbus messaging.

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-10-12 21:10:14 +01:00
cl349@firebug.cl.cam.ac.uk 4e5630275d Disable watch callbacks only during driver registration instead of all probes.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
2005-10-12 20:58:51 +01:00
cl349@firebug.cl.cam.ac.uk 22abd37313 Disable watch callbacks while running the driver probe callback.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
2005-10-12 18:43:26 +01:00
kaf24@firebug.cl.cam.ac.uk 3b83e00b15 Change xenstore-domain messaging protocol to match what we use
for other inter-domain comms (power-of-two-sized rings, and
free-running indexes). The interface is defined in the spirit of
the console protocol, so maybe some chance of merging them
together later?

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-10-12 18:25:40 +01:00