Commit Graph
18932 Commits
Author SHA1 Message Date
Keir Fraser e8a33bc38f rombios: Update to Bochs latest
Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
2008-12-18 14:52:53 +00:00
Keir Fraser dce021d06a xenoprof: Add support for Intel Dunnington cores.
Signed-off-by: Xiaowei Yang <Xiaowei.yang@intel.com>
Signed-off-by: Ting Zhou <ting.g.zhou@intel.com>
2008-12-18 11:29:33 +00:00
Keir Fraser 2f0f4ad09f x86, shadow: Avoid duplicates in fixup tables.
Avoid entering duplicates in fixup tables, reducing fixup evictions.

Signed-off-by: Gianluca Guida <gianluca.guida@eu.citrix.com>
2008-12-18 11:28:25 +00:00
Keir Fraser cea7a6cd7b Fix mini-os ia64 compilation
- Avoid nested function to avoid a trampoline.
- Do not link mini-os_app.o when it is empty.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2008-12-18 11:27:37 +00:00
Keir Fraser 6840dfbbd0 x86, hvm: Don't ever call the shadow code to fix a page fault in an
external-mode guest if the fault came from Xen; it would be making
changes to the wrong pagetables, potentially causing a pagefault loop
in Xen.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2008-12-17 11:36:22 +00:00
Keir Fraser 75e06d089d xenpm: add cpu frequency control interface, through which user can
tune the parameters manually.

Now, xenpm can be invoked with the following options:
Usage:
       xenpm get-cpuidle-states [cpuid]: list cpu idle information on
       CPU cpuid or all CPUs.
       xenpm get-cpufreq-states [cpuid]: list cpu frequency
       information on CPU cpuid or all CPUs.
       xenpm get-cpufreq-para [cpuid]: list cpu frequency information
       on CPU cpuid or all CPUs.
       xenpm set-scaling-maxfreq <cpuid> <HZ>: set max cpu frequency
       <HZ> on CPU <cpuid>.
       xenpm set-scaling-minfreq <cpuid> <HZ>: set min cpu frequency
       <HZ> on CPU <cpuid>.
       xenpm set-scaling-governor <cpuid> <name>: set scaling governor
       on CPU <cpuid>.
       xenpm set-scaling-speed <cpuid> <num>: set scaling speed on CPU
       <cpuid>.
       xenpm set-sampling-rate <cpuid> <num>: set sampling rate on CPU
       <cpuid>.
       xenpm set-up-threshold <cpuid> <num>: set up threshold on CPU
       <cpuid>.

To ease the use of this tool, the shortcut option is supported,
i.e. `xenpm get-cpui' is equal to `xenpm get-cpuidle-states'.

Signed-off-by: Guanqun Lu <guanqun.lu@intel.com>
2008-12-16 13:14:25 +00:00
Keir Fraser f771f7ffce x86: Update xen-detect utility to scan for Xen signature in CPUID space.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-12-16 12:04:13 +00:00
Keir Fraser c32ea44041 mini-os: Make utility function get_self_id() in fs-front.c public.
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2008-12-16 12:00:25 +00:00
Keir Fraser 1b6a99892d x86: Simpler time handling when TSC is constant across all power saving states.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Signed-off-by: Gang Wei <gang.wei@intel.com>
2008-12-16 11:59:22 +00:00
Keir Fraser 25c2bce46a vmx: Do not disable real EFER.NXE even when disabled by guest.
We must not disable EFER.NXE in host mode since shadow code relies on
accessing shadow mappings with NX set.

We do not want to write EFER on every vmentry/vmexit if we can avoid
it, since it will be somewhat slow.

Finally, we don't believe that any guest relies on NX really being
disabled when EFER.NXE is cleared.

