]> xenbits.xensource.com Git - xen.git/log
xen.git
14 years agoxl: allow truncation of xl subcommands
Keir Fraser [Fri, 18 Jun 2010 13:09:14 +0000 (14:09 +0100)]
xl: allow truncation of xl subcommands
for those of us who are used to typing "xm cr foo"

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
14 years agoia64: Fix xc_save error reporting
Keir Fraser [Fri, 18 Jun 2010 13:08:57 +0000 (14:08 +0100)]
ia64: Fix xc_save error reporting

This is the patch for error reporting on ia64 that has a special
handling in comparison with i386/x86_64 platforms. This is pretty
straight-forward just to fail on "cannot map mfn page" message instead
of continue since the memory is not being correctly mapped using the
xc_map_foreign_range() function.

From: Michal Novotny <minovotn@redhat.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agolibxl: give reasons for ctx init failures
Keir Fraser [Fri, 18 Jun 2010 13:07:42 +0000 (14:07 +0100)]
libxl: give reasons for ctx init failures

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
14 years agoMakefile: Separate misc dist things from dist target
Keir Fraser [Fri, 18 Jun 2010 13:07:19 +0000 (14:07 +0100)]
Makefile: Separate misc dist things from dist target

Separate the miscellaneous actions the dist: target does into its own
target so you can run them independently.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
14 years agoSwitch default Linux kernel build to 2.6.32
Keir Fraser [Fri, 18 Jun 2010 13:06:38 +0000 (14:06 +0100)]
Switch default Linux kernel build to 2.6.32

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
14 years agocpuidle: redefine cpumask_lock as rwlock_t
Keir Fraser [Thu, 17 Jun 2010 07:53:12 +0000 (08:53 +0100)]
cpuidle: redefine cpumask_lock as rwlock_t

Multiple cpus clear hpet channel cpumask simultaneously is ok. So we
can change the cpumask_lock to rwlock_t.

Signed-off-by: Wei Gang <gang.wei@intel.com>
14 years agocpuidle: redirect some hpet lock users to a new cpumask_lock
Keir Fraser [Thu, 17 Jun 2010 07:52:50 +0000 (08:52 +0100)]
cpuidle: redirect some hpet lock users to a new cpumask_lock

The hpet channel lock was also used for prevent handle_hpet_broadcast
access other cpu's timer_deadline_start/end after other cpu was
already waken up.
This purpose can be approached via a standalone lock to remove much
spins on the hpet channel lock.

Signed-off-by: Wei Gang <gang.wei@intel.com>
14 years agocpuidle: remove hpet access in hpet_broadcast_exit
Keir Fraser [Thu, 17 Jun 2010 07:52:29 +0000 (08:52 +0100)]
cpuidle: remove hpet access in hpet_broadcast_exit

hpet_broadcast_exit calls reprogram_hpet to stop possible hpet intr if
the last deep-cstate waken up cpu is waken by unexpected intrs instead
of hpet broadcast handler. This can be removed without brings much
useless intrs, but bring chance for further optimization. It is a
tradeoff between grace & optimization.

BTW, move the cpumask set out of critial section in
hpet_broadcast_enter to shorten it.

Signed-off-by: Wei Gang <gang.wei@intel.com>
14 years agocpuidle: use stime to count c-state residency in NONSTOP_TSC case
Keir Fraser [Thu, 17 Jun 2010 07:51:25 +0000 (08:51 +0100)]
cpuidle: use stime to count c-state residency in NONSTOP_TSC case

stime is based on tsc, with far less access cost than PM timer. So for
processors w/ NONSTOP_TSC, using stime instead of PM timer. This could
reduce idle overheads and save power.

Signed-off-by: Wei Gang <gang.wei@intel.com>
14 years agocpuidle: reduce redundant cost in cstate_restore_tsc for nonstop tsc
Keir Fraser [Thu, 17 Jun 2010 07:50:55 +0000 (08:50 +0100)]
cpuidle: reduce redundant cost in cstate_restore_tsc for nonstop tsc

Signed-off-by: Wei Gang <gang.wei@intel.com>
14 years agocpuidle: fix wrapped ticks calculation for pm timer.
Keir Fraser [Thu, 17 Jun 2010 07:50:18 +0000 (08:50 +0100)]
cpuidle: fix wrapped ticks calculation for pm timer.

