Commit Graph
21088 Commits
Author SHA1 Message Date
Keir Fraser 5657c1d9cb xend: Fix bug of cpu affinity/ vcpu pin under ia32pae
c/s 21040 and 21044 used to break cpu number limit (<=64).
However, they result in bug under ia32pae model:
1. things will go wrong for affinity, making all vcpus pin to a same
cpu with same time;
2. when 'xm vcpu-pin' vpu to cpu, xend will exit abnormally.

This patch is to fix the bugs described above.

Signed-off-by: Xu, Jiajun <jiajun.xu@intel.com>
Signed-off-by: Zhang, Jianwu <jianwu.zhang@inte.com>
Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
2010-03-30 18:31:39 +01:00
Keir Fraser 7c65239bc4 svm: vmcb intercept enumeration
Attached patch enumerates vmcb intercepts with hexadecimal numbers
additionally. This makes looking up the intercept number easier.
No functional changes.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2010-03-30 18:30:30 +01:00
Keir Fraser fc90bf11d4 Fix off-by-one error in do_memory_op()'s start_extent range check
Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-03-30 13:27:25 +01:00
Keir Fraser 402ce762cb Update Xen version to 4.1-unstable
Development window is open for business!

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-03-30 11:16:25 +01:00
Keir Fraser 5fbe6a6654 Added tag 4.0.0-branched for changeset 91232efdcfdc 2010-03-30 11:09:31 +01:00
Keir Fraser a816129ee9 minios: Trivial spelling typo fixed.
Sigend-off-by: Keir Fraser <keir.fraser@citrix.com>
4.0.0-branched
2010-03-30 08:36:41 +01:00
Keir Fraser 24f2d73938 mcheck: Small fix for CMCI Threshold set problem.
When generating new threshold value, we must firstly clean old value
before or the new set value since the new value might be different
with the old (BIOS might pre-set some threshold).

Signed-off-by: Liping Ke <liping.ke@intel.com>
Signed-off-by: Ying Huang <ying.huang@intel.com>
2010-03-30 08:32:34 +01:00
Keir Fraser e1a5597bc8 x86: Remove redundant clear for cpu_online_map.
Remove it, maybe caused by accident diff operation.

Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
2010-03-30 08:31:52 +01:00
Keir Fraser f17a2b83f7 When flush tlb mask, we need consider the cpu_online_map.
The same is true for EPT flushes.

We noticed sometime system hang on cpu online/offline stress test. The
reason is because flush_tlb_mask from __get_page_type is deadloop.

This should be caused by a small windows in cpu offline.  The
cpu_online_map is changed and the interrupt is disabled at
take_cpu_down() for the to-be-offline CPU.

However, the __sync_lazy_execstate() called from idle_task_exit() in
the idle_loop() for the to-be-offline CPU. At that time, the
stop_machine_run is finished already, and __get_page_type may be
called in other CPU before the __sync_lazy_execstate().

Thanks Jan pointing out issue in my original patch.

Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
2010-03-30 08:31:16 +01:00
Keir Fraser b1ded68a3c pygrub/xend: Fix console plumbing to xenconsole client.
Domain's console tty now lives at serial/0/tty in xenstore.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-03-27 16:01:35 +00:00
Keir Fraser 1e1c984579 xend: Do not set execute permission on qemu-dm log file.
Signed-off-by: Daniel Kiper <dkiper@net-space.pl>
2010-03-27 16:00:30 +00:00
Keir Fraser add2c9e16e Update Xen version to 4.0.0-rc9-pre 2010-03-27 15:59:25 +00:00
Keir Fraser 36f7b3d299 Added tag 4.0.0-rc8 for changeset 542211ba675c 2010-03-26 10:29:46 +00:00
Keir Fraser 5711a484af Update Xen version to 4.0.0-rc8 4.0.0-rc8 2010-03-26 10:29:38 +00:00
Keir Fraser c530aaacc2 cpufreq: don't re-init active dbs timer in S3 or cpu online
Signed-off-by: Wei Gang <gang.wei@intel.com>
2010-03-26 10:28:37 +00:00
Keir Fraser 3915b8679a VT-d: Better DMAR parsing warning message.
Signed-off-by: Weidong Han <weidong.han@intel.com>
2010-03-26 08:50:11 +00:00
Keir Fraser 56d00aa794 cpufreq: fix statistic lock problem
cpufreq_statistic_lock should not only protect the statistic memory
pointed by cpufreq_statistic_data[cpu], but also have to protect the
pointer in cpufreq_statistic_data[cpu] itself. So move the read
operation of cpufreq_statistic_data[cpu] after
spin_lock(cpufreq_statistic_lock).