This given, it makes sense to ignore the guest's setting of EFER.NXE.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-12-16 11:54:11 +00:00
Keir Fraser 74d59a59e2 x86: Enable MTF for HVM guest single step in gdb
Signed-off-by: Edwin Zhai <edwin.zhai@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-12-16 11:49:20 +00:00
Keir Fraser 53e5cd08ef x86: Decode CPUID for TSC guarantees.
Signed-off-by: Wei Gang <gang.wei@intel.com>
2008-12-15 11:37:14 +00:00
Keir Fraser a0c46b435d rombios: fix references to EBDA
Extended Bios Data Area (EBDA) can be relocated by the initialization
of PCI option ROM. The IPL boot table is also.
EBDA must be accessed via 0x40E after the initialization.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2008-12-15 11:23:22 +00:00
Keir Fraser f2f78ed2c8 x86: Small cleanups to time handling.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-12-15 11:17:14 +00:00
Keir Fraser 158b608e1d xenpmd: Fix bogus fgets() size parameter.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-12-13 17:44:20 +00:00
Keir Fraser 0a383abeed x86: Clean up and simplify rwlock implementation.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-12-13 15:56:16 +00:00
Keir Fraser 27480e5830 Clean up use of spin_is_locked() and introduce rw_is_locked().
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-12-13 15:28:10 +00:00
Keir Fraser 0347bade8b xc_pm: Fix off-by-one error in string array access.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2008-12-13 15:04:53 +00:00
Keir Fraser cd914ce249 x86: Fix early time initialisation after recent changes.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-12-13 15:02:55 +00:00
Keir Fraser 050404c847 xentop: Fix fprintf() build failure.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-12-11 22:32:20 +00:00
Keir Fraser 20553adcd9 hvmloader: enable bus mastering of PCI device
Without this, init routine in some PCI option ROM doesn't work well.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2008-12-11 13:26:02 +00:00
Keir Fraser 4fef1ea1f4 x86: enable interrupts explicitly in __start_xen()
Instead of relying on smp_prepare_cpus() (via check_nmi_watchdog()) or
init_xen_time() (via init_platform_timer() -> plt_overflow())
implicitly enabling interrupts, enable them explicitly once safe to do
so (it may actually be possible to move this even further up, but I
don't think that would buy us much).

Signed-off-by: Jan Beulich <jbeulich@novell.com>

Also move spin_debug_enable() a bit higer. Moving it above
smp_prepare_cpus() didn't work for some reason though!

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-12-11 13:25:28 +00:00
Keir Fraser cc7efb8785 x86: Clean up early time setup.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-12-11 13:10:19 +00:00
Keir Fraser 1d278a475a vga: Only vga_endboot() if vga_init() completed.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-12-11 13:09:59 +00:00
Keir Fraser bda5925b83 x86, cpufreq: Change cpufreq_driver->get so that it can get other
cpu's real physical freq.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
2008-12-11 11:49:37 +00:00
Keir Fraser 57b0566668 Re-enable MSI support
Currently the MSI is disabled because of some lock issue. This patch
tries to clean up the locking related to MSI lock.

Signed-off-by: Jiang Yunhong <yunhong.jiang@intel.com>
2008-12-11 11:48:19 +00:00
Keir Fraser 849bd717c2 x86: fix the potential of encountering panic "IO-APIC + timer doesn't work! ..."
Signed-off-by: Jan Beulich <jbeulich@novell.com>

Linux commit:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=4aae07025265151e3f7041dfbf0f529e122de1d8

x86: fix "Kernel panic - not syncing: IO-APIC + timer doesn't work!"

Under rare circumstances we found we could have an IRQ0 entry while we
are in the middle of setting up the local APIC, the i8259A and the
PIT. That is certainly not how it's supposed to work! check_timer()
was supposed to be called with irqs turned off - but this eroded away
sometime in the past. This code would still work most of the time
because this code runs very quickly, but just the right timing
conditions are present and IRQ0 hits in this small, ~30 usecs window,
timer irqs stop and the system does not boot up. Also, given how early
this is during bootup, the hang is very deterministic - but it would
only occur on certain machines (and certain configs).

The fix was quite simple: disable/restore interrupts properly in this
function. With that in place the test-system now boots up just fine.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2008-12-11 11:40:10 +00:00
Keir Fraser 3bc61439ad x86: unify local_irq_XXX()
This also removes an inconsistency in that x86-64's __save_flags() had
a memory clobber, while x86_32's didn't.

It further adds type checking since blindly using {pop,push}{l,q} on a
memory operand of unknown size bares the risk of corrupting other
data.

Finally, it eliminates the redundant (with local_irq_restore())
__restore_flags() macro and renames __save_flags() to
local_save_flags(), making the naming consistent with Linux (again?).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2008-12-11 11:36:00 +00:00
Keir Fraser 3245eb0237 rombios: fix rom_scan (ja->jmp)
Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2008-12-11 11:32:39 +00:00
Keir Fraser 9fde610c7b Fix a typo caused by 18898.
new state is updated too early.

Signed-off-by: Kevin Tian <kevin.tian@intel.com>
2008-12-11 11:30:13 +00:00
Keir Fraser ecdcad9ec5 cpufreq: Short path avoiding IPI in critical fast path.
Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-12-11 11:27:49 +00:00
Keir Fraser de8ffdf6a4 libxc: Fix xc_pm.c build by avoiding bogus header includes.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-12-11 11:19:27 +00:00
Keir Fraser c8e857a0af Fix BUILD_BUG_ON()
As was noticed on the Linux side, using an array here isn't appropriate
if the condition is not a compile time constant - gcc allows such
arrays, and hence the intended effect of producing a compiler error is
not achieved in that case. Bit field widths do not know similar
language extensions, and hence always produce a compiler error.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2008-12-11 11:19:01 +00:00
Keir Fraser aa9c440212 Avoid negative runstate pieces.
Also consolidate all places to get cpu idle time.

Signed-off-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-12-10 14:05:41 +00:00
Keir Fraser 7132ae7e55 Initialize state_entry_time to zero for all idle vcpus
NOW() is not usable since xen time sub-system hasn't
been initialized yet. On my box, it gives a initial
stamp ~60s due to local tsc stamp as zero and TSC
count is started from power on. Then a negative value
is added to runstate of that idle vcpu at schedule
point. The net effect is for some tool like xenpm
to show a big idle time gap between BSP and other APs.

Signed-off-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-12-10 13:41:34 +00:00
Keir Fraser 00118705d4 x86: Make MCE panic message more obvious
Make it more obvious to the untrained user that machine check reboots
are hardware faults, rather then just saying "CPU context corrupt".

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2008-12-10 13:30:10 +00:00
Keir Fraser a654ad01a7 gdbserver: Fix build failure.
From: Edwin Zhai <edwin.zhai@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-12-10 13:28:58 +00:00
Keir Fraser 7542c4ff00 Add user PM control interface
Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
2008-12-10 13:27:41 +00:00
Keir Fraser 630b671347 Add cpufreq governors: performance, powersave, userspace
This patch add 3 more governors beside original running ondemand
cpufreq governor.
performance governor is with best performance, keeping cpu always
running at highest freq;
powersave governor is with best power save effect, keeping cpu always
running at lowest freq;
userspace governor provide user setting freq ability;

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
2008-12-10 13:27:14 +00:00
Keir Fraser ac677794d6 libxc: Fix memory leak in zlib usage
Any call to inflate() must be followed by inflateEnd(), otherwise the
internal zlib state is leaked.

Signed-off-by: Kevin Wolf <kwolf@suse.de>
2008-12-10 13:14:13 +00:00
Keir Fraser 8d4638d15e Use virtual 8086 mode for VMX guests with CR0.PE == 0
When a VMX guest tries to enter real mode, put it in virtual 8086 mode
instead, if that's possible.  Handle all errors and corner cases by
falling back to the real-mode emulator.

This is similar to the old VMXASSIST system except it uses Xen's
x86_emulate emulator instead of having a partial emulator in the guest
firmware.  It more than doubles the speed of real-mode operation on
VMX.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2008-12-09 16:28:02 +00:00
Keir Fraser dbc75f4a5b vga: Fix screen clear at end of Xen bootstrap.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-12-09 13:23:15 +00:00
Keir Fraser 68974ff128 pv-on-hvm: add pvSCSI frontend
Signed-off-by: Tomonari Horikoshi <t.horikoshi@jp.fujitsu.com>
Signed-off-by: Jun Kamada <kama@jp.fujitsu.com>
2008-12-09 13:06:19 +00:00
Keir Fraser 530cff8bab pv-on-hvm: fix for Centos 5.2
From: Yoshisato YANAGISAWA <yanagisawa.yoshisato@lab.ntt.co.jp>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-12-09 13:00:52 +00:00
Keir Fraser 68771db155 VT-d: check return value of pirq_guest_bind()
The eliminates a hypervisor crash when the respective domain dies or
gets the device hot removed.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Reviewed-by: Weidong Han <weidong.han@intel.com>
2008-12-09 12:55:29 +00:00
Keir Fraser 6ac1537ba7 tools: Fix a few error-path memory leaks.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-12-09 12:53:19 +00:00
Keir Fraser b90edb337d xend: Remember bootable flag for vbds in xenstore
When xend is restarted, bootable flags of all disk devices are lost
and then the first disk is marked as bootable by a "compatibility
hack". When a guest domain is created with a mixture of several vbd
and tap devices, the compatibility hack may fail to choose the right
bootable device. Thus preventing the guest to be restarted. This patch
fixes this behavior by remembering bootable flag for each disk device
in xenstore database.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2008-12-09 12:45:45 +00:00
Keir Fraser ce4d300de0 xend: Fix memory allocation bug after hvm reboot in numa system
Recently we find a bug on Nahelem machine (totally with two nodes, 6G
memory (3G in each node):
- Start a HVM guest with its all VCPUS pinned to node1, so all its
memory is allocated from node1.
- Reboot the HVM.
- There will be some memory allocated from node0 even there is enough
free memory on node1.

Reason: For security issues, xen will not put all the pages of a dying
hvm to domheap directly, but put them in scrub list and wait for handled
by page_scrub_softirq(). If the dying hvm have a lot of memory,
page_scrub_softirq() will not handle all of them before the start the
hvm. There are some pages belong to node1 still in scrub list, new hvm
can't use pages in it. So this hvm will get different memory
distribution than before. Before changeset 18304, page_scrub_softirq()
can be excuted parallel between all the cpus. Changeset 18305
serialise page_scrub_softirq() and Changeset 18307 serialise
page_scrub_softirq() with a new lock to avoid holding up acquiring
page_scrub_lock in free_domheap_pages(). Those changeset slow the ability
to handle pages in scrub list. So the bug becomes more obvious after.

Patch: This patch modifiers balloon.free to avoid this bug. After
patch, balloon.free will check whether current machine is a numa
system and the new created hvm has all its vcpus in the same node. If
all the conditions above fit, we will wait until all the pages in
scrub list are freed (if waiting time go beyond 20s, we will stop
waiting it.).

This seems to be too restricted at the first glance. We used to only
wait for the free memory size of pinned node is bigger than
required. But as we know HVM memory alloction granularity is 2M. Even
the former condition is satisfied, we still may not find enough
2M-size memory on that node.

Signed-off-by: Ting Zhou <ting.g.zhou@intel.com>
Signed-off-by: Xiaowei Yang <Xiaowei.yang@intel.com>
2008-12-09 12:44:32 +00:00
Keir Fraser 58daad0d36 libxc: Fix gcc 4.3 build failure
Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2008-12-09 12:42:18 +00:00
Keir Fraser 25fc0e6b27 rombios: support BCV
Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2008-12-09 12:41:12 +00:00