Some fine-tuning in the virtual TPM scripts for hotpluging. The changes
enable a virtual TPM to save its state between reboots of the virtual
TPM implementation.
Signed-off-by: Stefan Berger <stefanb@us.ibm.com> Signed-off-by: Vincent Scarlata <vincent.r.scarlata@intel.com>
[TOOLS] Make sure to explicitly close the connection if we're using HTTP/1.0. This
shouldn't be needed but it appears to be necessary as the Python client
just does a wfile.read() instead of only reading the reported Content-Length.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
[TOOLS] Fix pagetable-pinning loop in xc_linux_restore.
Previously it would not pin last PFN in physmap even if it was
a pagetable page. Signed-off-by: Keir Fraser <keir@xensource.com>
[XEN] localtime support for paravirtualized guests
It is quite minimal
in its approach, satisfying the purposes of the paravirtualized
NetWare operating system as well as any others that expect the time
base to be provided in localtime.
[IA64] stub to support dump_execution_state() on ia64
Also implement on_selected_cpus() for ia64. Signed-off-by: Alex Williamson <alex.williamson@hp.com>
[XEN] Xen always relinquishes VGA console to domain0 when domain0
starts to boot (previous behaviour looked for console=tty0 on
dom0's command line). To prevent this 'console=vga[keep]' must
be specified. Signed-off-by: Keir Fraser <keir@xensource.com>
Add new XENMEM_machphys_mapping to get info about location and
sizeof of the mach2phys table default mapping. Use this in Linux to
dynamically adapt the mfn_to_pfn() routine to undelrying hypervisor. Signed-off-by: Keir Fraser <keir@xensource.com>
Move the SSHTransport class to its own file, so that we may disable SSH
transport when running on Python <2.4. SSHTransport uses the new subprocess
class, and so it doesn't work on older versions.
Export machine_to_phys start and end addresses to guests.
Use this info in Linux to bounds-check accesses to the
m2p table. Signed-off-by: Keir Fraser <keir@xensource.com>
Use an environmental variable (XM_SERVER) to determine XML-RPC URI.
This allows users to invoke xm against a remote server. This is much more
useful though for exercising XML-RPC transports with xm-test though since
xm-test will continue to (mostly) function if the URI is localhost.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This patch adds client side support for XML-RPC over ssh. It differs from
the previous submission in that it now uses lazy evaluation to connect
to the remote server and provides more user friendly error messages if ssh
is not available.
Add support to Xend XML-RPC server for HTTP/1.1 Keep-Alive.
This patch fixes a few bugs in the Python SimpleXMLRPC server and enables
HTTP/1.1 by default. This allows a client to use Keep-Alive. Keep-Alive
improves performance by eliminating the overhead of connection setup and,
more importantly, avoids credential caching when executing multiple
commands over a secure connection.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
[XM-TEST] Improve detection of a guest having booted to prompt.
Lots of xm-test tests are failing with console timeouts on some machines
at the moment. I reproduced the problem and found it was due to some
probing activity in the boot process of the -xen kernel. The behaviour
of the current xm-test code is to assume that the boot process has
finished after performing three one-second waits for input---when the
probing activity introduces more than three one-second delays the test
suite breaks.
This patch changes the test suite to wait for the command prompt
before attempting to submit a command. The timeout is increased from 3
seconds to 3 minutes but the wait exits early when the prompt is found
so the test suite doesn't take any longer to run.
Signed-off-by: Harry Butterworth <butterwo@uk.ibm.com>
[XEN][PAE] Always enable non-debug version of l3tab_needs_shadow()
as there is some suspicion that it leads to crashes on PAE hosts.
Also: improve bracketing in the macros, for safety. Signed-off-by: Keir Fraser <keir@xensource.com>
Add DOM0_DOMAIN_SETUP hypercall. Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
[I fiddled with the flags prefix after all. :-) Signed-off-by: Keir Fraser <keir@xensource.com>]
[XEN] New function dump_execution_state() displays
current register and stack state of local CPU.
Use this to extend the 'd' debug key to be more useful. Signed-off-by: Keir Fraser <keir@xensource.com>
[XEN] Rename show_registers() to show_execution_state().
This makes more sense since it dumps stack as well as
registers. show_registers() still exists; it simply doesn't
dump the stack any more. Signed-off-by: Keir Fraser <keir@xensource.com>
[XEN] Fix ptwr_do_page_fault() after new more permissive
entry conditions to that function. Now that we no longer
check PGERR_page_present (i.e., that fault is a protection
fault), because it's not safe to do so, we can enter
ptwr_do_page_fault() with a not-present L2 page directory.
We then crash on our first access to the linear_l2_table.
This patch fixes all unprotected accesses to the
linear_l2_table to correctly handle faults.
Also move setup of globally-visible ptwr info record to end
of ptwr_do_page_fault(). We don't want the info picked up
by reentrant invocations of the page-fault handler.
[XEN] Remove code from writable-pagetable emulation path which
does not appear to be necessary. Replace with assertions for now,
pending total removal or me being proved wrong. Signed-off-by: Keir Fraser <keir@xensource.com>
[XEN] Fix page-fault handler to not trust bit 0 of error code.
It can be cleared due to writable-pagetable logic. Various
other cleanups too. Spurious fault detection logic is
simplified. Signed-off-by: Keir Fraser <keir@xensource.com>
[SEDF] Fix SEDF defaults to make domain0 take only a fair
equally-weighted share of extratime. Also, hack the short-
blocking logic as otherwise domain0 steals all CPU time
for several seconds after waking from a long sleep. Signed-off-by: Keir Fraser <keir@xensource.com>
[HVM] ACPI support patch 4 of 4: shutdown.
The patch is incorporated from Ben's Virtual Iron's ACPI shutdown patch
in changeset 9989:f8d20c3e4225
The patch support guest ACPI Windows shutdown, as well as ACPI guest
Linux "halt -p" and "shutdown -h now".
Signed-off-by: Ben Thomas <ben@virtualiron.com> Signed-off-by: Winston Wang <winston.l.wang@intel.com>
The patch support ACPI UP Guest Windows 2000, XP and 2003, based on
this we are going to add more support on SMP and 64bit Windows( which
are only working in ACPI mode) later. We tested: in ia32 guest:
a. Installation and boot of Windows XP sp2 and 2003 server in ACPI
mode
b when boot to both window, no yellow mark in device manger and USB,
network card and IDE DMA are working.
c. clean boot (without ACPI related errors) on UP and 4 vcpu rhel4u1
SMP guest and got ioapic Interrupt assigned according to ACPI DSDT
table's _PRT table's GSI.
To minimize the implementation efforts to satisfy the ACPI OS
installation and boot, we implemented ACPI only event logical model by
emulating ACPI hardware based on PIIX4 (Intel 82371ab) by: Populating
the PIIX4 ACPI bridge PCI configuration space; Adding ACPI timer
(required during windows installation/boot), PM1 event register block
and PM1 control register block (both are required during
installation/boot, shutdown, entering and leaving PM S state if adding
those features later), we provided full ACPI hardware registers above
using byte/word/dword access per ACPI spec requirement.
The patch also fixed many existing hvm ACPI related bugs, such as
warnings when boot to ACPI UP and SMP guest Linux OS; adding new ACPI
_PRT table reporting PCI IRQ routing table in PIC mode, adding new _PRT
table in APIC mode, that fixed no IRQ GSI cause it is forced to shutdown
when OS find new device to assign IRQ without ACPI event service; The
patch also fixed the ACPI DSDT table's PCI resource conflict with guest
e820 table when booting and installing ACPI Windows; we also added ACPI
shutdown service by incorporating the code in ACPI "hardware enable
register writer" from Ben's Virtual Iron's team's patch in changeset
9989:f8d20c3e4225.
We only provide minimum power management requirement support per spec-c1
and S5 for shutdown, may be S4 (hibernating which is meaningful for user
to save their working section) in the future.
Please note, current patch needs to have following switches in guest
configuration to enable proper ACPI support
a. need to add ACPI=1 (apic=1 if boot SMP Linux guest plus vcpu=
number want to test) in xmexample.hvm
b. need to add USB support: USB=1 and usbdevice='device' (or
='tablet') as the pm register base is static..., I will adding dynamic
ACPI FADT table for pm register base pointer later.
When installing guest OS in ACPI mode, need to manually tell Windows
setup program to install single core ACPI HAL:
After passing the 1st screen of windows setup of install Windows,
the first thing you'll see at the bottom of the screen is the
option to press F6 if you need to install a SCSI or RAID
controller. Don't press F6. Press F5 instead. This will take
you to a separate menu of Hardware Abstraction Layer's where
you can choose an appropriate HAL .The choices will be:
ACPI Multiprocessor PC
ACPI Uniprocessor PC
Advanced Configuration and Power Interface (ACPI) PC
...
Standard PC
Standard PC with C-Step i486
Please select "Advanced Configuration and Power Interface (ACPI) PC"
using current patch.
Signed-off-by: Winston Wang <winston.l.wang@intel.com>
[LINUX] Kernel should not send out IPv6 autoconfig multicast
packets if the interface is not marked as multicast-capable. Signed-off-by: Gerd Hoffmann <kraxel@suse.de>
[ACM] Complete the conversion of acm_ops using Xen handles instead
of void pointers. It also fixes a recently slipped in acm bug that hangs
Xen when a domain is destroyed.
[XEN] Use correct xen_pfn_t type in implementation of XENMEM_exchange.
Avoids compile errors on ppc. Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
[LINUX] Add spurious page-fault detection, intended primarily
for spurious write faults on mappings that have been
changed from read-only to writable. If a CPU has a stale
read-only entry in its TLB, it is allowed to fault on
the next write access without re-walking the page table. Signed-off-by: Keir Fraser <keir@xensource.com>
[XEN] Make the spurious page-fault detection logic
more robust. In particular it must be able to handle
spurious write faults on mappings that have been
changed from read-only to writable. If a CPU has a stale
read-only entry in its TLB, it is allowed to fault on
the next write access without re-walking the page table. Signed-off-by: Keir Fraser <keir@xensource.com>
[XEN] PTE updates do not need to use CMPXCHG instruction.
This is because the updates are already protected by a
per-domain lock. Using straightforward memory writes has
two advantages:
1. Faster
2. More correct (previously we could race accessed/dirty
bit updates by other CPUs). Signed-off-by: Keir Fraser <keir@xensource.com>
[LINUX] Use new XENMEM_exchange hypercall (where possible)
to provide watertight implementations that should never crash
in ENOMEM situations. Signed-off-by: Keir Fraser <keir@xensource.com>
[XEN] New memory_op XENMEM_exchange. Allows atomic
exchange of one memory reservation for another of the
same size, but with different properties. Signed-off-by: Keir Fraser <keir@xensource.com>
[MINI-OS] Fix for event initialisation in Mini-OS. All events are masked when
the system is started up. This prevents from getting spurious events
between hypercall to bind an event-channel and registering
appropriate event handler. Signed-off-by: Grzegorz Milos <gm281@cam.ac.uk>
[LINUX] Network buffers do not need to be multi-page contiguous
for unprivileged domains (in any case, can fall back to swiotlb).
On non-privileged domain of Xen/IA64, this caused some trouble. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
[TOOLS] Introduce xc_evtchn_*() interface for interacting with /dev/xen/evtchn.
No longer open the device as non-blocking: all reads immediately follow
a select() on the device indicating it's ready to read.
[LINUX] Only destroy a machine-contiguous memory region if
it really is contiguous (e.g., create_contiguous did not fail). Signed-off-by: Keir Fraser <keir@xensource.com>
[IA64] let VMM do itc sync for guest on VTI domain
Previously, on SMP VTI-domain, Guest OS was responsible for
syncing itc by calling ia64_sync_itc, but the round trip may
be very large on VTI domain, that may cause guest itcs are
not synced well and cause guest wall clock is not accurate.
This patch intends to fix this issue, when guest wants to sync
itc( vcpus other than vcpu0 write itc), VMM directly get vcpu0
itc for other vcpus.
[LINUX][PAE] More fixes to pgd allocation. Since allocating pmds
can sleep, we could race save/restore and end up with stale
machine addresses stores in pgd entries. Avoid this by
remembering virtuall addresses and translating to machine
addresses all at the end and protected by the pgd_lock. Signed-off-by: Keir Fraser <keir@xensource.com>
[NET] front: Discard packets in tx ring rather than attempting retransmit
when reconnecting to backend driver (e.g., after save/restore or migrate).
Two main reasons for this:
1. The retransmit code is broken for fragmented packets. It would need
a rewrite to cope with the new scatter-gather format.
2. We will drop packets anyway, in both directions (e.g., takes some
time for received packets to be redirected to new virtual interface;
also further transmitted packets from the network stack are dropped
after we call netif_carrier_off(), so even if we retransmite what's
already in the ring it is likely that some subsequent packets will
already be lost).
If this causes downtimes that are too long (particularly for live
relocation) then the whole strategy for buffering packets while the
frontend-backend connection is severed needs to be considered.
[LINUX][PAE] Improve allocation strategy when PAE pgdirs must be below 4GB.
Moving the re-allocation to low memory into pgd_alloc() has several
advantages:
1. Avoids race with save/restore where pgdir may end up above 4GB after
save/restore.
2. If pgdir cannot be re-allocated we can return failure to the caller
rather than BUG().
3. Slightly reduces diff against native Linux code. Signed-off-by: Keir Fraser <keir@xensource.com>
[LINUX][BLK] front: More care over device teardown.
1. We must ensure gnttab callbacks are disabled and all work
flushed before tearing down device state. A new gnttab interface
call is added for this purpose.
2. blkif_free() must check for a request_queue before deref'ing it. Signed-off-by: Keir Fraser <keir@xensource.com>
Now guest vhpt table of VMX domain is searched to insert some
entry into vtlb on the fly. However previous guard on memory
attribute is only done for guest itc.d emulation. That breaks
VGA acceleration and this patch fixes it by moving check to
right place.