Signed-off-by: Wei Gang <gang.wei@intel.com>
2010-03-26 08:49:13 +00:00
Keir Fraser b8352255b3 shadow: Don't crash xen if hvm_read() from paged or shared memory
There are two new return cases from hvm_copy_from_guest_virt() to deal
with paging or shared memory -- retry the emulation rather than
crash.

Signed-off-by: Steven Hand <steven.hand@cl.cam.ac.uk>
2010-03-26 08:48:08 +00:00
Keir Fraser daf911baab xenpaging: Fix ioemu invalidation
xs_write takes the length of the string being written, not the
path.

Signed-off-by: Steven Hand <steven.hand@cl.cam.ac.uk>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-03-26 08:45:45 +00:00
Keir Fraser 682d29d954 xl: field 'type' not set in dm_info
This fixes a bug that makes xl start qemu without the FV/PV specific
options.

From: Jean-Edouard LEJOSNE <jean-edouard.lejosne@citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Acked-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-03-26 08:43:36 +00:00
Keir Fraser 024ce79aea VT-d: should not disable VT-d when find unknown DMAR structure type
Now 4 DMAR structure types are supported (type value 0 ~ 3). Type
values > 3 are reserved for future use. Current implementation
disables VT-d when find unknown DMAR structure type, this may lead to
VT-d disabling on future platforms before supporting new types on
Xen. For forward compatibility, just skip unknown structures by
skipping the appropriate number of bytes indicated by the Length
field, and then VT-d still can be used.

Signed-off-by: Weidong Han <weidong.han@intel.com>
2010-03-25 10:01:05 +00:00
Keir Fraser f81bf6953c VT-d: Sanity check ACPI DMAR struct lengths.
Signed-off-by: Weidong Han <weidong.han@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-03-25 09:32:21 +00:00
Keir Fraser 5fead6d675 x86: s3: write_msi_msg: entry->msg should be in the compatibility format
When Interrupt Remapping is used, after Dom0 S3, Dom0's filesystem
might become inaccessible as the SATA disk's MSI interrupt becomes
buggy.  The cause is: After set_msi_affinity() or setup_msi_irq()
invokes write_msi_msg(), entry->msg records the remappable format
message; during S3 resume, Dom0 invokes the PHYSDEVOP_restore_msi
hypercall to restore the MSI registers of devices, and in
pci_restore_msi_state() -> write_msi_msg(), the 'entry->msg' of
remappable format is passed, but in write_msi_msg() -> ... ->
msi_msg_to_remap_entry(), the 'msg' is assumed to be in compatibility
format.  As a result, after s3, the IRTE is corrupted.

Actually the only users of 'entry->msg' are pci_restore_msi_state()
and dump_msi(). That's why we don't have issue except Dom0 S3.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2010-03-25 09:19:33 +00:00
Keir Fraser 7b203cca89 VT-d: change RHSA structure to be consistent with spec
'Reserved' field is missed in current RHSA structure, and move the
'proximity domain' field to the bottom. In addition, fix some indent
issues.

Signed-off-by: Weidong Han <weidong.han@intel.com>
2010-03-25 07:43:09 +00:00
Keir Fraser 8c2f103b22 Fix gdbserver-xen support on older kernels.
The xc_ptrace API relies on errno for passing success/failure
indication back to callers.  However, mapping operations that fall
back on legacy APIs may leave errno set to a non-zero result even
thought the operation is successful.  This patch resets errno after
successful map operations so that xc_ptrace doesn't inadvertently
return a failure.

