Commit Graph
21124 Commits
Author SHA1 Message Date
Keir Fraser 002c5bcdbe Refactor Xen Support for Intel Turbo Boost
Refactor the existing code that supports the Intel Turbo feature to
move all the driver specific bits in the cpufreq driver.  Create
a tri-state interface for the Turbo feature that can distinguish
amongst enabled Turbo, disabled Turbo, and processors that don't
support Turbo at all.

Signed-off-by: Mark Langsdorf <mark.langsdorf@amd.com>
2010-04-09 08:52:43 +01:00
Keir Fraser e136054ced libxl: Fix the build by reinstating some sysctl.physinfo fields.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-04-08 16:11:17 +01:00
Keir Fraser 2293eaf330 Fix two issues for CPU online/offline.
Firstly, we should return if we fail to get spin lock in cpu_down.
Secondly, in credit scheduler, the idlers need be limited only to
online map.

Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
2010-04-08 15:31:52 +01:00
Keir Fraser 6c87eec55a tmem: fix ia64 build
/xen/common/built_in.o: In function `tmh_get_first_byte':
  /xen/include/xen/tmem_xen.h:350: undefined reference to
  `__map_domain_page'

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
2010-04-08 15:31:21 +01:00
Keir Fraser 750b06dbd9 xen: allow guests to set caching attributes for MMIOs
This patch allows guests that have directly mapped MMIO regions to set
the caching attributes for them, and only for them.
Currently we have just an on/off check for a directly assigned device
instead of looking for directly mapped MMIO regions.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2010-04-08 15:30:52 +01:00
Keir Fraser 4d6e834ba9 Host Numa information in dom0
'xm info' command now also gives the cpu topology & host numa
information. This will be later used to build guest numa support.  The
patch basically changes physinfo sysctl, and adds topology_info &
numa_info sysctls, and also changes the python & libxc code
accordingly.

Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
2010-04-07 16:22:05 +01:00
Keir Fraser 35e9666fc4 Revert 21110:d791173ca65b and 21111:986d3b1d30fb
Break automated tests.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-04-07 15:44:29 +01:00
Keir Fraser ab3575f913 x86: Fix caller of p2m_init(): cannot use paging_mode_hap() yet.
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Tim Deegan <Tim.Deegan@citrix.com>
2010-04-07 10:17:27 +01:00
Keir Fraser cdabe14bff mini-os: Fix xenbus_switch_state's transaction retry
When xenbus_switch_state has to retry the transaction which it just
created, it needs to recreate another one.  Clearing xbt triggers it.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2010-04-07 08:17:21 +01:00
Keir Fraser 15d5739ea9 mini-os: Fix crash on frontend shutdown failures
Do not free frontend resources if some error happened, since the
backend may not have finished properly restarting in such case.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2010-04-07 08:16:15 +01:00
Keir Fraser 42e3a21b11 mini-os: Fix frontend shutdown wait loop
minios frontends must wait for backends to be shut down and
reinitialized before freeing resources.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2010-04-07 08:15:55 +01:00
Keir Fraser 449e0d3d0e Fix 32bit PAE compilation error introduced by 1GB patches
Signed-off-by: Wei Huang2 <wei.huang2@amd.com>
2010-04-07 08:15:33 +01:00
Keir Fraser 8aa77c0ef1 Update git clone command
When cloning the kernel repo:
   1. make remote called "xen" rather than the default "origin"
   2. directly checkout the desired branch in one step

Signed-off-by: Jeremy Fitzhardinge<jeremy.fitzhardinge@citrix.com>
2010-04-07 08:14:34 +01:00
Keir Fraser 715dd40aed Switch default kernel branch to xen/stable-2.6.31.x
This is functionally identical to xen/master at the moment, but more
meaningful.

