Commit Graph
11702 Commits
Author SHA1 Message Date
Alastair Tse 2a44e6fed4 [XEND] Change blkif to use the new style configuration
Signed-off-by: Alastair Tse <atse@xensource.com>
2006-10-05 17:29:19 +01:00
Alastair Tse 02ba67937c [XEND] Massive XendDomain XendDomainInfo reorganisation to use XendConfig.
* Added some constants to do with lifecycle management in XendDomain
* Added docstrings
* Made all private functions prefixed with an underscore (_)
* Added lifecycle management in XendDomain which stores configs in SXP
  format.
* Added bits of XenAPI support.
* Moved all XendDomainInfo constants to a separate file
* Moved most of the domain creation login into XendDomainInfo rather
  than in module level functions.
* Moved to use Xen API compatible reporting of state.
* Reorganised methods into logical groups in XendDomain and XendDomainInfo
* Moved all domain configuration validation into XendConfig
* Removed DevController cruft from the bottom of XendDomainInfo to
  XendDevices.

Signed-off-by: Alastair Tse <atse@xensource.com>
2006-10-05 17:29:19 +01:00
Alastair Tse 9caccb8f48 [XEND] XendConfig is an extended python dictionary that is used to exchange
VM configuration information to allow easy import and export to different
file types.

Signed-off-by: Alastair Tse <atse@xensource.com>
2006-10-05 17:29:19 +01:00
Alastair Tse 00a4566470 [XEND] Refactoring device controllers to its own module so it can be used by both XendConfig and XendDomainInfo.
Signed-off-by: Alastair Tse <atse@xensource.com>
2006-10-05 17:29:19 +01:00
Alastair Tse 965e9d0ac4 [XEND][XENAPI] Split Xend global constants out to its own file.
Signed-off-by: Alastair Tse <atse@xensource.com>
2006-10-05 17:29:19 +01:00
Alastair Tse 19ce2d7016 [XEND][XENAPI] Adding some default Xen API Errors
Signed-off-by: Alastair Tse <atse@xensource.com>
2006-10-05 17:29:19 +01:00
acnt2@huggins.lce.cl.cam.ac.uk 84269c54b1 [XEND] Minor code formatting changes to XendRoot.py
Signed-off-by: Alastair Tse <atse@xensource.com>
2006-10-05 17:29:19 +01:00
acnt2@huggins.lce.cl.cam.ac.uk 5bbd381a3b [XEND][LIFECYCLE] Configurable storage path for lifecycle support
Signed-off-by: Alastair Tse <atse@xensource.com>
2006-10-05 17:29:19 +01:00
acnt2@huggins.lce.cl.cam.ac.uk 80e180d5b3 [XEND] Clean up some keyword clashes with XendCheckpoint
- Replaced str with domstr
- Disabled changing domain name while migrating

Signed-off-by: Alastair Tse <atse@xensource.com>
2006-10-05 17:29:19 +01:00
acnt2@huggins.lce.cl.cam.ac.uk 61c5734192 [XEND] Xen API Auth Manager for handling sessions
Signed-off-by: Alastair Tse <atse@xensource.com>
2006-10-05 17:29:19 +01:00
Alastair Tse ef46d763af [XEND] Make XMLRPC Server shutdown cleanly.
We can now catch the end of Xend and clean up domains accordingly.

Signed-off-by: Alastair Tse <atse@xensource.com>
2006-10-05 17:29:19 +01:00
Alastair Tse d03a635aec [XEND] Make logging an optional parameter for the XMLRPCServer
Signed-off-by: Alastair Tse <atse@xensource.com>
2006-10-05 17:29:19 +01:00
acnt2@huggins.lce.cl.cam.ac.uk fa82d0c586 [XEND] Replace dom with domid.
* Also removed stray semicolon
* Fixed whitespace for pciif.py
* Moved DEV_MIGRATE_TEST to xen.xend.__init__.py