Signed-off-by: Wei Gang <gang.wei@intel.com>
14 years agoFix sched_adjust_global() and clean up surrounding code.
Keir Fraser [Thu, 17 Jun 2010 07:02:27 +0000 (08:02 +0100)]
Fix sched_adjust_global() and clean up surrounding code.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agox86: IRQ affinity should track vCPU affinity
Keir Fraser [Thu, 17 Jun 2010 06:22:06 +0000 (07:22 +0100)]
x86: IRQ affinity should track vCPU affinity

With IRQs getting bound to the CPU the binding vCPU currently runs on
there can result quite a bit of extra cross CPU traffic as soon as
that vCPU moves to a different pCPU. Likewise, when a domain re-binds
an event channel associated with a pIRQ, that IRQ's affinity should
also be adjusted.

The open issue is how to break ties for interrupts shared by multiple
domains - currently, the last request (at any point in time) is being
honored.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agopython/xc: fix out of bounds array access
Keir Fraser [Tue, 15 Jun 2010 12:27:14 +0000 (13:27 +0100)]
python/xc: fix out of bounds array access

Writing a NUL terminator here isn't even necessary, since snprintf()
already guarantees proper termination.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agoia64: fix build
Keir Fraser [Tue, 15 Jun 2010 12:26:49 +0000 (13:26 +0100)]
ia64: fix build

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agox86: fix guest wrmsr warning format
Keir Fraser [Tue, 15 Jun 2010 12:24:11 +0000 (13:24 +0100)]
x86: fix guest wrmsr warning format

During the recent MSR handling cleanup, the '0' format modifier got
lost.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agox86/mce: assorted fixes
Keir Fraser [Tue, 15 Jun 2010 12:21:34 +0000 (13:21 +0100)]
x86/mce: assorted fixes

- correct various range checks (avoids bogus warnings on domains
  modifying virtualized MSRs)
- correct consistency check (so that APs get checked instead of the
  BP [against uninitialized data])
- reduce verbosity (capabilities printed only once, but then all of
  the relevant values)

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agox86: return value of domain_pirq_to_irq() is signed
Keir Fraser [Tue, 15 Jun 2010 12:21:03 +0000 (13:21 +0100)]
x86: return value of domain_pirq_to_irq() is signed

That value can, for forcibly unbound PIRQs, validly be negative, and
for the respective check to catch those cases (and prevent using these
negative values as array index), the respective variables must be of
signed type.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agox86: put_superpage() must also work for !opt_allow_superpage
Keir Fraser [Tue, 15 Jun 2010 12:20:43 +0000 (13:20 +0100)]
x86: put_superpage() must also work for !opt_allow_superpage

This is because the P2M table, when placed at a kernel specified
location, gets populated with large pages, which the domain must have
a way to unmap/recycle.

Additionally when allowing Dom0 to use superpages, they ought to be
tracked accordingly in the superpage frame table.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agoAllow LZO compressed bzImage to be used as DomU kernel
Keir Fraser [Tue, 15 Jun 2010 12:20:11 +0000 (13:20 +0100)]
Allow LZO compressed bzImage to be used as DomU kernel

... since recently Linux added this as another kernel compression
method.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agox86: allow LZO compressed bzImage to be used as Dom0 kernel
Keir Fraser [Tue, 15 Jun 2010 12:19:33 +0000 (13:19 +0100)]
x86: allow LZO compressed bzImage to be used as Dom0 kernel

... since recently Linux added this as another kernel compression
method, and we already have LZO compression in the tree (from tmem),
so that only glue logic is needed.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agox86: fix pv cpuid masking
Keir Fraser [Tue, 15 Jun 2010 12:18:55 +0000 (13:18 +0100)]
x86: fix pv cpuid masking

Invert initial values of the variables parsed into from the command
line, so that completely clearing out one or more of the four bit
fields is possible.

Further, consolidate the command line parameter specifications into
a single place.

Finally, as per "Intel Virtualization Technology FlexMigration
Application Note" (http://www.intel.com/Assets/PDF/manual/323850.pdf),
also handle family 6 model 0x1f.

What remains open is the question whether pv_cpuid() shouldn't also
consume these masks.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agoDon't save Xen heap pages during domain save
Keir Fraser [Tue, 15 Jun 2010 12:18:09 +0000 (13:18 +0100)]
Don't save Xen heap pages during domain save

As discussed in the thread starting at
http://lists.xensource.com/archives/html/xen-devel/2010-05/msg01383.html,
don't save Xen heap pages in order to avoid overallocation when the
domain gets restored, as those pages would get (temporarily) backed
with normal RAM pages by the restore code.