Signed-off-by: Jeremy Fitzhardinge<jeremy.fitzhardinge@citrix.com>
2010-04-07 08:13:20 +01:00
Keir Fraser f2dcefdc7b x86, cpu hotplug: Synchronise vcpu state earlier during cpu offline.
Needs to happen before non-idle VCPU is fully descheduled after CPU is
removed from cpu_online_map. Else sync_vcpu_execstate() doesn't work
properly.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-04-07 08:09:00 +01:00
Keir Fraser 0273e627ed Enable debug=y by default in the build.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-04-06 07:16:47 +01:00
Keir Fraser 2dcbce9769 EPT: 1GB large page support.
Alloc 1GB large page for EPT if possible. It also contains the logic
to split large page into small ones (2M or 4K).

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Xiaohui Xin <xiaohui.xin@intel.com>
Acked-by: Tim Deegan <Tim.Deegan@citrix.com>
2010-04-06 07:14:56 +01:00
Keir Fraser 453c7b6442 mini-os: Fix xenbus initialisation
This fixes xenbus initialization of blkfront, netfront and pcifront
by uniformizing with fbfront: after writing parameters, set state to
initialised, then wait for backend to switch to connect state, and
then only read its parameter and switch to the connect state.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2010-04-06 07:13:19 +01:00
Keir Fraser efdf57d613 pv-grub: fix boot crash when no fb is available
When no fb is available, init_fbfront will return, so the local
semaphore for synchronization with the kbd thread would get dropped.
Using a global static semaphore instead fixes this.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2010-04-06 07:13:01 +01:00
Keir Fraser d98d3c5208 mini-os: Do not use the same wait element twice
To enqueue the kbdfront thread on two separate wait queues, we need
two different wait elements.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2010-04-06 07:12:39 +01:00
Keir Fraser 38c433d0c7 tmem: add page deduplication with optional compression or trailing-zero-elimination
Add "page deduplication" capability (with optional compression
and trailing-zero elimination) to Xen's tmem.

(Transparent to tmem-enabled guests.)  Ephemeral pages
that have the exact same content are "combined" so that only
one page frame is needed.  Since ephemeral pages are essentially
read-only, no C-O-W (and thus no equivalent of swapping) is
necessary.  Deduplication can be combined with compression
or "trailing zero elimination" for even more space savings.

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
2010-04-06 07:11:48 +01:00
Keir Fraser 6a9ee8cf21 1GB Page Table Support for HVM Guest 3/3
This patch adds a new field in hvm to indicate 1gb is supported by
CPU.  In addition, users can turn 1GB feature on/off using a Xen
option ("hap_1gb", default is off). Per Tim's suggestion, I also add
an assertion check in shadow/common.c file to prevent affecting shadow
code.

Signed-off-by: Wei Huang <wei.huang2@amd.com>
Acked-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Tim Deegan <tim.deegan@citrix.com>
2010-04-06 07:09:35 +01:00
Keir Fraser 270ed5c14a 1GB Page Table Support for HVM Guest 2/3
This patch changes P2M code to works with 1GB page now.

Signed-off-by: Wei Huang <wei.huang2@amd.com>
Acked-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Tim Deegan <tim.deegan@citrix.com>
2010-04-06 07:07:37 +01:00
Keir Fraser ff61ed41ee 1GB Page Table Support for HVM Guest 1/3
This patch changes Xen tools to allocate 1GB first. If such requests
fail, it will fall back to 2MB and then 4KB. We skip 1GB allocation
for the MMIO space between 3GB and 4GB.

Signed-off-by: Wei Huang <wei.huang2@amd.com>
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Tim Deegan <tim.deegan@citrix.com>
2010-04-06 07:02:17 +01:00
Keir Fraser e4434634c4 CSCHED: Optimize __runq_tickle to reduce IPIs
Limiting the number of idle cpus tickled for vcpu migration purpose
to ONLY ONE to get rid of a lot of IPI events which may impact the
average cpu idle residency time.

The default on option 'tickle_one_idle_cpu=0' can be used to disable
this optimization if needed.

Signed-off-by: Wei Gang <gang.wei@intel.com>
2010-04-06 06:59:32 +01:00
Keir Fraser b97d94b4ef xl: tsc_mode parameter in guest configuration file
Signed-off-by: Eric Chanudet <eric.chanudet@citrix.com>
Acked-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2010-04-06 06:56:20 +01:00
Keir Fraser 56a5e4b778 xl: vcpu-set command
Signed-off-by: Eric Chanudet <eric.chanudet@citrix.com>
Acked-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2010-04-06 06:55:37 +01:00
Keir Fraser aa2fb6ae52 xl: vcpu-pin command
Signed-off-by: Eric Chanudet <eric.chanudet@citrix.com>
Acked-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2010-04-06 06:54:51 +01:00
Keir Fraser 5b739df3d3 xl: vcpu-list command
Signed-off-by: Eric Chanudet <eric.chanudet@citrix.com>
Acked-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2010-04-06 06:54:08 +01:00
Keir Fraser 3d521e933e cpuidle: mwait on softirq_pending & remove wakeup ipis
For cpu which enter deep C state via monitor/mwait, wakeup can be done
by writing to the monitored memory. So once monitor softirq_pending,
we can remove the redundant ipis.

Signed-off-by: Yu Ke <ke.yu@intel.com>
Signed-off-by: Wei Gang <gang.wei@intel.com>
2010-04-06 06:52:11 +01:00
Keir Fraser 4e8bf17138 x86: use paging_mode_hap() consistently
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2010-04-06 06:51:04 +01:00
Keir Fraser 2b6f2f6805 Allow all unused GSI to be configured via IO-APIC by new pv_ops dom0
Currently Xen disallows setting up any GSI < 16. This makes it
impossible by the kernel to use any PCI devices without ACPI override
but a mapping to this interrupts via IO-APIC.

