This patch adds support to the TLS fixup code for x87 opcodes. These
can be treated like 2-byte opcodes with a weird encoding.
The patch includes some extra changes because, now that we have >2
opcode tables and 9 different lead bytes in a two-byte opcode, a
simple boolean code will not be enough to differentiate one- and
two-byte opcodes. Besides this, the patch is trivial since the
segment fixup code cares about the operands of the instruction, not
about its semantics.
Firstly, these MSRs are always accessible if the CPU supports them --
we should not check for EFER.LMA.
Secondly, we should not use teh cached value of shadow_gs while the
VCPU is running. It can be stale if the guest has executed SWAPGS
(which we cannot trap). Hence always access the underlying host MSR
when emulating guest accesses.
The latter bug was found and a patch proposed by <leonid@3tera.com>
i386: fix handling of Xen entries in final L2 page table
Running Xen on top of KVM exposed an issue that latently also exists
on real hardware: So far, updating any L3 entry resulted in the Xen
owned part of the L2 table referenced by the final L3 one to be re-
initialized. This was not only unnecessary, it actually resulted in
Xen relying on the TLB entry which maps the L2 page that's being
updated not going away intermediately, since as a first step the full
range of Xen owned entries in the L2 were replaced by the respective
ones from the idle page table, and only then the per-domain entries
got re- written to their intended values.
This part of the initialization really is sufficient to be done once,
when the page becomes an L2-with-Xen-entries (PGT_pae_xen_l2) one,
i.e. can be moved to alloc_l2_table(). Only the linear page table
setup has to remain where it always was.
32on64: increase size of compat argument translation area to 2 pages.
The existing single page is not quite large enough to translate a
XENMEM_exchange hypercall with order=3D9. Since Linux uses
MAX_CONTIG_ORDER of 9 this seems like a reasonable upper bound to
support.
udev removed the udevinfo symlink from versions higher than 123 and
xen's build-system could not detect if udev is in place and has the
required version.
Keir Fraser [Tue, 23 Jun 2009 10:37:04 +0000 (11:37 +0100)]
VT-d: correct kill hvm_timer
hvm_timer is created with the vector got from domain_irq_to_vector(),
accordingly it should use the same vector to kill the timer. The patch
corrects it in pci_clean_dpci_irqs().
Signed-off-by: Weidong Han <weidong.han@intel.com>
xen-unstable changeset: 19815:b6612dd06218
xen-unstable date: Tue Jun 23 11:26:22 2009 +0100
Keir Fraser [Tue, 16 Jun 2009 13:25:31 +0000 (14:25 +0100)]
[IA64] fix early access to per cpu area.
The following changeset broke booting xen-ia64 on some kinds of ia64
boxes.
http://xenbits.xensource.com/ext/ia64/xen-unstable.hg/rev/3fd8f9b34941
The tasklet_schedule call raise_softirq().
Because raise_softirq() use per_cpu, if we access per_cpu before
cpu_init()
the behavior would be unexpected.
Keir Fraser [Mon, 11 May 2009 10:21:21 +0000 (11:21 +0100)]
x86 hvm: hvm_set_callback_irq_level() must not be called in IRQ
context or with IRQs disabled. Ensure this by deferring to tasklet
(softirq) context if required.
Event-channel setup: Re-bind if the connection becomes unbound (e.g.,
due to 'slow' domain suspend cancellation), even if the remote port
identifier has not changed.
Domain logging: Only open log file once (don't leak fds) and fix a
small memory leak.
Evtchn changes based on a patch by Jiri Denemark <jdenemar@redhat.com>
x86: fix next->vcpu_dirty_cpumask checking in context_switch()
There was a timing window where flush_tlb_mask() could be called with
an empty mask (triggering a WARN_ON() in send_IPI_mask_flat() along
with APIC errors) because rather than using the already taken snapshot
of next's vcpu_dirty_cpumask struct vcpu's field was used directly,
which can get its only bit cleared by remote CPUs.
Replacing the structure field's use by the local variable then made
the inner cpus_empty() check completely redundant with the one in the
surrounding if()'s condition.
x86: avoid EPT scanning errors when splitting superpages during live
migration
Since Xen did not lock the p2m table for p2m table reading, when
splitting the large page during live migration, we should make sure
the path of EPT entries be modified are always there while other CPUs
may access the super entries at the same time.
The corruption happens every time we pass a sector aligned buffer
(instead of a page aligned buffer) to blkfront_aio. To trigger the COW
we have to write at least a byte to each page of the buffer, but we
must be careful not to overwrite useful content.
Keir Fraser [Tue, 17 Mar 2009 14:53:05 +0000 (14:53 +0000)]
x86: Fix APIC 0x40 error when CPU online and Host s3 resume
disable_APIC_timer actually is not useful here. Actually it will
trigger a local APIC error when masking the LVT entry when vector is
zero (before timer is inited) on Intel P6 family. This APIC error(40)
appears when online the offlined CPU and Host S3 resume.
Signed-off-by: Liping Ke <liping.ke@intel.com> Signed-off-by: Gang Wei <gang.wei@intel.com>
xen-unstable changeset: 19335:dc5441bf3ddcfb14045333c9992fd919c5d79a24
xen-unstable date: Thu Mar 12 11:16:54 2009 +0000
Keir Fraser [Mon, 2 Mar 2009 14:18:33 +0000 (14:18 +0000)]
acm: Return a valid buffer
This patch reverts a previous patch trying to fix a memory, even
though I don't think there was any. Now return a valid buffer. All
functions calling this function do free the buffer.
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
xen-unstable changeset: 19248:6f207d1eee5c21452d4527fe202c5a3f4d2b815c
xen-unstable date: Mon Mar 02 10:31:16 2009 +0000
Keir Fraser [Mon, 2 Mar 2009 14:17:50 +0000 (14:17 +0000)]
x86, hvm: gcc44 build fix.
Broken constrain in inline asm. Bytewise access works with a, b, c, d
registers only, thus "r" is wrong, it must be "q". gcc 4.4 tries to
use the si register, which doesn't work and thus fails the build.
From: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen-unstable changeset: 19243:e5c696aaf2a6e8805231c0c0f1414560262e7005
xen-unstable date: Sun Mar 01 14:58:07 2009 +0000
Keir Fraser [Mon, 2 Mar 2009 14:17:28 +0000 (14:17 +0000)]
xenstored: fix use-after free bug
Problem: Handling requests for one connection can not only zap the
connection itself, due to socket disconnects for example. It can also
zap *other* connections, due to domain release requests. Especially
it can zap the connection we have saved a pointer to in the "next"
variable.
From: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen-unstable changeset: 19242:226031d62fc53d92df1aa7ba5565e887fa925318
xen-unstable date: Sun Mar 01 14:50:04 2009 +0000
Keir Fraser [Mon, 2 Mar 2009 14:17:05 +0000 (14:17 +0000)]
x86, time: fix S3 suspend error
platform_time_calibration() is invoked in S3 when irq is disabled,
which causes ASSERT() error in spin_lock_irq(). spin_lock_irqsave()
saves us.
Signed-off-by: Guanqun Lu <guanqun.lu@intel.com>
xen-unstable changeset: 19240:9af46734ce70fcc7e89f3af1ace876652ec9478f
xen-unstable date: Sun Mar 01 14:30:35 2009 +0000
Keir Fraser [Mon, 2 Mar 2009 14:16:42 +0000 (14:16 +0000)]
x86, ioapic: Fix S3 suspend error.
Invoke ioapic_pm_state_alloc() earlier,
thus avoiding check_lock() BUG_ON() in spin_lock().
Signed-off-by: Guanqun Lu <guanqun.lu@intel.com>
xen-unstable changeset: 19239:9cad48ba52b0dd83dfeae014aaac7a16af0585dc
xen-unstable date: Sun Mar 01 14:17:08 2009 +0000
Keir Fraser [Mon, 2 Mar 2009 11:26:44 +0000 (11:26 +0000)]
xen: backport of microcode updates from xen-unstable
18406 x86: constify microcode hypercall argument
18475 x86: microcode update support for AMD CPUs
18481 x86: Fix 32-bit build after AMD microcode update patch.
18483 x86, microcode: Clean up for Xen coding style, and disable for now
18485 x86, microcode: More code cleanups.
18487 x86, microcode: Do not run microcode update in IRQ context.
18488 x86, microcode: Free microcode_info struct at end of hypercall.
18509 x86: Allow continue_hypercall_on_cpu() to be called from within
an existing continuation handler. This fix is needed for the new
method of microcode re-programming.
18519 x86,amd,microcode: fix hypercall return code
19059 x86: update microcode support
From: Hans Rosenfeld <hans.rosenfeld@amd.com> Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Keir Fraser [Fri, 20 Feb 2009 17:03:57 +0000 (17:03 +0000)]
xenconsole: Fix pty handling
I printed the terminal attributes after openpty() and they were
garbage on the first console, valid on the second etc.
openpty() gets garbage in (uninitialized attributes MODIFIED by
cfmakeraw()). It sets the slave to the attributes requested. Using
uninitialized data for cfmakeraw->openpty results in pty attributes
that may even have the receiver disabled. Closing the slave just hides
the bug as these attributes disappear and hope the slave will be
reopened and initialized.
From: Juergen Hannken-Illjes <hannken@netbsd.org> Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
xen-unstable changeset: 19238:f8187a343ad2bdbfe3166d7ee7e3d55a9f157fdc
xen-unstable date: Fri Feb 20 17:02:36 2009 +0000