This requires making DOMCTL_getpageframeinfo{2,3} usable for HVM
guests, meaning that the input to these must be treated as GMFNs.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agoxl: fix restore_common return value
Keir Fraser [Tue, 15 Jun 2010 10:38:41 +0000 (11:38 +0100)]
xl: fix restore_common return value

restore_common function should return error when failed.

Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
14 years agobuildconfig: Set CONFIG_TUN=y in Linux kernel config
Keir Fraser [Tue, 15 Jun 2010 10:37:59 +0000 (11:37 +0100)]
buildconfig: Set CONFIG_TUN=y in Linux kernel config

This is needed by the pv_ops kernel in order to support HVM guests
with emulated VIFs

Signed-off-by: Alex Zeffertt <alex.zeffertt@eu.citrix.com>
14 years agobuildconfig: Fix setopt in case where option is already set but to the wrong value
Keir Fraser [Tue, 15 Jun 2010 10:37:24 +0000 (11:37 +0100)]
buildconfig: Fix setopt in case where option is already set but to the wrong value

Signed-off-by: Alex Zeffertt <alex.zeffertt@eu.citrix.com>
14 years agoxend: Do not mess with bridge if admin has set one up already
Keir Fraser [Tue, 15 Jun 2010 10:36:27 +0000 (11:36 +0100)]
xend: Do not mess with bridge if admin has set one up already

Previously, the default "network-script",
/etc/xen/scripts/network-bridge, would attempt to do its horrid work
even if you had already set everything up in /etc/network/interfaces.

Setting up your bridge in /etc/network/interfaces is:
 * easy
 * required for libxl since libxl never does it for you
 * not a fragile piece of lunacy
 * properly documented
 * the way everyone would expect it to work

In this small patch we make it so that the default config for xend
doesn't mess about on startup if you already have a bridge, and
doesn't mess about on shutdown unless your first-named bridge (eth0 or
xenbr0, normally) doesn't also have a physical interface named
p<whatever> (peth0 or pxenbr0) enslaved to it.  The latter test is not
ideal but will hopefully do from now until the time xend finally dies.

We also fix the "documentation" - ie, the comments in the default
xend-config.sxp - to correspond to reality.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agox86 hap: clean up the definition of hap_enabled().
Keir Fraser [Tue, 15 Jun 2010 10:35:46 +0000 (11:35 +0100)]
x86 hap: clean up the definition of hap_enabled().

Actually when hvm_domain.hap_enabled is true, it is already a hvm
domain.

Signed-off-by: Xin Li <xin.li@intel.com>
14 years agomce: Enhance the vmce injection check logic
Keir Fraser [Tue, 15 Jun 2010 10:34:13 +0000 (11:34 +0100)]
mce: Enhance the vmce injection check logic

Currently we will not inject vMCE if guest has different mca control
register setup.

This is not enough, we need consider more. If guest has different
family/model, we should not inject guest, because the MCA error code
include model specific information. If guest has not enabled MCE
(i.e. CR4.X86_CR4_MCE is clear), we should not inject vMCE.

One thing need notice. In the memory error handler, we didn't kill the
guest if vMCE is not ready, instead, we will simply ignore the
vMCE. In native, system will reboot if MCE in CR4 is not enabled. We
need contain guest access to the broken memory through eithe software
or hardware method.

Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
14 years agox86: Do not include apic.h/io_apic.h from asm/smp.h
Keir Fraser [Fri, 11 Jun 2010 16:47:49 +0000 (17:47 +0100)]
x86: Do not include apic.h/io_apic.h from asm/smp.h

...and fix up the ensuing fall-out of implicit dependencies

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agox86 amd: Fix after MSR cleanup
Keir Fraser [Fri, 11 Jun 2010 15:59:22 +0000 (16:59 +0100)]
x86 amd: Fix after MSR cleanup

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
14 years agomce: clean up msr handling
Keir Fraser [Fri, 11 Jun 2010 14:22:12 +0000 (15:22 +0100)]
mce: clean up msr handling

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
14 years agox86: Clean up efer/ler macros after MSR changes.
Keir Fraser [Fri, 11 Jun 2010 14:19:49 +0000 (15:19 +0100)]
x86: Clean up efer/ler macros after MSR changes.

Move them out of a header file and make the macros proper functions again.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agoapic: clean up msr handling
Keir Fraser [Fri, 11 Jun 2010 13:26:02 +0000 (14:26 +0100)]
apic: clean up msr handling

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
14 years agomtrr msr-handling cleanup
Keir Fraser [Fri, 11 Jun 2010 12:58:40 +0000 (13:58 +0100)]
mtrr msr-handling cleanup

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
14 years agosvm: use msr safe for erratum 383
Keir Fraser [Fri, 11 Jun 2010 12:57:52 +0000 (13:57 +0100)]
svm: use msr safe for erratum 383