The patch allows all unused interrupts to be setup via IO-APIC.

Signed-off-by: Bastian Blank <waldi@debian.org>
2010-04-01 09:55:27 +01:00
Keir Fraser 3ccd588bf1 hvm: merge efer check
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-04-01 09:47:49 +01:00
Keir Fraser 147808b8b8 x86/hvm: accelerate I/O intercept handling
currently we go through the emulator every time a HVM guest does an
I/O port access (in/out). This is unnecessary most of the times, as
both VMX and SVM provide all the necessary information already in the
VMCS/VMCB.  String instructions are not covered by this shortcut, but
they are quite rare and we would need to access the guest memory
anyway.  This patch decodes the information from VMCB/VMCS and calls a
simple handle_mmio wrapper. In handle_mmio() itself the emulation part
will simply be skipped, this approach avoids code duplication.  Since
the vendor specific part is quite trivial, I implemented both the VMX
and SVM part, please check the VMX part for sanity.

I boot-tested both versions and ran some simple benchmarks.  A micro
benchmark (hammering an I/O port in a tight loop) shows a significant
performance improvement (down to 66% of the time needed to handle the
intercept on an AMD K8, measured in the guest with TSC).  Even with
reading a 1GB file from an emulated IDE harddisk (Dom0 cached) I could
get a 4-5% improvement.  Some guest code (e.g. the TCP stack in some
Windows version) exercises the PM-Timer I/O port (0x1F48) very often
(multiple 10,000 times per second), these workloads also benefit with
up to 5% improvement from this patch.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
2010-03-31 10:21:19 +01:00
Keir Fraser 75cc04fb68 x86: start PCI IRQs Xen uses from Dom0-invoked io_apic_set_pci_routing()
When using a serial port from an add-in PCI card, and that IRQ is (as
usual) outside of the legacy range (0...15), Xen would never really
enable the IRQ, as at the time setup_irq() runs the handler for the
IRQ still is &no_irq_type. Consequently, once the trigger mode and
polarity of the interrupt become known to Xen, it should start such
IRQ(s) it uses for itself.

The question is whether the same should also be done in
ioapic_guest_write(): Legacy kernels don't use PHYSDEVOP_setup_gsi
(and hence don't trigger the code path modified).

Note however that even when a kernel is using PHYSDEVOP_setup_gsi in
the way the pv-ops kernel currently does, there's still no guarantee
that the call would ever be issued for IRQs Xen may be using, since
this happens only when devices get enabled. For Xen's purposes, this
function should be called for *all* device IRQs, regardless of
whether those would actually be (attempted to be) used by the kernel,
i.e. in a subsys_initcall() from drivers/acpi/pci_irq.c iterating
over all PCI devices and doing mostly what acpi_pci_irq_enable() does
except for calling this function in place of acpi_register_gsi(). The
downside of this approach is that without extra filtering in Xen
(based on a hint from Dom0), vectors will then get up even for IRQs
that are unused by both hypervisor and kernel.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-03-31 10:12:29 +01:00
Keir Fraser f2ff5d6628 ns16550: enable PCI serial card usage
On some machine, there is no build-in serial port and no LPC
connection. To use serial port, we have to plug in a serial
card. Sometime BIOS doesn't enable the BARs for the PCI devices which
lead to that Xen can't use the add-in serial port for early log
print. This patch try to initialize the serial card and related PCI
bridge to make it usable for xen.

Usage:

Step 1. boot into bare metal Linux, get the information for the PCI
serial ports and the related PCI bridge. On my case:

#lspci -v
00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev 90)
(prog-if 01     [Subtractive decode])
        Bus: primary=00, secondary=06, subordinate=06, sec-latency=32
        I/O behind bridge: 00005000-00005fff

06:02.0 Serial controller: Lava Computer mfg Inc Lava DSerial-PCI Port
A (prog-if 02 [16550])
        Region 0: I/O ports at 5000 [size=8]

Step 2. revise the grub.conf to include
'com1=115200,8n1,0xPPPP,0,<port-bdf>,<bridge-bdf> console=com1' for
xen cmdline. The 0xPPPP is the base I/O port address got for the
serial port in bare metal Linux. For my case, it is 0x5000. The 0
after 0xPPPP means enable polling model for the serial port. The
<port-bdf> is the serial port BDF, 06:02.0 in my case; the
<bridge-bdf> is the bridge BDF bebind which the serial card locates,
00:1e.0 for my case.

Signed-off-by: Wei Gang <gang.wei@intel.com>
2010-03-31 10:11:41 +01:00
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