Signed-off-by: Alastair Tse <atse@xensource.com>
2006-10-05 17:29:19 +01:00
acnt2@huggins.lce.cl.cam.ac.uk 70527787db [XEND] Python API break. Replacing ambiguious 'dom' with 'domid'
Signed-off-by: Alastair Tse <atse@xensource.com>
2006-10-05 17:29:19 +01:00
acnt2@huggins.lce.cl.cam.ac.uk 4cd942004e [XEND] Minor stylistic fixes for XendBootloader.py
Signed-off-by: Alastair Tse <atse@xensource.com>
2006-10-05 17:29:19 +01:00
acnt2@huggins.lce.cl.cam.ac.uk 4c89cbf41f [XEND] Make import sxp into absolute import.
* Replacing import sxp with from xen.xend import sxp to avoid
confusion.

Signed-off-by: Alastair Tse <atse@xensource.com>
2006-10-05 17:29:19 +01:00
acnt2@huggins.lce.cl.cam.ac.uk 39c3a03dfa [XEND] Fix backslash escaping so it ignores escapes if they don't make sense.
Signed-off-by: Alastair Tse <atse@xensource.com>
2006-10-05 17:29:19 +01:00
Steven Smith bf3932d291 [XEN][HVM] Fix a bug which could lead to the guest locking up if it
tried to a backwards memcpy across a page boundary in an MMIO region.
This should fix the problems some people have been reporting running
vim.

Signed-off-by: Steven Smith <sos22@cam.ac.uk>
2006-10-02 13:45:44 +01:00
kaf24@firebug.cl.cam.ac.uk bd769a8dd5 [HVM][TOOLS] Improve warnign message when trying to create
an HVM guest on a non-capable platform.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-09-30 11:35:02 +01:00
kaf24@firebug.cl.cam.ac.uk 963edd2c4e [HVM] Mov to/from CR8 must be gated on whether VLAPIC device is created.
If APIC=0 in VMX configuration file, VLAPIC(v) in
mov_from_cr()/mov_to_cr() will be NULL, so calling
vlapic_get_reg()/vlapic_set_reg()/vlapic_update_ppr()
would crash Xen.

Original patch from Dexuan Cui <dexuan.cui@intel.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-09-30 11:30:09 +01:00
kaf24@firebug.cl.cam.ac.uk 137a9ce8c7 [HVM] Add RDMSR/WRMSR instruction emulation to VMXAssist decoder
AP of PAE SMP windows will use it to set NX bit in EFER.

Signed-off-by: Xin Li <xin.b.li@intel.com>
2006-09-30 11:11:54 +01:00
kaf24@firebug.cl.cam.ac.uk 918463b430 [HVM] Add sub instruction support to HVM MMIO decoder.
This is needed for SMP PAE windows XP SP2.

Signed-off-by: Xin Li <xin.b.li@intel.com>
2006-09-30 11:08:41 +01:00
kaf24@firebug.cl.cam.ac.uk 57b01d8d98 [HVM][SVM] Do not delay ExtInt event injection if RFLAGS.IF==0.
AMD-V does not require the delaying of interrupt injection if the guest
IF_FLAG disallows interrupts.  Remove the code in svm_intr_assist()
that was checking the guest IF in eflags.

This patch fixes the problem with HVM Windows guests, with observing a
very slow timer countdown on the initial boot menu, when there is more
than one boot option.  Kbd response in this same Windows boot menu is
also acceptably responsive with this patch.

Signed-off-by: Tom Woller <thomas.woller@amd.com>=20
2006-09-30 10:49:08 +01:00
kfraser@localhost.localdomain dc396a7fd6 [NET] back: Loopback must copy foreign mappings.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-09-29 19:12:15 +01:00
Steven Smith e8c70336f3 Merge. 2006-09-29 15:40:35 +01:00
Steven Smith 8f1fe89527 [XEN][HVM] Arrange that we only consider sending a PV-on-HVM event channel
callback interrupt in vcpu 0.  This avoids a race in SMP HVM domains
which could lead to interrupts never getting delivered.  It is safe
because HVM domains always bind their event channels to vcpu 0.

Bug pointed out by Keir.

Signed-off-by: Steven Smith <sos22@cam.ac.uk>
2006-09-29 15:40:19 +01:00
kfraser@localhost.localdomain bb52a4e20a [BLKTAP] Find major number by searching sysfs
instead of reading /proc/devices.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
2006-09-29 14:55:57 +01:00
Steven Smith ef01bb7c53 Merge. 2006-09-29 14:42:49 +01:00
Steven Smith 1e75ea849e [XEN][HVM] Make sure that the interrupt which event channel events come in
on is level triggered rather than edge triggered, since it's a PCI device.
This is complicated by the possibility that another PCI device could be
on the same interrupt; the workaround is to have two irr registers
for the PIC and APIC, and have qemu and Xen generated interrupts go
into different ones.