Make erratum 383 use msr safe variants to work on top of KVM.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
14 years agolibxl: blktap2 fix
Keir Fraser [Fri, 11 Jun 2010 11:35:47 +0000 (12:35 +0100)]
libxl: blktap2 fix

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agoxen: msr safe cleanup
Keir Fraser [Fri, 11 Jun 2010 10:37:22 +0000 (11:37 +0100)]
xen: msr safe cleanup

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
14 years agolibxl: Fix blktap2 for xl cset 21586:c3c2bcafe471
Keir Fraser [Fri, 11 Jun 2010 08:35:25 +0000 (09:35 +0100)]
libxl: Fix blktap2 for xl cset 21586:c3c2bcafe471

Avoids a double free on automatic memory.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoVMX: enforce INVVPID checking
Keir Fraser [Fri, 11 Jun 2010 08:34:58 +0000 (09:34 +0100)]
VMX: enforce INVVPID checking

Escalate to use a wider context invalidation if the requested context
invalidation is not supported.

Signed-off-by: Xin Li <xin.li@intel.com>
14 years agogrant iommu: Correctly handle multiple mappings of same MFN.
Keir Fraser [Fri, 11 Jun 2010 08:31:14 +0000 (09:31 +0100)]
grant iommu: Correctly handle multiple mappings of same MFN.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agotmem: Fix domain lifecycle synchronisation.
Keir Fraser [Thu, 10 Jun 2010 21:39:52 +0000 (22:39 +0100)]
tmem: Fix domain lifecycle synchronisation.

Obtaining a domain reference count is neither necessary nor
sufficient. Instead we simply check whether a domain is already dying
when it first becomes a client of tmem. If it is not then we will
correctly clean up later via tmem_destroy() called from domain_kill().

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agoTmem: fix domain refcount leak by returning to simpler model
Keir Fraser [Thu, 10 Jun 2010 21:12:36 +0000 (22:12 +0100)]
Tmem: fix domain refcount leak by returning to simpler model
which claims a ref once when the tmem client is first associated
with the domain, and puts it once when the tmem client is
destroyed.

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
14 years agoVMX: rewrite ept_change_entry_type_global in a recursive way
Keir Fraser [Thu, 10 Jun 2010 21:11:26 +0000 (22:11 +0100)]
VMX: rewrite ept_change_entry_type_global in a recursive way

Signed-off-by: Xin Li <xin.li@intel.com>
14 years agorcu: Update all rcu_read_lock() users to implement a dummy RCU read lock.
Keir Fraser [Thu, 10 Jun 2010 17:01:03 +0000 (18:01 +0100)]
rcu: Update all rcu_read_lock() users to implement a dummy RCU read lock.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agoVMX: enforce invept checking
Keir Fraser [Thu, 10 Jun 2010 16:30:23 +0000 (17:30 +0100)]
VMX: enforce invept checking

Escalate to use all context invalidation if single context
invalidation is not supported.

Signed-off-by: Xin Li <xin.li@intel.com>
14 years agoVMX: enforce EPT paging structure memory type and page-walk length check.
Keir Fraser [Thu, 10 Jun 2010 10:18:02 +0000 (11:18 +0100)]
VMX: enforce EPT paging structure memory type and page-walk length check.

Also use a macro to get EPT walk length.

signed-off-by: Xin Li <xin.li@intel.com>

14 years agox86 hvm: Fix build error with some GCC versions.
Keir Fraser [Thu, 10 Jun 2010 09:18:00 +0000 (10:18 +0100)]
x86 hvm: Fix build error with some GCC versions.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agoxc_domain_restore: Remove static variable 'completed'
Keir Fraser [Thu, 10 Jun 2010 08:43:49 +0000 (09:43 +0100)]
xc_domain_restore: Remove static variable 'completed'

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agoxc_domain_restore: Revert 20126:442bc6f82cf3, 19639:205b1badbcfd
Keir Fraser [Thu, 10 Jun 2010 08:35:16 +0000 (09:35 +0100)]
xc_domain_restore: Revert 20126:442bc6f82cf3, 19639:205b1badbcfd

