Keir Fraser [Thu, 24 Jan 2008 14:58:25 +0000 (14:58 +0000)]
tools/examples/block better use of losetup -r
Use losetup -r when the vbd is specified to be readonly, but only if
-r is supported (rather than always creating a writeable losetup
mapping if possible).
This was inspired by (but not derived from) a diff from the Fedora 8
patchset which uses -r iff the vbd is specified as readonly. We need
to be cleverer upstream because not all systems have losetup -r.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
xen-unstable changeset: 16642:643ab64d12d5ce57e5f1e08f85ab4bb7fbc136ae
xen-unstable date: Wed Dec 19 15:05:15 2007 +0000
Keir Fraser [Thu, 24 Jan 2008 14:57:57 +0000 (14:57 +0000)]
Enable loopback disk image files on readonly nfs filesystem.
When we losetup a file on readonly nfs filesystem, it fails with:
# losetup /dev/loop7 /data/vm/xen_el5_i386_para/system.raw
/data/vm/xen_el5_i386_para/system.raw: Permission denied
New version of losetup has add a "-r" option for readonly loop, which
Linux kernel has supported for a long time. Some distribution (EL5
update, Fedora 8, etc.) have shipped it. This patch benefit this
option while doesn't break the old versions of losetup.
Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
xen-unstable changeset: 16330:fbe7ed173314723f80f105e7e60fddd0bed77e5b
xen-unstable date: Wed Nov 07 09:22:31 2007 +0000
Keir Fraser [Tue, 22 Jan 2008 11:33:40 +0000 (11:33 +0000)]
blkback/blktap: Check for kthread_should_stop() in inner loop,
mdelaay() should be msleep(), and these changes belong in blktap as
well as blkback.
Based on comments and patches from Jan Beulich and Steven Smith. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
linux-2.6.18-xen changeset: 392:7070d34f251c3e0c411022a5d365aea9804114a7
linux-2.6.18-xen date: Mon Jan 21 11:43:31 2008 +0000
blkback: Request-processing loop is unbounded and hence requires a
yield point. Also, bad request type is a good cause to sleep for a
short while as the frontend has probably gone mad.
Patch by Steven Smith <steven.smith@eu.citrix.com>
Keir Fraser [Tue, 22 Jan 2008 11:32:23 +0000 (11:32 +0000)]
Avoid allocations causing swap activity on the resume path by allowing
such allocations to access the emergency pools otherwise a
save/restore/migration of a guest which is low on memory can
deadlock.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
linux-2.6.18-xen changeset: 377:e8b49cfbdac0c5ee680cd9ec3d693ed0e2d42432
linux-2.6.18-xen date: Mon Jan 14 15:52:23 2008 +0000
Keir Fraser [Tue, 22 Jan 2008 11:27:43 +0000 (11:27 +0000)]
xend: On block-attach, remove device information when VmError occurs.
I tested xm block-attach command with a wrong
parameter(file:). Naturally a command error occurred. Then I retested
xm block-attach command with a correct parameter(phy:). But a command
error occurred again. The second command error occurred because Xend
did not remove device information from self.info when the first
command error occurred.
Keir Fraser [Tue, 22 Jan 2008 11:27:18 +0000 (11:27 +0000)]
hvm, ioemu: Fix the ide/cdrom emulation error on FC7 guest.
The new libata-eh in the Linux kernel is throwing a fit over the QEMU
cdrom device for two reasons:
1) DRQ can be set with ERR_STAT set. This is a violation of the ATAPI
state machine.
2) After a TEST_UNIT_READY ATAPI command is sent ERR_STAT is getting
set
which is correct. But, when the OS issues another ATAPI command
ERR_STAT is still set. Which is bad since the next expected command
from the OS is REQUEST_SENSE to find out why ERR_STAT is set.
bug this fixes: https://bugzilla.novell.com/show_bug.cgi?id=3D291775
Signed-off-by: Brandon Philips <bphilips@suse.de>
Porting this qemu fix to xen.
Keir Fraser [Fri, 18 Jan 2008 13:54:11 +0000 (13:54 +0000)]
hvm: Allocate an unmapped guard page to separate ordinary low RAM
from special pages (ioreq, xenstore, etc). This will stop some probe
functions (e.g., embedded in memtest) from stomping on the special
pages. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen-unstable changeset: 16728:be960a84e492c1baa0a2dfa76b1a770d0df5e433
xen-unstable date: Thu Jan 17 12:59:10 2008 +0000
Keir Fraser [Fri, 18 Jan 2008 13:53:38 +0000 (13:53 +0000)]
libxen: Fix function prototype. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
xen-unstable changeset: 16721:b953c358d0adc75f77cfa1991b5fc15da2b5b0a2
xen-unstable date: Tue Jan 15 18:48:32 2008 +0000
Keir Fraser [Thu, 17 Jan 2008 14:00:54 +0000 (14:00 +0000)]
x86: Remove broken and unnecessary numa code from smpboot.c.
This was trampling on random memory when node==NUMA_NO_NODE. Signed-off-by: Keir Fraser <keir@xensource.com>
xen-unstable changeset: 15246:4eb223694d0aa8dc6266621ead1eb590f1aa29cc
xen-unstable date: Sun Jun 10 18:07:58 2007 +0100
Keir Fraser [Tue, 15 Jan 2008 11:19:14 +0000 (11:19 +0000)]
Cleanup xenstore after console device teardown
After the changes in 13616:b111908dd70b, DevController was leaking
xenstore entries every time we took down a console device, as there
was no equivalent to 'xenstore-rm -t' used in the hotplug scripts for
"real" devices. Implement the moral equivalent whenever removal is
forced.
Keir Fraser [Fri, 11 Jan 2008 11:06:22 +0000 (11:06 +0000)]
x86 hvm: hvm_maybe_deassert_evtchn_irq() needs to be called early in
vmexit handling, before IO-APIC can be EOIed or unmasked and resample
the fake INTx line. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen-unstable changeset: 16705:e4fd457a3dd5eebf059b49340bb7f3aea1239d8f
xen-unstable date: Fri Jan 11 10:53:44 2008 +0000
Keir Fraser [Thu, 10 Jan 2008 22:58:05 +0000 (22:58 +0000)]
x86_emulate: Certain opcodes are only valid with a memory operand. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen-unstable changeset: 16703:c86025f569cb
xen-unstable date: Thu Jan 10 22:52:40 2008 +0000
Keir Fraser [Thu, 10 Jan 2008 11:54:59 +0000 (11:54 +0000)]
x86 hvm: Tolerate failure to complete INTACK cycle on an
interrupt. Failure can occur because we do not hold locks between
detecting a pending interrupt and acknowledging it. Satte can change
between these two points. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Previously the evtchn_upcall_pending flag would only ever be sampled
on VCPU0, possibly leading to long delays in deasserting the
fake-pci-device INTx line if the interrupt is actually delivered to
other than VCPU0.
Diagnosed by Ian Jackson <ian.jackson@eu.citrix.com>
Keir Fraser [Thu, 10 Jan 2008 11:43:21 +0000 (11:43 +0000)]
x86_emulate: Correct RIP-relative addressing offset for SHLD/SHRD with
immediate byte third operand. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen-unstable changeset: 16696:b5b3e27f1af3f709a7795d407b567a7b4db533f0
xen-unstable date: Wed Jan 09 10:11:31 2008 +0000
x86_emulate: Fix handling of RIP-relative addressing.
The handling of SHLD/SHRD introduced in 16696:b5b3e27f1af3f7 was
incorrect; thanks to Gary Grebus @ Virtual Iron for spotting it. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen-unstable changeset: 16699:7e400607cdd8aa810b96a832eaf8989f48dd6646
xen-unstable date: Wed Jan 09 22:21:28 2008 +0000
Keir Fraser [Thu, 10 Jan 2008 11:40:11 +0000 (11:40 +0000)]
hvm: hpet: Clamp period to sane values to prevent excessive looping in
hpet_timer_fn(), or excessive numbers of set_timer() callbacks. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen-unstable changeset: 16697:1b2be7cf0b7b4b639b7d6f027545930021ebe1e0
xen-unstable date: Wed Jan 09 10:32:13 2008 +0000
Keir Fraser [Thu, 10 Jan 2008 11:39:23 +0000 (11:39 +0000)]
hvm: hpet: Fix overflow when converting to nanoseconds.
Currently in hpet_tick_to_ns, the approach is multiplying first, which
easily causes overflow when tick is quite large. The patch cannot
handle arbitratry large ticks duo to the precision requirement and
64bit's value range. But by optimize the equation, a larger ticks than
current code can be supported. Also an overflow check is added before
the calculation.
Keir Fraser [Thu, 10 Jan 2008 11:38:10 +0000 (11:38 +0000)]
hvm: time: Fixes to 'SYNC' (no_missed_ticks_pending) timer handling.
Based on a patch by Dave Winchell <dwinchell@virtualiron.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen-unstable changeset: 16690:01adaec882d4ea62aede17926716d122b084dd94
xen-unstable date: Tue Jan 08 14:31:23 2008 +0000
Keir Fraser [Thu, 10 Jan 2008 11:37:32 +0000 (11:37 +0000)]
hvm: hpet: Fix per-timer enable/disable.
The enable/disable per timer interrupt bit is wrongly used as per
timer enable/disable. According to spec, comparator value should
constantly increasing when HPET is globally enabled, no matter
whether the timer interrupt is enabled or not.
Keir Fraser [Thu, 10 Jan 2008 11:35:34 +0000 (11:35 +0000)]
Handle netdev secondary addresses and labels
Fix the network-bridge logic to correctly transfer secondary IP
address from $netdev to $bridge.
e.g. if you add an secondary address/label/alias with:
$> ip addr add 172.31.0.200/24 dev eth0 label eth0:00
then, "ip addr show dev eth0" gives e.g.:
inet 172.31.0.10/24 brd 172.31.0.255 scope global eth0
inet 172.31.0.200/24 scope global secondary eth0:00
and transfer_addrs() tries to execute:
ip addr add 172.31.0.10/24 brd 172.31.0.255 scope global dev
tmpbridge
ip addr add 172.31.0.200/24 scope global secondary dev tmpbridge:00
which causes the sript to fail because:
1) The device tmpbridge:00 doesn't exist
2) The "secondary" flag isn't valid
This patch fixes the sed commands to instead give:
ip addr add 172.31.0.10/24 brd 172.31.0.255 scope global dev
tmpbridge label tmpbridge
ip addr add 172.31.0.200/24 scope global dev tmpbridge label
tmpbridge:00
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
xen-unstable changeset: 16680:7b7700a30e5280d57ecb9a284ee943aa80ae37f0
xen-unstable date: Tue Jan 08 09:43:44 2008 +0000
Keir Fraser [Thu, 10 Jan 2008 11:34:38 +0000 (11:34 +0000)]
HVM vif without bridge.
When using xen without a bridge but NAT or routing, HVM domains can't
boot, and qemu-dm-n.log contains:
config qemu network with xen bridge for tap0 xenbr0
bridge xenbr0 does not exist!
That's because the qemu-ifup script always tries to add the vif to
a default-named xenbr0 bridge. On the contrary, PV domains just work
fine with the same configuration file except HVM parameters.
Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
xen-unstable changeset: 16679:60440a7e7a40c0cfe94f7abcbde82ea2c6e123fe
xen-unstable date: Tue Jan 08 09:40:33 2008 +0000
We need TIF_RESTORE_SIGMASK in order to support ppoll() and pselect()
system calls. This patch originally came from Andi, and was based
heavily on David Howells' implementation of same on i386. I fixed a
typo which was causing do_signal() to use the wrong signal mask.
Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: Andi Kleen <ak@suse.de>
linux-2.6.18-xen changeset: 375:748cd890ea7f56752311e519e80eece9d850c01a
linux-2.6.18-xen date: Wed Jan 09 22:12:04 2008 +0000
Keir Fraser [Fri, 28 Dec 2007 15:47:10 +0000 (15:47 +0000)]
In C99 (7.19.6.2.10), the behavior of scanf("stuff... %n", ..., &n) is
said to be undefined if the value to be put is n can't fit. I guess
we can safely consider that the same applies to printf.
Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
xen-unstable changeset: 16671:19f549449cb5
xen-unstable date: Fri Dec 28 15:23:28 2007 +0000
Keir Fraser [Thu, 27 Dec 2007 22:34:26 +0000 (22:34 +0000)]
Fix pygrub handling of many kernels
If there are a large number of kernel images configured in grub.conf
there will be too many to fit in the limited size pygrub display. This
patch fixes this so that the list of kernels scrolls as needed.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
xen-unstable changeset: 16668:50bd5d2c15cf
xen-unstable date: Thu Dec 27 12:56:32 2007 +0000
Keir Fraser [Thu, 27 Dec 2007 22:33:47 +0000 (22:33 +0000)]
Fix xend xenstore handling.
xend can get into a situation where two processes are attempting to
interact with the xenstore socket, with disastrous results. Fix the
two bad users of xstransact, add a big warning, and fix the destructor
so future mistakes will be detected earlier.
Signed-off-by: John Levon <john.levon@sun.com>
xen-unstable changeset: 16664:9fe92a88912b
xen-unstable date: Thu Dec 27 12:27:34 2007 +0000
Keir Fraser [Thu, 27 Dec 2007 22:32:24 +0000 (22:32 +0000)]
hvm: For functions which translate virtual addresses to machine
addresses, page faults should only be raised when the gva->gfn
translation fails. These should be distinguished from gfn->mfn
translation failures.
The main effect of this is to change the behaviour of functions
derived from __hvm_copy(), which now returns a three-way enumeration,
and also can automatically inject #PF when the gva->gfn translation
fails.
Keir Fraser [Thu, 27 Dec 2007 21:55:38 +0000 (21:55 +0000)]
hvm: Register fields CS,DS,ES,FS,GS,SS,etc. are all undefined during
HVM execution as they are not saved/restore on vmexit/vmentry. To
prevent accidental usage of these fields, poison them with 16-bit
value 0xbeef (debug builds only). Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen-unstable changeset: 16660:2324110ef2c6
xen-unstable date: Thu Dec 27 10:39:04 2007 +0000
Keir Fraser [Thu, 20 Dec 2007 10:29:07 +0000 (10:29 +0000)]
Fix serial output of carriage return when using high-bit stream muxing.
Original patch by Dan Doucette. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen-unstable changeset: 16641:b0c85bc56f9ef08a354499afea584c4b048068a3
xen-unstable date: Wed Dec 19 15:02:05 2007 +0000
x86, hvm: Clean up periodic timer code a little. This leads naturally
to a no-missed-tick-accounting mode which is a combination of ticks
delivered 'off beat' immediately upon re-scheduling when ticks are
missed, then reverting to delivering ticks 'on beat' as usual. Signed-off-by: Keir Fraser <keir@xensource.com>
xen-unstable changeset: 16341:8ff5bb70136dbb8ae4a725400334f4bff3643ba8
xen-unstable date: Thu Nov 08 10:33:18 2007 +0000
x86, hvm: Fix typo in no-missed-tick-accounting timer mode.
From: Dave Winchell <dwinchell@virtualiron.com> Signed-off-by: Keir Fraser <keir@xensource.com>
xen-unstable changeset: 16334:644e7577f6ee00f746a63a63ca16284cc31f9ee8
xen-unstable date: Wed Nov 07 14:53:32 2007 +0000
x86, hvm: More fixes to no-missed-tick-accounting mode. Signed-off-by: Keir Fraser <keir@xensource.com>
xen-unstable changeset: 16315:070da619e65e87b69b2d99794840d84998fdf083
xen-unstable date: Mon Nov 05 10:09:10 2007 +0000
hvm: Timer fixes:
1. Do not record more than one pending interrupt in
no-missed-tick-accounting mode. We do not stack up missed interrupts
in this timer mode.
2. Always record all missed ticks when we are in a
missed-tick-accounting mode. Do not have a ceiling for this as it
simply causes guests to lose track of wall time.
3. General bits of cleanup and simplification.
From: Dave Winchell <dwinchell@virtualiron.com> Signed-off-by: Keir Fraser <keir@xensource.com>
xen-unstable changeset: 16312:838e77a41a3c53a54428e642cb0440a8a6f8912b
xen-unstable date: Fri Nov 02 16:34:54 2007 +0000
hvm, x86: Allow virtual timer mode to be specified.
In HVM config file:
timer_mode=0 # Default: virtual time is delayed when timer ticks are
# missed dur to preemption
timer_mode=1 # Virtual time always equals wall time, even while missed
# ticks are pending
Keir Fraser [Wed, 19 Dec 2007 09:56:28 +0000 (09:56 +0000)]
[IA64] Fix vulnerability of copy_to_user in PAL emulation
There is a security vulnerability in PAL emulation since alt-dtlb
miss handler of HVM absolutely inserts a identity-mapped TLB when
psr.vm=0. HVM guest can access an arbitrary machine physical
memory with this security hole. Actually windows 2008 destroys
the content of machine physical address 0x108000.
I think this patch is enough for normal usage. Please see SDM
Vol2 11.10.2.1.3 "Making PAL Procedure Calls in Physical or
Virtual Mode". If the caller has a responsibility of providing
DTR or DTC mapping, xencomm for PAL might be unnecessary.
I confirmed there is no problem in linux, windows 2003, windows
2008 with this patch.
As for PV domain, the same logic can't be used due to only one
vTLB. This patch only checks that the buffer never points VMM
address, that would avoid the vulnerability.
With current XenD 3.0.4 or later try the following:
brctl addbr demo
ifconfig demo up
/etc/init.d/xend start
/etc/init.d/xend stop
ifconfig demo down
brctl delbr demo
Now, start XenD again....
/etc/init.d/xend start
And watch in horror as it re-creates your 'demo' bridge.
The problem is that the 'XendNetwork' class does not distinguish
between bridge devices that it is managing (ie those created via
XenAPI) and those which it does not manage (ie those created by OS
distro init scripts, or by apps like libvirt).
While initially I thought I could just make XenD ignore
externally-managed bridges completely, it seems to needs to know about
them otherwise it can't hook up guest VIFs to them correctly. So the
attached patch adds a 'managed' flag to the XendNetwork
class. Externally managed bridges have this set to False. At startup
XenD will now only re-create bridge devices which have the 'managed'
flag set to 'True' - ie those created via XenAPI.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
xen-unstable changeset: 16625:44a98411d230b3214be49b42e66d7c42e01ab59f
xen-unstable date: Sat Dec 15 18:26:52 2007 +0000
Keir Fraser [Fri, 14 Dec 2007 12:05:31 +0000 (12:05 +0000)]
SVM: Treat the vlapic's tpr as the master copy and sync the vtpr to it
before every vm entry. This fixes HVM save/restore/migrate, as the
vtpr value was only being synced on guest TPR writes before.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
xen-unstable changeset: 16618:966a6d3b74087474df337e00b31cbecf495b442a
xen-unstable date: Fri Dec 14 11:50:24 2007 +0000
Keir Fraser [Fri, 14 Dec 2007 11:57:21 +0000 (11:57 +0000)]
x86: When emulating PV RDMSR/WRMSR, only look at low 32 bits of RCX. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
This is based on part of:
xen-unstable changeset: 16616:136f80d219588b5e45a5d13e19dd51a2401504f5
xen-unstable date: Fri Dec 14 11:37:02 2007 +0000
Keir Fraser [Fri, 14 Dec 2007 11:52:01 +0000 (11:52 +0000)]
svm: Greatly reduce total number of CR8 intercepts
This patch reduces the number of CR8 intercept to a fraction of the
number of CR8 intercepts without. First, CR8 read intercepts are
completely disabled since the SVM vTPR is kept kept in sync with the
HVM vLAPIC TPR. Second, CR8 write intercepts are enabled and disabled
based upon certain conditions. Most of the time, CR8 write intercepts
are disabled. They are enabled only when there is a pending interrupt
that can't be delivered because of either the current ISR or TPR (aka
PPR) because this is the only time the TPR matters.
With this patch, the number of CR8 intercepts dropped from around
10,000,000 to around 6,000 during boot of Windows 2003 Server 64-bit
(this is a rough estimate).
Keir Fraser [Wed, 12 Dec 2007 14:42:41 +0000 (14:42 +0000)]
Fix gdb debugging of hypervisor.
This patch:
* enables the gdbstubs to properly access hypervisor memory;
* prevents an assertion failure in __spurious_page_fault's call
to map_domain_page if such accesses fail, by testing in_irq();
* prints some additional helpful messages;
* fixes the endianness of register transfers from the gdbstubs
so that gdb is much less confused.
* fixes the documentation in docs/misc/crashdb.txt
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
xen-unstable changeset: 16596:514d450ad7295c16c5e4b6bf3716aac7bd838bd4
xen-unstable date: Wed Dec 12 11:27:15 2007 +0000
Keir Fraser [Wed, 12 Dec 2007 14:41:39 +0000 (14:41 +0000)]
[HVM] Don't count "missed ticks" on one-shot timers.
It's not clear what it would mean, and it leads to division by zero. Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
xen-unstable changeset: 15943:c0d1825f51899b329495efb2078dd15e0fb3b479
xen-unstable date: Mon Sep 24 13:44:29 2007 +0100
hvm: Fix one-shot timers. Do not disable until the interrupt has been
latched by the target VCPU. Signed-off-by: Keir Fraser <keir@xensource.com>
xen-unstable changeset: 16125:b4278beaf3549f410a5a6086dbd8af93c495aeac
xen-unstable date: Wed Oct 17 13:12:03 2007 +0100
hvm: Fix destroy_periodic_time() to not race destruction of one-shot
timers.
This bug was tracked down by Dexuan Cui <dexuan.cui@intel.com>
Keir Fraser [Sat, 8 Dec 2007 17:20:02 +0000 (17:20 +0000)]
x86: Respect e820 map even below 16MB.
NB. Even with this patch, x86/32 still statically allocates the range
1MB-12MB. This can be changed if there really are platforms that need
stuff to persist in that range after the OS starts to boot.
Keir Fraser [Sat, 8 Dec 2007 17:18:06 +0000 (17:18 +0000)]
x86: force DMI table to not be in E820 RAM region
In order for Dom0 to be able to map the DMI table, it must not be in
E820 RAM; since some BIOS versions apparently fail to set the type
correctly for the page(s) containing this table, adjust it before
starting to consume memory.
Keir Fraser [Fri, 7 Dec 2007 12:45:57 +0000 (12:45 +0000)]
[IA64] Fix TLB insertion for subpaging
Without this patch, Longhorn is sure to hang up. .NET application
might hit this bug. itc.i instruction is repeated forever, because
TLB entry with smaller page size is volatile.
Keir Fraser [Fri, 7 Dec 2007 12:45:37 +0000 (12:45 +0000)]
[IA64] Fix wrong insertion of TLB entry in region 0
On PV domain with metaphysical mode, emulation of itc.d in region 0
doesn't work well and inserts an wrong TC entry.
Because set_one_rr() doesn't set the machine region register.
i.e. metaphyisical_rr0 is used instead of guest's rr[0].
This bug causes Dom0/U crash when an application uses region 0.
Actually I met the crash when I was building open GFW (java uses
region 0).
Keir Fraser [Fri, 7 Dec 2007 00:55:00 +0000 (00:55 +0000)]
xc_map_foreign_pages(), a convenient alternative to xc_map_foreign_batch()
xc_map_foreign_batch() can succeed partially. It is awkward to use
when you're only interested in complete success. Provide new
xc_map_foreign_pages() convenience function for that kind of use.
Also convert two obvious calls to use it.
Keir Fraser [Thu, 6 Dec 2007 17:45:41 +0000 (17:45 +0000)]
linux/x86: fix initial GDT setup
cpu_gdt_init() can be static, can have its argument point to const,
and the number of descriptors should be calculated from one more than
the table's limit.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
linux-2.6.18-xen changeset: 349:d43906ea0e9c136e9ec28df30f94c225536d588c
linux-2.6.18-xen date: Thu Dec 06 15:59:52 2007 +0000
Keir Fraser [Thu, 6 Dec 2007 17:44:35 +0000 (17:44 +0000)]
On pirq enable/disable we fully unregister/reregister with Xen. This
causes the underlying IRQ to be properly masked/unmasked, thus
avoiding deadlock scenarios if the IRQ is not EOIed.
Based on a patch by Chris Lalancette <clalance@redhat.com> Signed-off-by: Keir Fraser <keir.fraser@eu.citrix.com>
linux-2.6.18-xen changeset: 313:51b2b0d0921c3aefb18e16a2eda68a5c3133e949
linux-2.6.18-xen date: Wed Nov 21 09:41:11 2007 +0000
Keir Fraser [Thu, 6 Dec 2007 17:44:12 +0000 (17:44 +0000)]
pvfb: PVFB frontend can send bogus screen updates
The PVFB frontend can get confused and send a screen update to the
backend when the screen is actually clean. Such an update asks for
the impossible rectangle (x1, x2, y1, y2) = (INT_MAX, 0, INT_MAX, 0).
Fix by setting the dirty flag in the obvious place: when the dirty
rectangle is grown.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
linux-2.6.18-xen changeset: 311:ca05cf1a9bdc2c7604b95fd085fa5abe067c969a
linux-2.6.18-xen date: Fri Nov 16 16:55:46 2007 +0000
Keir Fraser [Thu, 6 Dec 2007 17:36:07 +0000 (17:36 +0000)]
xc ptrace: Fix a couple of bugs in page-table walking. Signed-off-by: John Zulauf <john.zulauf@intel.com>
xen-unstable changeset: 16544:d7a0a73e5dca64466843a420a3975ecf665d4762
xen-unstable date: Thu Dec 06 11:29:18 2007 +0000
Keir Fraser [Thu, 6 Dec 2007 17:35:41 +0000 (17:35 +0000)]
[XEN, 32on64]: Correct continuation translation for large
compat_mmuext hypercalls.
At the point where we translate the continuation "nat_ops" points to
the beginning of the batch of "i" entries, therefore it must be
incremented by the number of entries processed "i - left". At the same
point "cmp_uops" points to the end of the batch of entries and must
therefore be decremented by "left".
The new count value has already been set by do_mmuext_op to "left" and
therefore it is correct to add "count - i" since that is the number of
entries that remain after this batch.
Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
xen-unstable changeset: 16543:46776e65e6796f7751a15649f275b78e848d7ed5
xen-unstable date: Thu Dec 06 11:24:02 2007 +0000
Keir Fraser [Thu, 6 Dec 2007 17:34:47 +0000 (17:34 +0000)]
hvm: Initialize vlapic->timer_last_update.
Without the fix, before the first vlapic timer interrupt is injected,
the "vlapic->timer_last_update" in vlapic_get_tmcct() is always 0,
causing a wrong value of counter_passed.
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
xen-unstable changeset: 16536:89e7031e153c62b9ce223a58a7ba49df285784a7
xen-unstable date: Wed Dec 05 14:01:39 2007 +0000
Keir Fraser [Thu, 6 Dec 2007 17:29:12 +0000 (17:29 +0000)]
x86: Move get_page/put_page out of header file, and only print on
get_page() failure if the domain is not dying. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen-unstable changeset: 16492:8e3d42fdb8e784b947fbd998d9a6df0ebf771718
xen-unstable date: Tue Dec 04 09:56:10 2007 +0000
Keir Fraser [Thu, 6 Dec 2007 17:03:17 +0000 (17:03 +0000)]
hvm: Fix 2 type mismatches in vlapic.h and hpet.c for 32-bit build Xen
For 32-bit build of Xen:
1) the first mismatch (in hpet_read(), length is 4) makes guest think
the HPET DM is buggy (we return 0 for HPET_CFG.COUNTER_CLK_PERIOD to
guest), so guest wouldn't use HPET at all.
2) the second one: if tmict is 62500000 and timer_divisor is 16
(Fedoar7's installer uses the values at some time), 10 * 62500000 * 16
= 0x2540BE400 -- it's too big to be held in uint32_t.
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
xen-unstable changeset: 16486:c00f31f27de6eb69b4d79f7aa330b1e4aba6f45f
xen-unstable date: Wed Nov 28 13:13:51 2007 +0000
Keir Fraser [Thu, 6 Dec 2007 17:02:47 +0000 (17:02 +0000)]
hvm: Inject #UD for un-emulated instructions rather than crash guest
The CrashMe stress test (a process repeatedly forks child processes,
and
the child processes initialize a buffer with random numbers, then
treat
the buffer as code, and execute it) can crash 32-bit HVM RHEL5.1 guest
easily; this is because we haven't emulated all the instructions in
handle_mmio() yet.
The CrashMe process runs with root rights, and can access MMIO space
in
an unknown way ("strace -f" shows the random codes running at CPL=3D3
don't call mmap(), and don't open any special files in /dev/ "); the
gpa
may look like 0xa**** or 0xb****, or 0xfee0****. =20
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen-unstable changeset: 16485:c76a9aa12d2e37ed5c6c2a3562c755ec3828af8a
xen-unstable date: Wed Nov 28 13:04:47 2007 +0000
Keir Fraser [Thu, 6 Dec 2007 17:01:46 +0000 (17:01 +0000)]
x86-64: access only 4 bytes a the reset vector location on smpboot. Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen-unstable changeset: 16422:db98e4676d3ffe4a609b29ddef4a8e08016e4a43
xen-unstable date: Thu Nov 22 14:12:47 2007 +0000