This broke the alt_irq stuff.  Fortunately, nobody uses that anymore, so
I've removed it.

Signed-off-by: Steven Smith <sos22@cam.ac.uk>
2006-09-29 14:42:04 +01:00
kfraser@localhost.localdomain ada55182d2 [LINUX] Make evtchn device use a dynamic minor number.
Also update the code in tools to create the device node if udev fails.
The tools now read the sysfs system to find the minor number needed.

Original patch from  Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-09-29 14:20:52 +01:00
Tim Deegan 448496a5e2 [XEN] Recompute shadows of PAE PSE l2es when needed.
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
2006-09-29 11:57:06 +01:00
kfraser@localhost.localdomain 8c22c9b09f [HVM][SVM] Obtaining instruction address needs to mask to 32 bits
if not running in 64-bit mode.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-09-29 11:50:51 +01:00
Alastair Tse a1abe891a5 [TOOLS] Fix xendomains init.d script DOG PIG confusion.
Fix typos in xendomains where we actually mean WDOG_PID.
http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=754

Signed-off-by: Alastair Tse <atse@xensource.com>
2006-09-29 11:25:25 +01:00
kfraser@localhost.localdomain addbb411fa [HVM] Disable VMX/SVM on auxiliary processors when shutting down an SMP system.
With Intel VT, VMXOFF needs to be executed before halting the
CPU. Without this fix Xen or Linux is unable to start up the CPU after
a kexec reboot.

Tested using x86_32 on a Pentium D 930.

Signed-Off-By: Magnus Damm <magnus@valinux.co.jp>
2006-09-29 11:28:04 +01:00
kfraser@localhost.localdomain 6a6ea8c94e [HVM][VMX] Clear vmxe when VMX is not enabled.
The current Xen code keeps X86_CR4_VMXE set even if VMXON has not been
executed. The stop_vmx() code assumes that it is possible to call
VMXOFF if X86_CR4_VMXE is set which is not always true. Calling VMXOFF
without VMXON results in an illegal opcode trap, and to avoid this condition
this patch makes sure that X86_CR4_VMXE is only set when VMXON has
been called.

Tested using x86_32 on a Pentium D 930.

Signed-Off-By: Magnus Damm <magnus@valinux.co.jp>
2006-09-29 11:26:33 +01:00
kfraser@localhost.localdomain e32782e508 [PYGRUB] Enable showing the cursor in pygrub when it's relevant to do so.
Signed-off-by: Jeremy Katz <katzj@redhat.com>
2006-09-29 11:22:24 +01:00
kfraser@localhost.localdomain a93027461d [HVM][SVM] 64-bit Windows HVM guests require MCE/MCA CPUID bits to be present.
This SVM patch removes "masking off" of these bits for AMD-V HVM guests.
Signed-off-by: Tom Woller <thomas.woller@amd.com>=20
2006-09-29 11:21:02 +01:00
kfraser@localhost.localdomain 541466f790 [BLKTAP] Remove unnecessary TLB flush from blktap driver.
blktap_poll is calling tlb_flush_all() in its main ring buffer polling
loop.  This seems to be superfluous: the hypervisor should be
performing
any necessary tlb flushes on grant table operations performed by the
back-end.  Even a simple memory barrier is unnecessary here as the
RING_PUSH_REQUESTS() call performs a wmb() anyway.

And tlb_flush_all() is not exported to modules, so this call prevents
blktap from building as a module.  Just remove it.

Signed-off-by: Stephen Tweedie <sct@redhat.com>
2006-09-29 11:17:29 +01:00
kfraser@localhost.localdomain 80550dad57 [BLKTAP] Remove unnecessary timeout from tapdisk select() call.
tapdisk was using a 1msec select() timeout in its main event loop.  On
timeout, the loop does nothing except repeat, so the timeout achieves
nothing; worse, on a machine with HZ set to less than 1000, a msec
timeout returns immediately, sending tapdisk into a 100%-CPU-
utilisation loop.

Simply remove the timeout entirely; everything still works fine, and
much more efficiently when idle.