This disables superpage restore support, but should gain us acceptable
performance when restoring a domain using a pv_ops dom0 kernel. This
is because single-page allocations will be batched rather than issued
singly.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agox86_32 vmx: Fix build after msr cleanups
Keir Fraser [Thu, 10 Jun 2010 07:31:36 +0000 (08:31 +0100)]
x86_32 vmx: Fix build after msr cleanups

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agolibxl: Use libblktapctl.so
Keir Fraser [Thu, 10 Jun 2010 07:28:02 +0000 (08:28 +0100)]
libxl: Use libblktapctl.so

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoblktap2: Build libblktapctl.so
Keir Fraser [Thu, 10 Jun 2010 07:27:25 +0000 (08:27 +0100)]
blktap2: Build libblktapctl.so

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoblktap2: Add tap_ctl_find_minor
Keir Fraser [Thu, 10 Jun 2010 07:26:42 +0000 (08:26 +0100)]
blktap2: Add tap_ctl_find_minor

Slack 'tap-ctl find -t <type> -f <path>'.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoblktap2: Fix broken tap-ctl-list type/path filter logic
Keir Fraser [Thu, 10 Jun 2010 07:25:55 +0000 (08:25 +0100)]
blktap2: Fix broken tap-ctl-list type/path filter logic

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoUpdate QEMU_TAG to 6392763643311272590ef5c6f75ba11d5b132585
Keir Fraser [Thu, 10 Jun 2010 07:25:10 +0000 (08:25 +0100)]
Update QEMU_TAG to 6392763643311272590ef5c6f75ba11d5b132585

14 years agoVMX: remove an unused EPT macro.
Keir Fraser [Thu, 10 Jun 2010 07:24:48 +0000 (08:24 +0100)]
VMX: remove an unused EPT macro.

Signed-off-by: Xin Li <xin.li@intel.com>
14 years agox86 hvm: msr-handling cleanup
Keir Fraser [Thu, 10 Jun 2010 07:24:07 +0000 (08:24 +0100)]
x86 hvm: msr-handling cleanup

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
14 years agox86 mce: Dump the MCE information in mc_panic and softirq
Keir Fraser [Thu, 10 Jun 2010 07:19:58 +0000 (08:19 +0100)]
x86 mce: Dump the MCE information in mc_panic and softirq

We should not dump the mcinfo in mce handler, instead, we should do
that in mc_panic for fatal error or softirq for other errors.

Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
Acked-By: Christoph Egger <Christoph.Egger@amd.com>
14 years agox86 mce: Clean-up the mc_panic handler.
Keir Fraser [Thu, 10 Jun 2010 07:19:11 +0000 (08:19 +0100)]
x86 mce: Clean-up the mc_panic handler.

Firstly, mc_panic should only mc_panic in one CPU to avoid printk
output be mixed.
Secondly, call urgent handler in MCE panic to get error code specific
hander be involved.

Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
14 years agox86 mce: Clean Intel's MCE handler code
Keir Fraser [Thu, 10 Jun 2010 07:18:46 +0000 (08:18 +0100)]
x86 mce: Clean Intel's MCE handler code

Add intel_mce_type check according to Intel's SDM.

Reduce intel_memerr_dhandler()'s indent to make code easily read. And
add a page_off action when we offline the page, so that dom0 can knows
about the action taken by xen hypervisor.

Add a default delay mce handler, which will crash if unknow SRAR error
or fatal error, otherwise, system continue.

Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
14 years agox86 mce: Make mce_action action be usable for both delayed handler and
Keir Fraser [Thu, 10 Jun 2010 07:18:11 +0000 (08:18 +0100)]
x86 mce: Make mce_action action be usable for both delayed handler and
urgent handler

Originally mce_action is called for delayed hander. Change it to be
used for both delayed handler and urgent handler.Wrap it with
mce_delayed_action for delay handler.

Change the return value to be more clearly.

Change the mca handler from mca_code to a function to be more
flexible. And change the interface to mce_handler to be mca_binfo to
pass more information.

Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
14 years agox86 mce: Clean-up intel mcheck_init
Keir Fraser [Thu, 10 Jun 2010 07:17:38 +0000 (08:17 +0100)]
x86 mce: Clean-up intel mcheck_init

Cleanup intel_mcheck_init, also change the MCA capability check. We
will always use BSP's MCA capability as global value. If there are
some difference between BSP/AP, we will print warning.

Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
14 years agox86 mce: Re-arrange mce_intel.c, to make it more clean
Keir Fraser [Thu, 10 Jun 2010 07:16:50 +0000 (08:16 +0100)]
x86 mce: Re-arrange mce_intel.c, to make it more clean