Signed-off-by: Justin Gibbs <gibbs@scsiguy.com>
2010-03-25 07:41:55 +00:00
Keir Fraser 6e4406161b Update QEMU_TAG to f1d909f0f854194f5a40d850886d1413fb8b63c2 2010-03-25 07:40:40 +00:00
Keir Fraser e96781896f x86: fix improper return value from relinquish_memory()
While apparently only a theoretical possibility (domain_kill() has a
BUG_ON() that wasn't reported to trigger so far), I still think it is
better to have the code cleaned up.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-03-25 07:40:09 +00:00
Keir Fraser 13e06c3908 Fix 21051:bcc09eb7379f "x86_32: Relocate multiboot modules to below 1GB."
Copy the modules in ascending order in memory, rather than decsending
order. This reduces the likelihood of the second relocation (in
setup.c) corrupting modules through accidental overwriting.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-03-24 11:06:48 +00:00
Keir Fraser 6a9ca8b206 VT-d: avoid faulting in print_iommu_regs()
In c/s 21027 I overlooked that using this function when bad table data
was found requires the function to also do some range checking.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-03-24 11:05:06 +00:00
Keir Fraser 0673a21c07 Update Xen version to 4.0.0-rc8-pre 2010-03-24 11:04:05 +00:00
Keir Fraser 8650503190 Update 4.0.0-rc7 tag 2010-03-23 09:37:59 +00:00
Keir Fraser 04fafd58b5 x86: s3: ensure CR4.MCE is enabled after mcheck_init()
Changeset 21045: 7751288b1386 introduces a potential issue: CR4.MCE is
enabled before mcheck_init() -- thought looks I don't meet with an
actual issue with this, we'd better fix it.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
4.0.0-rc7
2010-03-23 09:35:31 +00:00
Keir Fraser 596fd1fc3e Added tag 4.0.0-rc7 for changeset b8f8b07e0076 2010-03-23 07:32:04 +00:00
Keir Fraser 11c3ebfd58 Update Xen version to 4.0.0-rc7 2010-03-23 07:31:48 +00:00
Keir Fraser 3e5c1b3af9 Update QEMU_TAG to 73cef2cca413c17f314724c66194315038ea66c3 2010-03-23 07:29:51 +00:00
Keir Fraser fc1a26595e xend: fix traceback in pci.py
Signed-off-by:  Jim Fehlig <jfehlig@novell.com>
2010-03-23 07:29:10 +00:00
Keir Fraser 61ecce504b x86_32: Relocate multiboot modules to below 1GB.
Otherwise Xen cannot access them later during boot. GRUB2 places
modules as high as possible below 4GB, which has been causing boot
failure.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-03-23 07:28:33 +00:00
Keir Fraser 5bc8ad3bb7 No cpu_add_remove_lock in do_boot_cpu.
The do_boot_cpu() will be called when system booting or CPU
online. When system booting, we don't need hold this lock. When system
online, the lock is held already by cpu_up.

Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
2010-03-22 10:29:42 +00:00
Keir Fraser 21980127e6 Do not spin on locks that may be held by stop_machine_run() callers.
Currently stop_machine_run() will try to bring all CPUs to softirq
context, with some locks held, like xenpf_lock or cpu_add_remove_lock
etc. However, if another CPU is trying to get these locks, it may
cause deadlock.

This patch replace all such spin_lock with spin_trylock. For
xenpf_lock and sysctl_lock, we try to use hypercall_continuation, so
that we will not cause trouble to user space tools. For
cpu_hot_remove_lock, we simply return EBUSY if failure, since it will
only impact small number of user space tools.

In the end, we should try to make the stop_machine_run as spinlock
free.

Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
2010-03-22 10:29:13 +00:00
Keir Fraser 0786329634 ns16550: Do not re-init active timer on S3 resume.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-03-22 10:24:17 +00:00
Keir Fraser 978f36d60a Fix vcpu hotplug bug: transfer vcpu_avail hex string to qemu
Currently qemu has a bug: When maxvcpus > 64, qemu will get wrong
vcpu bitmap (s->cpus_sts[i]) since it only get bitmap from a long
variable.

This patch, cooperate with another qemu patch, is to fix this bug.
This patch transfer a vcpu_avail string in a hex string format, so
that at qemu side it's more easier to get vcpu bitmap from hex string,
especially when many vcpus, like more than 64.

(Also update QEMU_TAG for matching qemu-side update)

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
2010-03-20 07:35:04 +00:00
Keir Fraser 9d35e7f374 cpufreq: make non-verbose by default
Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-03-18 11:03:07 +00:00
Keir Fraser 7f6331edab x86: fix dom0 S3 when x2apic is used.
1) Some variables and functions in xen/arch/x86/genapic/x2apic.c
should not be marked with __init* as they will be used during s3
resume;
2) In do_suspend_lowlevel -> restore_rest_processor_state ->
mcheck_init, lapic is accessed, but x2apic hasn't been re-enabled yet
(x2apic is re-enabled() in device_power_up -> lapic_resume). The patch
moves mcheck_init to a later place.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2010-03-18 11:02:25 +00:00
Keir Fraser caf500204f Fixes for 21040:b64a8d2a80ad "support affinity for >64 CPUs"
Signed-off-by: James (Song Wei) <jsong@novell.com>
2010-03-18 07:44:21 +00:00
Keir Fraser ae695978a6 Improve graphical console performance
As it is pretty pointless to clear unused parts of a line over and
over again, keep track of how much of a line was actually written
to and avoid clearing parts of the screen that are known to already
be clear. With this, scrolling speed becomes comparable to that of
Linux' VESA console.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-03-17 14:10:43 +00:00
Keir Fraser 5e827c9822 x86: suppress pointless Xen messages from ioapic_guest_write()
Previously, these messages were only issued when old and new RTE
differed. Make it so again (requiring adjustment of the guest provided
RTE as that no longer holds a real vector).