Signed-off-by: Stephen Tweedie <sct@redhat.com>
2006-09-29 11:16:52 +01:00
kfraser@localhost.localdomain 90e86a9d21 Remove dead pdb code from tools directory.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-09-29 11:13:01 +01:00
kfraser@localhost.localdomain b7b0acf60f [VMXASSIST] Fix data32/addr32 instruction decode issue.
Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com>
2006-09-29 11:11:49 +01:00
kfraser@localhost.localdomain e90fc3a7ed [HVM] Clean up hvm_copy interface to be more like copy_to/from_user.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-09-29 11:10:14 +01:00
kfraser@localhost.localdomain 0de66a695f [HVM][VMX] Fix data copying in transition to/from vmxassist.
In vmx_assist, the copy for new/old context and vmx assist magic are
all using physical address, while hvm_copy will use the virtual address.

This may cause problem when guest jump directly from real mode to
paging mode.

Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-09-29 10:30:18 +01:00
kfraser@localhost.localdomain 43e0adad8d [NET] back: Reset netfilter context in loopback receive path.
The issue is described in bugzilla report #746.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-09-29 09:29:20 +01:00
kfraser@localhost.localdomain 523d642f71 [BLK] front: Flush workqueues with no locks held. Operation can sleep.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-09-29 09:23:18 +01:00
kfraser@localhost.localdomain 0d6f3d721b [XENBUS] Don't perform normal state-machine transitions and
notifications during shutdown. When rootfs goes away this can
cause the system to hang, as we notify userspace etc.
Instead we forcibly reset the state machine back to state Closed
if we are a frontend driver, to get the backend to release
resources. Necessary if we are going to kexec.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-09-29 09:14:28 +01:00
Andrew Warfield 1c0ee21d44 [BLKTAP] have udev create the device for blktap
This patch makes blktap Do The Right Thing(TM).  It allows udev to
create the /dev/xen/blktap[0-9] devices.

It creates a sysfs class called "xen".  This part may later be placed
someplace else, but currently blktap is the only user so it is placed in
the blktap code.

When blktap is initialized, a blktap0 sysfs class device is made.  The
other devices blktapX (X > 0) are made when the BLKTAP_IOCTL_NEWINTF
ioctl is called.  This way we don't flood the sysfs and /dev/xen with
unnecessary devices.

I added a rule in the xen-backend.rules to allow for udev to create the
blktap devices.


With this, we can really remove the code to search and create the
/dev/xen/blktap[0-9]*, but I'll leave it in for now. With the use of
udev, we really should remove that code as well as the code for creating
the evtchn device.  udev works for both of these now.  But that removal
will have to be in another patch.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
2006-09-28 13:44:00 -07:00
Andrew Warfield 9dd368070b [BLKTAP] have blktap use a dynamic major
blktap currently uses a hardcoded major of 254 for the device.  This is
not robust in anyway and needs to be dynamic.

Note: it is better not to have the daemon create the node, and have udev
create it instead. But since the daemon currently creates the node
anyway, it is still the way this is done.  That change needs to be made
at another time.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
2006-09-28 12:47:45 -07:00
Andrew Warfield 8e7cc683c5 [BLKTAP][XEND] Fix blktap to work with a bootloader
If a Xen guest has a bootloader configured, then it will fail to start
on a blktap image.  The problem is blkdev_uname_to_file, which cannot
parse the "tap:aio:$filename" image strings: it tries to split the
string apart at ":" and assign the result to a 2-tuple, and this
results in a python error if the split results in three or more
strings.

The fix is to split only at the first ":", and then to split again
if we detect "tap:" as the image type.

Signed-off-by: Stephen Tweedie <sct@redhat.com>
2006-09-28 12:12:59 -07:00
Andrew Warfield 577a31b661 [BLKTAP] Fix SMP debugging assert failures in blktap
blktap is calling non-atomic kernel functions with irqs disabled, which
hits various kernel debug traps if those are enabled.  The problem is
req_increase(), which takes the pending_free_lock.

This function is currently only ever called from module initialiation,
where it is impossible for it to race against anything else.  Its
companion, req_decrease(), is not called at all.

Fix by removing the offending locking from req_increase() and, while
we're at it, remove req_decrease() entirely.

Signed-off-by: Stephen Tweedie <sct@redhat.com>
2006-09-28 12:03:01 -07:00