Seperate logic for MCE handling, Intel MCA, MCE, CMCI handler, to make
it more clean. No logic changes in this patch.

Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
14 years agox86 mce: Use MSR_IA32_MCx_* macros consistently
Keir Fraser [Wed, 9 Jun 2010 13:38:30 +0000 (14:38 +0100)]
x86 mce: Use MSR_IA32_MCx_* macros consistently

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
14 years agox86 vpmu: msr-handling cleanup
Keir Fraser [Wed, 9 Jun 2010 13:36:11 +0000 (14:36 +0100)]
x86 vpmu: msr-handling cleanup

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
14 years agoxen-watchdog: Move init script to OS-dep dir and implement for netbsd
Keir Fraser [Wed, 9 Jun 2010 12:29:22 +0000 (13:29 +0100)]
xen-watchdog: Move init script to OS-dep dir and implement for netbsd

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agoxend: Remove use of non-existent xc.handle() function.
Keir Fraser [Wed, 9 Jun 2010 06:55:19 +0000 (07:55 +0100)]
xend: Remove use of non-existent xc.handle() function.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agox86 mce: Make indentation consistent (soft tabs) in a couple of files.
Keir Fraser [Wed, 9 Jun 2010 06:54:10 +0000 (07:54 +0100)]
x86 mce: Make indentation consistent (soft tabs) in a couple of files.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agox86: add CMCI software injection interface
Keir Fraser [Wed, 9 Jun 2010 06:51:31 +0000 (07:51 +0100)]
x86: add CMCI software injection interface

A new command is added. User can set the target CPU map, since the
CMCI can be triggered on some specific CPUs.  Please be noticed that
the xenctl_cpumap structure is moved from domctl.h to xen.h.

Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
14 years agomce: Clean-up mcheck_init handler
Keir Fraser [Wed, 9 Jun 2010 06:42:19 +0000 (07:42 +0100)]
mce: Clean-up mcheck_init handler

Firstly and most importantly, the maxium MCA banks are hard-coded as
MAX_NR_BANKS, which is 30. This is not architecture correct. This
patch removes this definition, replacig the cpu_banks_t with
mca_banks, and provide some basic function, like
set/clear/test/alloc/free for mcabanks_t.

Secondly, remove the broadcast_check code to intel specific, since
only Intel platform support broadcast now.

Thirdly, the X86_FEATURE_MCA check and CR4_MCE enable is done in every
vendor-specifc callback, that's redundant, move it to
mcheck_init. Also, we should enable CR4_MCE only in the end of the
mcheck_init, to close the small window between CR4_enable and the mca
setup.

And we also move vmce specific code to vmce.c as vmce_init, to make
code clean.

Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
Acked-By: Christoph Egger <Christoph.Egger@amd.com>
14 years agotools/misc: xen-watchdog script is Linux specific
Keir Fraser [Wed, 9 Jun 2010 06:29:10 +0000 (07:29 +0100)]
tools/misc: xen-watchdog script is Linux specific

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agotools: fix install bash-completion files to non-default locations.
Keir Fraser [Wed, 9 Jun 2010 06:21:32 +0000 (07:21 +0100)]
tools: fix install bash-completion files to non-default locations.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
14 years agonetbsd: Add boot-time init scripts.
Keir Fraser [Wed, 9 Jun 2010 06:18:30 +0000 (07:18 +0100)]
netbsd: Add boot-time init scripts.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
14 years agoblktap2: Fix toolstack build on NetBSD
Keir Fraser [Wed, 9 Jun 2010 05:59:52 +0000 (06:59 +0100)]
blktap2: Fix toolstack build on NetBSD

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoblktap2: <sys/time.h> is needed for 'struct timeval'
Keir Fraser [Wed, 9 Jun 2010 05:58:55 +0000 (06:58 +0100)]
blktap2: <sys/time.h> is needed for 'struct timeval'

Also clean up a Makefile to use $(SBINDIR).

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
14 years agohgignore: Update for new tap-ctl utility
Keir Fraser [Tue, 8 Jun 2010 07:09:16 +0000 (08:09 +0100)]
hgignore: Update for new tap-ctl utility

14 years agoblktap2: Port Xend to the tap-ctl interface.
Keir Fraser [Tue, 8 Jun 2010 07:05:43 +0000 (08:05 +0100)]
blktap2: Port Xend to the tap-ctl interface.

Signed-off-by: Jake Wires <jake.wires@citrix.com>
14 years agoblktap2: The tap-ctl userspace control utility and library.
Keir Fraser [Tue, 8 Jun 2010 07:05:09 +0000 (08:05 +0100)]
blktap2: The tap-ctl userspace control utility and library.