While at it, also make the "allocated vector for irq" message more
useful and occur when what it says really happened.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-03-17 14:09:55 +00:00
Keir Fraser cdffe59f08 Fix a race condition for cpufreq dbs timer while S3 resuming
The cpufreq_dbs_timer_suspend/resume may race with dbs_timer_init
while s3 resuming before this patch.
This patch along with cset 21030 fix the bug 1586
http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=1586.

Signed-off-by: Yu Ke <ke.yu@intel.com>
Signed-off-by: Wei Gang <gang.wei@intel.com>
2010-03-17 09:18:34 +00:00
Keir Fraser 5a4d4554c3 libxc: Support set affinity for more than 64 CPUs.
There are more than 64 cpus on new intel platform especially on NUMA
system, so that we need break the pcpu limit (that is 64)  when set
affinity of a VCPU.

Signed-off-by: James (song wei) <jsong@novell.com>
2010-03-17 09:17:27 +00:00
Keir Fraser c4b4b6ac3b VT-d: reduce default verbosity
Introduce a new sub-option "verbose" to "iommu=", and hide most
(debugging) messages when that option is not specified. Particularly
messages printed after time management was initialized can, on
sufficiently large systems and with a graphical console, lead to
time management issues (therefore a call to process_pending_softirqs()
also gets added in case the new sub-option is being used).

While touching that code, also convert all improper uses of gdprintk()
to dprintk(), and convert all boolean iommu config variables to bool_t
residing in the .data.read_mostly section.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-03-17 08:35:13 +00:00
Keir Fraser 35d60c59af Increase default console ring allocation size and reduce default verbosity
In order to have better chance that relevant messages fit into the
ring buffer, allocate a dynamic (larger) one in more cases, and make
the default allocation size depend on both the number of CPUs and the
log level. Also free the static buffer if a dynamic one was obtained.

In order for "xm dmesg" to retrieve larger buffers, eliminate
pyxc_readconsolering()'s 32k limitation resulting from the use of a
statically allocated buffer.

Finally, suppress on x86 most per-CPU boot time messages (by default,
most of them can be re-enabled with a new command line option
"cpuinfo", some others are now only printed more than once when there
are inconsistencies between CPUs). This reduces both boot time (namely
when a graphical console is in use) and pressure on the console ring
and serial transmit buffers.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-03-17 08:34:16 +00:00