Tapdisk control in userspace, a replacement for the original blktap2
control stack, which had to pass a kernel space interface based on
sysfs nodes.

All tapdisk processes listen for commands on a unix stream socket. The
control library supports scanning the socket namespace for running
tapdisks, VBD minors allocated, associated images and state inquiry.

Control operations include allocating/releasing devices, spawning
tapdisks, opening/closing images, attaching disk images to
devices. disk pause/resume operations and runtime switching of disk
images.

Signed-off-by: Jake Wires <jake.wires@citrix.com>
Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoblktap2: Cleanup vdi stacking code.
Keir Fraser [Tue, 8 Jun 2010 07:04:36 +0000 (08:04 +0100)]
blktap2: Cleanup vdi stacking code.

Removes some rough edges, memory leakage (?), fixes __list_splice, ...

Signed-off-by: Jake Wires <jake.wires@citrix.com>
Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoblktap2: Fix E/DPRINTF defs all around the driver/ subdir.
Keir Fraser [Tue, 8 Jun 2010 07:04:09 +0000 (08:04 +0100)]
blktap2: Fix E/DPRINTF defs all around the driver/ subdir.

This is just to avoid macro madness among subdirs sharing blktaplib.h.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
Signed-off-by: Jake Wires <jake.wires@citrix.com>
14 years agoblktap2: Fix tapdisk disktype issues.
Keir Fraser [Tue, 8 Jun 2010 07:03:41 +0000 (08:03 +0100)]
blktap2: Fix tapdisk disktype issues.

Stop coercing drivers/disktype code into the tool stack. Make both
blktapctrl and tap-ctl transfer type/path pairs as "<type>:<path>"
strings. Remove the message.disktype integer altogether.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
Signed-off-by: Jake Wires <jake.wires@citrix.com>
14 years agoblktap2: Remove LVM hacks.
Keir Fraser [Tue, 8 Jun 2010 07:02:56 +0000 (08:02 +0100)]
blktap2: Remove LVM hacks.

These only mattered for XCP's LVHD with blktap1.

Signed-off-by: Jake Wires <jake.wires@citrix.com>
Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agoblktap2: Remove tapdisk-ipc module.
Keir Fraser [Tue, 8 Jun 2010 07:01:50 +0000 (08:01 +0100)]
blktap2: Remove tapdisk-ipc module.

Obsoleted with blktapctrl.

Signed-off-by: Jake Wires <jake.wires@citrix.com>
Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
14 years agolibxl/xl: implement xen_platform_pci enable/disable
Keir Fraser [Tue, 8 Jun 2010 07:01:04 +0000 (08:01 +0100)]
libxl/xl: implement xen_platform_pci enable/disable

Implement xen_platform_pci support in xl/libxl to allow users to
disable the xen platform pci device from the VM config file.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
14 years agotools: Add missing files under tools/hotplug/Linux/init.d
Keir Fraser [Mon, 7 Jun 2010 16:14:37 +0000 (17:14 +0100)]
tools: Add missing files under tools/hotplug/Linux/init.d

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agohgignore: Modify *.d line to avoid fale trigger on tools/hotplug/Linux/init.d/
Keir Fraser [Mon, 7 Jun 2010 16:14:09 +0000 (17:14 +0100)]
hgignore: Modify *.d line to avoid fale trigger on tools/hotplug/Linux/init.d/

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agox86: Force !in_irq() in machine_restart().
Keir Fraser [Mon, 7 Jun 2010 15:41:19 +0000 (16:41 +0100)]
x86: Force !in_irq() in machine_restart().

Various function we may call assert this fact. We just want to restart
the system.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agoxl: init scripts (v2)
Keir Fraser [Mon, 7 Jun 2010 14:49:46 +0000 (15:49 +0100)]
xl: init scripts (v2)

Now the init script is called xencommons and, as the name suggests, it
is a common script between xl and xend because it is used to start
xenconsoled, xenstored and xenbackendd and the initialization of these
three daemons has been removed from xend.  The global
xen_toolstack=xl/xend variable has been removed.  Regarding the
network setup, I made the vif scripts follow the same pattern as the
other scripts in xen-backend: a new script called vif-setup is
executed unconditionally. vif-setup is going to do the right thing
depending on the value of the environmental variable "script" (same
technique used before), defaulting to vif-bridge.  In the common
scenario the toolstack doesn't need to set the variable "script"
because vif-bridge is going to be called anyway.  There is no global
network script to setup the network bridges with xl, so if you are
using xl without xend, you need to manually configure the bridges
using your distro network setup, or, if you are lazy, you can just add
something like:

/etc/xen/scripts/network-bridge start

to your rc.local.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
14 years agolibxc: NetBSD build fix
Keir Fraser [Mon, 7 Jun 2010 14:48:12 +0000 (15:48 +0100)]
libxc: NetBSD build fix

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
14 years agobltap2: implement md5 directly, to remove ssl dependency
Keir Fraser [Mon, 7 Jun 2010 14:47:28 +0000 (15:47 +0100)]
bltap2: implement md5 directly, to remove ssl dependency

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
14 years agox86 mce: Change the method to get the extended MCA information.
Keir Fraser [Mon, 7 Jun 2010 14:46:48 +0000 (15:46 +0100)]
x86 mce: Change the method to get the extended MCA information.

Several changes to get the extended MCA information:
a) Use the x86_mcinfo_reserve in mcinfo_extended to reserve buffer
from
   mc_info, instead of using the stack
b) For intel's extended MSR, we don't need write them one
   by one as the MSR are continous
c) We don't need enum mca_extinfo, since we can consider
   the extended MSR as either per bank, or global. Currently
   we add a hook in global data collection, and didn't call
   register intel_get_extended_msrs as callback. Later that
   hook can be replaced by cleaner way

Signed-off-by: Jiang, Yunhong <yunhong.jiang@inte.com>
14 years agotools: disable xen-hptool on ia64
Keir Fraser [Mon, 7 Jun 2010 14:45:56 +0000 (15:45 +0100)]
tools: disable xen-hptool on ia64

xen-hptool cannot be built on ia64, because xen-hptool depends on
xc_offline_page.c and xc_offline_page.c does not support ia64.

This patch disables it on ia64.

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
14 years agoxl: fix 'xl help' command
Keir Fraser [Mon, 7 Jun 2010 06:49:07 +0000 (07:49 +0100)]
xl: fix 'xl help' command

xl help 'command' should give the help of the 'command',
but current it does not, it just gives a full list of xl
supported commands. This patch fix it.

Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
14 years agox86: Small APIC timer initialisation cleanup
Keir Fraser [Mon, 7 Jun 2010 06:47:30 +0000 (07:47 +0100)]
x86: Small APIC timer initialisation cleanup

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agoAMD: Workaround for erratum 411
Keir Fraser [Mon, 7 Jun 2010 06:38:09 +0000 (07:38 +0100)]
AMD: Workaround for erratum 411

Clear APIC TMICT when we mask APIC LVTT.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
14 years agoxend: A few blktap2 fixes
Keir Fraser [Mon, 7 Jun 2010 06:19:43 +0000 (07:19 +0100)]
xend: A few blktap2 fixes

1. Bug fix for error: "Error: Device /dev/xvdp (51952, tap2) is
already connected." (xenstore does not clean after DomU stoped)
2. Bug fix for error: "File 'vhd:/path/.../disk.img' doesn't exist."
(not correct parsing)
3. Bug fix for error: "Error: Device 51952 not connected" (in config
file for DomU we should be use prefix "tap2:tapdisk:xxx" for devices
from (aio, ram, qcow, vhd, remus) or "tap:tapdisk:xxx" for devices
from (sync, vmdk, qcow2, ioemu))
4. Bug fix for error: "Disk is not accessible" (if use 'tap2'-device
type, then '/dev/xpvd' may not be accessible immediately after its
creation)

Signed-off-by: eXeC001er <execooler@gmail.com>
14 years agoxenwatchdogd: Fix build errors
Keir Fraser [Mon, 7 Jun 2010 06:16:43 +0000 (07:16 +0100)]
xenwatchdogd: Fix build errors

Signed-off-by: Patrick Colp <pjcolp@cs.ubc.ca>
14 years agoxl: block-detach command line parsing
Keir Fraser [Mon, 7 Jun 2010 06:14:19 +0000 (07:14 +0100)]
xl: block-detach command line parsing

Command line arguments start at argv[2].

Signed-off-by: Eric Chanudet <eric.chanudet@citrix.com>
14 years agoxl: block-list command line parsing
Keir Fraser [Mon, 7 Jun 2010 06:13:41 +0000 (07:13 +0100)]
xl: block-list command line parsing

Command line arguments start at argv[2].

Signed-off-by: Eric Chanudet <eric.chanudet@citrix.com>