Keir Fraser [Thu, 8 Jan 2009 11:27:11 +0000 (11:27 +0000)]
passthough: MSI-INTx translation documentation
Signed-off-by: Qing He <qing.he@intel.com>
Keir Fraser [Thu, 8 Jan 2009 11:26:58 +0000 (11:26 +0000)]
pci: add config options for MSI-INTx translation in HVM
Add a config file option 'pci_msitranslate' to enable MSI-INTx
translation in HVM, and also a per-device option 'msitranslate' to
allow device base to be overridden
Signed-off-by: Qing He <qing.he@intel.com>
Keir Fraser [Thu, 8 Jan 2009 11:26:16 +0000 (11:26 +0000)]
pci: add pci option support for XenAPI sever
Allow the per-device options for passthrough pci devices
This patch is for XenAPI server
A new key-value pair element of 'pci' named 'pci_opt' is added
to xml config file
Signed-off-by: Qing He <qing.he@intel.com>
Keir Fraser [Thu, 8 Jan 2009 11:25:43 +0000 (11:25 +0000)]
pci: add pci option support for XML-RPC server
Allow the per-device options for passthrough pci devices
for exmaple, in domain config file:
pci = ['01:00.0,opt1=val1,opt2=val2', '01:00.1' ]
or in the PCI hotplug case:
xm pci-attach -o opt1=val1 --options=opt2=val2 <domid> 01:00.0 6
This patch is for xml-rpc server
Signed-off-by: Qing He <qing.he@intel.com>
Keir Fraser [Thu, 8 Jan 2009 11:25:06 +0000 (11:25 +0000)]
passthrough: MSI-INTx translation for HVM
The patch adds a new type of pt_irq: PT_IRQ_TYPE_MSI_TRANSLATE.
With it, guest dpci irq can now use msi as the underlying pirq
while injected as INTx irq.
Signed-off-by: Qing He <qing.he@intel.com>
Keir Fraser [Thu, 8 Jan 2009 11:21:23 +0000 (11:21 +0000)]
xenpm tool enhancements
Two enhancements are made in this patch:
1. Make cpuid in command line optional: if user does not provide
cpuid, xenpm will operate on all the CPUs. this will easy the xenpm
usage. e.g. to set the cpufreq governor, user usually want to set the
governor on all CPUs. User can accomplish this easily with this
enhancement.
2. Add another option "xenpm start" to calculate the Cx/Px state
residency percentage during specified period. when user issue "xenpm
start", xenpm will start to record the Cx/Px state residency. when
user issue CTRL-C, xenpm will stop and show the Cx/Px state residency
and percentage of this period. this is helpful to measure the xenpm
effect for speficied workload.
Signed-off-by: Guanqun Lu <guanqun.lu@intel.com>Signed-off-by: Ke Yu <ke.yu@intel.com>
Keir Fraser [Thu, 8 Jan 2009 11:19:38 +0000 (11:19 +0000)]
x86: remove pointless dom0 check
This check is redundant with a check a few dozen lines up resulting in
a panic().
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Keir Fraser [Wed, 7 Jan 2009 11:25:00 +0000 (11:25 +0000)]
Enable debug build by default, for better dev testing.
In particular this may hopefully give better detection of latent
spinlock bugs.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Wed, 7 Jan 2009 11:21:50 +0000 (11:21 +0000)]
cpufreq: stats_lock doesn't appear to need to be irq-safe.
Changing this fixes some bugchecks (xmalloc() with irqs disabled).
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Isaku Yamahata [Wed, 7 Jan 2009 05:28:33 +0000 (14:28 +0900)]
[IA64] stub for XENMEM_[gs]et_pod_target.
This patch adds the stub for XENMEM_[gs]et_pod_target.
Without this patch, domain builder aborts on the error.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Isaku Yamahata [Wed, 7 Jan 2009 05:27:03 +0000 (14:27 +0900)]
[IA64] ia64 counter part of
5b44cfde9666.
This patch defines ia64 xc_hvm_build_target_mem() which
is referenced by xc.c.
Without this patch, xend doesn't boot complaining
that symbol, xc_hvm_build_target_mem, is missing.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Isaku Yamahata [Wed, 7 Jan 2009 03:20:31 +0000 (12:20 +0900)]
[IA64] compilation fix of xenctx
This patch fixes the following compilation error caused by
18963:
9cc632cc6d40 of xen-unstable.hg
> xenctx.c: In function 'print_ctx':
> xenctx.c:430: error: request for member 'c' in something not a structure or union
> xenctx.c:431: error: 'vcpu_guest_context_any_t' has no member named 'regs'
> xenctx.c:484: error: 'vcpu_guest_context_any_t' has no member named 'event_callback_ip'
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Isaku Yamahata [Wed, 7 Jan 2009 03:20:18 +0000 (12:20 +0900)]
merge with xen-unstable.hg
Isaku Yamahata [Wed, 7 Jan 2009 03:19:36 +0000 (12:19 +0900)]
[IA64] stubs for populate on demand.
add stub functions of populate on demand to compile.
This patch fixes the following compile error.
> xen/common/built_in.o: In function `populate_physmap':
> xen/common/memory.c:116: undefined reference to `guest_physmap_mark_populate_on_demand'
> xen/common/built_in.o: In function `decrease_reservation':
> xen/common/memory.c:205: undefined reference to `p2m_pod_decrease_reservation'
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Keir Fraser [Tue, 6 Jan 2009 16:06:13 +0000 (16:06 +0000)]
rombios: Get rid of annoying delay at F12 boot menu.
Instead require the F12 to be pressed before the menu prompt appears.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Tue, 6 Jan 2009 16:02:10 +0000 (16:02 +0000)]
rombios: Allow option ROMs to extend up to 0xEA000.
Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Tue, 6 Jan 2009 14:01:39 +0000 (14:01 +0000)]
xend: Fix error handling in device_create().
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
Keir Fraser [Tue, 6 Jan 2009 14:00:58 +0000 (14:00 +0000)]
rombios: Do not initialise PCI devices after hvmloader.
Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
Keir Fraser [Tue, 6 Jan 2009 13:58:13 +0000 (13:58 +0000)]
hvm: Tell Viridian-enabled OS to relax timer interrupt checks.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Tue, 6 Jan 2009 13:27:55 +0000 (13:27 +0000)]
x86: Disable MSI as it seems to be triggering ASSERT at irq.c:269.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Tue, 6 Jan 2009 09:14:39 +0000 (09:14 +0000)]
libxc: Define xc_ffs{8,16,32,64} functions. Use them.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Isaku Yamahata [Tue, 6 Jan 2009 09:05:32 +0000 (18:05 +0900)]
[IA64] Fix some IPF Xen VT-d bugs.
In arch_domain_create(): when xen creates Dom0, need_iommu(d) is false,
so iommu_domain_init() is not invoked, as a result, eventually iommu is
not enabled properly.
Note: d->need_iommu is set to 1 only by assign_device() which is never
called for dom0. And it is called via XEN_DOMCTL_assign_device hypercall.
In IA64 Xen, physdev_map_pirq()/physdev_unmap_pirq() are kept dummy since
we don't support MSI in IA64 Xen now, but here they shouldn't return
-ENOSYS because xend invokes them (the x86 version of them is necessary
for x86 Xen); in IPF Xen if they return -ENOSYS, xend would disallow us
to create IPF HVM guest with devices assigned. Here They can return 0 instead.
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
Keir Fraser [Mon, 5 Jan 2009 11:55:24 +0000 (11:55 +0000)]
x86: Poison initmem at end of Xen bootstrap
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Mon, 5 Jan 2009 11:52:34 +0000 (11:52 +0000)]
vmx: Print advanced features during boot
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Mon, 5 Jan 2009 11:19:16 +0000 (11:19 +0000)]
Download external tarballs from xenbits.xensource.com
I have copied the tarballs that the xen-unstable build downloads to
xenbits.xensource.com (which also hosts our hg and git). This patch
changes the download URLs to use that location.
That way the build will depend on only one external machine, under one
administration, rather than many. Also it means that the build won't
break if these sites become permanently unavailable or are rearranged
and we don't run a risk of having to panic and beg if a file should go
missing.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Keir Fraser [Mon, 5 Jan 2009 11:16:41 +0000 (11:16 +0000)]
Cpufreq: simplify cpufreq_statistic_lock init
Singed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
Keir Fraser [Mon, 5 Jan 2009 11:16:12 +0000 (11:16 +0000)]
Cpufreq: prevent negative px resident time, add spinlock to avoid race
Due to NOW() value may drift between different cpus, we add protection
to prevent negative px resident time.
Due to both cpufreq logic and xenpm may race accessing
cpufreq_statistic_data, we add spinlock to avoid race.
Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
Keir Fraser [Mon, 5 Jan 2009 11:15:40 +0000 (11:15 +0000)]
Cpufreq: remove redundant fragments
Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
Keir Fraser [Mon, 5 Jan 2009 11:14:18 +0000 (11:14 +0000)]
vtd hotplug: check if a device can be hot-plugged.
When we statically assign a pci device (the pci=3D['xx:xx.x'] string
in guest config file) to guest, we make many checkings (for instance,
if the device is specified in 'pciback.hide', if it has
non-page-aligned MMIO BARs, if it has a proper FLR capability, if the
related devices should be co-assigned). However, with respect to the
guest hotplug, we only check if the device exists and not assigned yet
-- this is not enough, for instance, now xend allows us to assign an
in-use device (being used by Dom0) to an HVM guest (because
xc.test_assigned() returns OK) -- this will cause disaster... The
patch adds some necessary checkings.
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
Keir Fraser [Mon, 5 Jan 2009 11:13:22 +0000 (11:13 +0000)]
vtd: avoid redundant context mapping
After changeset 18934 (VT-d: Fix PCI-X device assignment), my assigned
PCI E1000 NIC doesn't work in guest.
The NIC is 03:00.0. Its parent bridge is: 00:1e.0.
In domain_context_mapping():
case DEV_TYPE_PCI:
After we domain_context_mapping_one() 03:00.0 and 00:1e.0, the
'secbus' is 3 and 'bus' is 0, so we domain_context_mapping_one()
03:00.0 again -- this redundant invocation returns -EINVAL because
we have created the mapping but haven't changed pdev->domain from
Dom0 to a new domain at this time and eventually the
XEN_DOMCTL_assign_device hypercall returns a failure.
The attached patch detects this case and avoids the redundant
invocation.
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
Keir Fraser [Mon, 5 Jan 2009 11:08:53 +0000 (11:08 +0000)]
xenctx: compat-mode/HVM support
Add support to xenctx for guests that have a different word size
to the tools (x86 only, but shouldn't break ia64). Again, only 32-bit
HVM guests are supported until EFER.LMA is easier to get at.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Keir Fraser [Mon, 5 Jan 2009 11:08:25 +0000 (11:08 +0000)]
Make xc_translate_foreign_address aware of compat-mode guests and
(32-bit) HVM guests. 64-bit HVM guests are still not supported for
now, pending a sensible way of getting at the guest's EFER.LMA.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Keir Fraser [Mon, 5 Jan 2009 10:47:51 +0000 (10:47 +0000)]
p2m: Small audit fixes.
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Keir Fraser [Mon, 5 Jan 2009 10:47:03 +0000 (10:47 +0000)]
PoD memory 9/9: xend integration
Xend integration for PoD functionality.
* Add python bindings for xc_hvm_domain_build() and
xc_domain_memory_set_pod_target()
* Always call xc_hvm_domain_build(), with memsize = memory_static_max
and target=memory_dynamic_max
* When setting a new memory target:
+ First make sure we actually have enough free memory for the target
setting to succeed
+ Call set_pod_target() with the new target, to Xen can do the Right
Thing.
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Keir Fraser [Mon, 5 Jan 2009 10:46:37 +0000 (10:46 +0000)]
PoD memory 8/9: libxc interface
Implement libxc interface to PoD functionality:
* Add xc_hvm_build_target_mem(), which takes both memsize and target.
Memsize is the total memory, allocated in PoD pages and reported in
the e820; target is the size of the cache. If these are the same, the
normal funcitonality is called. (So you can use the same function to
build always, and it will decide whether to use PoD or not.)
* Add xc_domain_memory_[gs]et_pod_target(), which sets and/or returns
information about the PoD cache and p2m entries.
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Keir Fraser [Mon, 5 Jan 2009 10:45:48 +0000 (10:45 +0000)]
PoD memory 7/9: Xen interface
Implement Xen interface to PoD functionality.
* Increase the number of MEMOP bits from 4 to 6 (increasing the number
of available memory operations from 16 to 64).
* Introduce XENMEMF_populate_on_demand, which will cause
populate_physmap() to fill a range with PoD entries rather than
backing it with ram
* Introduce XENMEM_[sg]et_pod_target operation to the memory
hypercall, to get and set PoD cache size. set_pod_target() should be
called during domain creation, as well as after modifying the memory
target of any domain which may have outstanding PoD entries.
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Keir Fraser [Mon, 5 Jan 2009 10:45:09 +0000 (10:45 +0000)]
PoD memory 6/9: superpage splintering
Deal with splintering superpages in the PoD cache, and with
splintering superpage PoD entries in the p2m table.
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Keir Fraser [Mon, 5 Jan 2009 10:44:39 +0000 (10:44 +0000)]
PoD memory 5/9: emergency scan
Implement "emergency scan" for zero pages, to deal with start-of-day
page scrubbers.
If the cache is running out, scan through memory looking for "zero
pages" that we can reclaim for the cache. This is necessary for
operating systems which have a start-of-day page scrubber which runs
before the balloon driver can balloon down to the target.
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Keir Fraser [Mon, 5 Jan 2009 10:43:50 +0000 (10:43 +0000)]
PoD memory 4/9: Decrease reservation
Handle balloon driver's calls to decrease_reservation properly.
* Replace PoD entries with p2m_none
* Steal memory for the cache instead of freeing, if need be
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Keir Fraser [Mon, 5 Jan 2009 10:43:19 +0000 (10:43 +0000)]
PoD memory 3/9: PoD core
X-BeenThere: xen-devel@lists.xensource.com
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: Xen developer discussion <xen-devel.lists.xensource.com>
List-Unsubscribe:
<http://lists.xensource.com/mailman/listinfo/xen-devel>,
<mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xensource.com>
List-Help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-Subscribe:
<http://lists.xensource.com/mailman/listinfo/xen-devel>,
<mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
Sender: xen-devel-bounces@lists.xensource.com
Errors-To: xen-devel-bounces@lists.xensource.com
Return-Path: xen-devel-bounces@lists.xensource.com
X-OriginalArrivalTime: 23 Dec 2008 13:47:03.0625 (UTC)
FILETIME=[
EFEBC390:
01C96504]
Core of populate-on-demand functionality:
* Introduce a populate-on-demand type
* Call p2m_demand_populate() when gfn_to_mfn() encounters PoD entries
* Return p2m memory to the domain list for freeing during domain destruction
* Audit p2m checks our PoD-entry reference-counting
* Add PoD information to the 'q' debug key
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Keir Fraser [Mon, 5 Jan 2009 10:42:39 +0000 (10:42 +0000)]
PoD memory 2/9: calls to gfn_to_mfn_query()
Shadow code, and other important places, call gfn_to_mfn_query(). In
particular, any place that holds the shadow lock must make a query
call.
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Keir Fraser [Mon, 5 Jan 2009 10:41:48 +0000 (10:41 +0000)]
PoD (populate-on-demand) memory 1/9: Add a p2m query type.
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Isaku Yamahata [Mon, 5 Jan 2009 05:13:38 +0000 (14:13 +0900)]
[IA64] fix ia64_fast_eoi hypercall to catch up PHYSDEVOP_pirq_eoi_gmfn
ia64 xen Linux uses ia64_fast_eoi to do eoi. So the c/s 18862:
f0a9a58608a0
should also have changed od_pir_guest_eoi() too.
This patch changes it.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Isaku Yamahata [Mon, 5 Jan 2009 03:24:58 +0000 (12:24 +0900)]
[IA64] fix mis-setting ed bit for itlb entry for hvm domain.
This patch fixes a windows BSOD issue caused by mis-setting pte's ED bit
for itlb entry.
For hash vTLB, it uses unified tlb and doesn't differentiate itc and dtc
in its implementation, so itlb_miss handler may reference dtlb entry in
hash vTLB.
But it may result in issues, because dtlb's ED bit may be different with
itlb's setting.
Since the case is very rare, so just purge the corresponding entry in hash
vTLB and let guest OS to determin how to set ED bit for itlb mapping once
found it.
Signed-off-by : Xiantao Zhang <xiantao.zhang@intel.com>
Isaku Yamahata [Mon, 5 Jan 2009 03:24:58 +0000 (12:24 +0900)]
[IA64] paravirtualize itc and support save/restore.
ia64 linux 2.6.18 only use ar.itc for local ticks so that
ar.itc didn't need paravirtualization and it can be work arounded
when save/restore.
However recent ia64 linux uses ar.itc for sched_clock() and
CONFIG_VIRT_CPU_ACCOUNTING and other issues. So ar.itc needs
paravirtualization. Although Most part is done in guest OS,
save/restore needs hypervisor support.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Isaku Yamahata [Mon, 5 Jan 2009 03:24:58 +0000 (12:24 +0900)]
[IA64] remove warning.
This patch removes the following warning.
> hypercall.c:205: warning: implicit declaration of function 'vmx_lazy_load_fpu'
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Keir Fraser [Mon, 29 Dec 2008 14:13:07 +0000 (14:13 +0000)]
acpi: Reserve IO ports used by hotplug
In DSDT, reserve the IO port ranges: [0x10c0, 0x10c2] and [0xb044,
0xb047] that are used by the virtual PCI hotplug.
Or else, for a hotplugged-in device, the port IO BAR assigned by guest
OS may conflict with the ranges here.
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
Keir Fraser [Mon, 29 Dec 2008 14:08:46 +0000 (14:08 +0000)]
cpufreq: xen is default cpufreq, userspace is default governor (override on cmdline)
Set userspace governor as default, which stays same effect
as when cpufreq in xen is not enabled. As a result, enable cpufreq
in xen by default to avoid reboot to activate cpufreq. Now it's
always on but w/o performance impact if user doesn't attempt
to change governor.
Add governor option at cmdline, add some warning info for debug.
Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
Keir Fraser [Mon, 29 Dec 2008 14:05:26 +0000 (14:05 +0000)]
x86, vmx: Fix single step on debugger
Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
Keir Fraser [Mon, 29 Dec 2008 14:03:26 +0000 (14:03 +0000)]
x86, mce: Fix x86_mcinfo_getptr is called when no error found
The machine_check_poll() is called with mi which is set by
x86_mcinfo_getptr() everytime. But, I think it should not be called
when there is no error, because error_idx and fetch_idx cannot work
together.
Signed-off-by: Kazuhiro Suzuki <kaz@jp.fujitsu.com>
Keir Fraser [Mon, 29 Dec 2008 14:00:45 +0000 (14:00 +0000)]
rombios: disable DEBUG_ROMBIOS by default.
Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
Keir Fraser [Mon, 29 Dec 2008 14:00:15 +0000 (14:00 +0000)]
rombios: pass BDF correctly during option ROM scan
Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
Keir Fraser [Mon, 29 Dec 2008 13:55:59 +0000 (13:55 +0000)]
rombios: enabling option ROM write access during initialisation.
Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
Keir Fraser [Mon, 29 Dec 2008 13:37:46 +0000 (13:37 +0000)]
cpufreq: Fix a cpufreq cmdline parse bug, and change sample_rate unit
Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
Keir Fraser [Mon, 29 Dec 2008 13:32:32 +0000 (13:32 +0000)]
x86: Do not restrict 32-bit EPT to 4GB.
Signed-off-by: Xin, Xiaohui <xiaohui.xin@intel.com>
Keir Fraser [Mon, 29 Dec 2008 13:30:14 +0000 (13:30 +0000)]
x86, intel: Clear Error counter field when set new cmci owner
Since cmci might happened when cpu is taking down (cpu hotplug) before
setting new cmci owner while old owner is down. We need to clear the
corrected error counter field to make sure CMCI could be triggered on
the new owner.
Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com>
Signed-off-by: Liping Ke <liping.ke@intel.com>
Isaku Yamahata [Wed, 24 Dec 2008 03:52:34 +0000 (12:52 +0900)]
merge with xen-unstable.hg
Isaku Yamahata [Wed, 24 Dec 2008 03:50:57 +0000 (12:50 +0900)]
[IA64]: Fix BUILD_BUG_ON().
This is ia64 counter part of
1419a73316e1.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Isaku Yamahata [Wed, 24 Dec 2008 03:50:55 +0000 (12:50 +0900)]
[IA64]: fix compilation error.
BUILD_BUG_ON() was changed so that now BUILD_BUG_ON() can't be
used with symbol values.
Fortunately dom_fpswa_hypercall_patch() isn't performance critical
so replace BUILD_BUG_ON() with BUG_ON().
Fixed the wrong condition which has off-by-one bug.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Keir Fraser [Mon, 22 Dec 2008 13:48:40 +0000 (13:48 +0000)]
i386: Fix the build.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Mon, 22 Dec 2008 13:43:13 +0000 (13:43 +0000)]
shadow: Remove warnings about writes to read-only BIOS area. These
attempts can be legitimate.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Mon, 22 Dec 2008 12:07:20 +0000 (12:07 +0000)]
Cleanup Intel CMCI support.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Mon, 22 Dec 2008 08:12:33 +0000 (08:12 +0000)]
Enable CMCI for Intel CPUs
Signed-off-by Yunhong Jiang <yunhong.jiang@intel.com>
Signed-off-by Liping Ke <liping.ke@intel.com>
Keir Fraser [Fri, 19 Dec 2008 14:56:36 +0000 (14:56 +0000)]
Support S3 for MSI interrupt
From: "Jiang, Yunhong" <yunhong.jiang@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Fri, 19 Dec 2008 14:52:32 +0000 (14:52 +0000)]
Change the pcidevs_lock from rw_lock to spin_lock
As pcidevs_lock is changed from protecting only the alldevs_list to
more than that, it doesn't benifit too much from the rw_lock. Also the
previous patch 18906:
2941b1a97c60 is wrong to use read_lock to protect some
sensitive data (thanks Espen pointed out that).
Also two minor fix in this patch:
a) deassign_device will deadlock when try to get the pcidevs_lock if
called by pci_release_devices, remove the lock to the caller.
b) The iommu_domain_teardown should not ASSERT for the pcidevs_lock
because it just update the domain's vt-d mapping.
Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com>
Keir Fraser [Fri, 19 Dec 2008 14:44:40 +0000 (14:44 +0000)]
CPUIDLE: adjust cstate statistic interface
1. change unit of residency, PM ticks -> ns.
2. output C0 usage & residency.
Signed-off-by: Wei Gang <gang.wei@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Fri, 19 Dec 2008 13:42:04 +0000 (13:42 +0000)]
VT-d: Fix PCI-X device assignment
When assign PCI device, current code just map its bridge and its
secondary bus number and devfn 0. It doesn't work for PCI-x device
assignment, because the request may be the source-id in the original
PCI-X transaction or the source-id provided by the bridge. It needs to
map the device itself, and its upstream bridges till PCIe-to-PCI/PCI-x
bridge.
In addition, add description for DEV_TYPE_PCIe_BRIDGE and
DEV_TYPE_PCI_BRIDGE for understandability.
Signed-off-by: Weidong Han <weidong.han@intel.com>
Keir Fraser [Thu, 18 Dec 2008 17:18:28 +0000 (17:18 +0000)]
xend: Actually restrict a domU's access to xenstore when we mean to --
this means that in some cases it cannot be owner of its own xenstore
nodes.
This bug was pointed out by Daniel Berrange at Red Hat. This patch is
my own more generic fix that automatically covers a range of callers
(albeit the patch is arguably a bit of a hack ;-).
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Thu, 18 Dec 2008 17:14:27 +0000 (17:14 +0000)]
x86: Quieten tracing in msi startup/shutdown handlers.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Thu, 18 Dec 2008 14:52:53 +0000 (14:52 +0000)]
rombios: Update to Bochs latest
Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
Keir Fraser [Thu, 18 Dec 2008 11:29:33 +0000 (11:29 +0000)]
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>
Keir Fraser [Thu, 18 Dec 2008 11:28:25 +0000 (11:28 +0000)]
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>
Keir Fraser [Thu, 18 Dec 2008 11:27:37 +0000 (11:27 +0000)]
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>
Keir Fraser [Wed, 17 Dec 2008 11:36:22 +0000 (11:36 +0000)]
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>
Keir Fraser [Tue, 16 Dec 2008 13:14:25 +0000 (13:14 +0000)]
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>
Keir Fraser [Tue, 16 Dec 2008 12:04:13 +0000 (12:04 +0000)]
x86: Update xen-detect utility to scan for Xen signature in CPUID space.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Tue, 16 Dec 2008 12:00:25 +0000 (12:00 +0000)]
mini-os: Make utility function get_self_id() in fs-front.c public.
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
Keir Fraser [Tue, 16 Dec 2008 11:59:22 +0000 (11:59 +0000)]
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>
Keir Fraser [Tue, 16 Dec 2008 11:54:11 +0000 (11:54 +0000)]
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>
Keir Fraser [Tue, 16 Dec 2008 11:49:20 +0000 (11:49 +0000)]
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>
Keir Fraser [Mon, 15 Dec 2008 11:37:14 +0000 (11:37 +0000)]
x86: Decode CPUID for TSC guarantees.
Signed-off-by: Wei Gang <gang.wei@intel.com>
Keir Fraser [Mon, 15 Dec 2008 11:23:22 +0000 (11:23 +0000)]
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>
Keir Fraser [Mon, 15 Dec 2008 11:17:14 +0000 (11:17 +0000)]
x86: Small cleanups to time handling.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Sat, 13 Dec 2008 17:44:20 +0000 (17:44 +0000)]
xenpmd: Fix bogus fgets() size parameter.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Sat, 13 Dec 2008 15:56:16 +0000 (15:56 +0000)]
x86: Clean up and simplify rwlock implementation.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Sat, 13 Dec 2008 15:28:10 +0000 (15:28 +0000)]
Clean up use of spin_is_locked() and introduce rw_is_locked().
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Sat, 13 Dec 2008 15:04:53 +0000 (15:04 +0000)]
xc_pm: Fix off-by-one error in string array access.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Keir Fraser [Sat, 13 Dec 2008 15:02:55 +0000 (15:02 +0000)]
x86: Fix early time initialisation after recent changes.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Isaku Yamahata [Fri, 12 Dec 2008 01:43:39 +0000 (10:43 +0900)]
IA64: quieten PV fp fault/trap handler.
Now fp fault/trap is handled correctly except the case fpswa
returns error. So quieten the handler.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Isaku Yamahata [Fri, 12 Dec 2008 01:36:23 +0000 (10:36 +0900)]
IA64: fix panic caused by daccess fault.
While fpswa emulation, Xen VMM access guest virtual address space
which may cause daccess fault resulting in panic.
This patch make daccess fault handler handle such cases properly.
(XEN) Xen BUG at faults.c:583
(XEN) FIXME: implement ia64 dump_execution_state()
(XEN)
(XEN) Call Trace:
(XEN) [<
f4000000040fe360>] show_stack+0x90/0xb0
(XEN) sp=
f0000002b6067940 bsp=
f0000002b6061860
(XEN) [<
f4000000040fee70>] dump_stack+0x30/0x50
(XEN) sp=
f0000002b6067b10 bsp=
f0000002b6061840
(XEN) [<
f4000000040640d0>] __bug+0x70/0xa0
(XEN) sp=
f0000002b6067b10 bsp=
f0000002b6061810
(XEN) [<
f4000000040b53b0>] ia64_handle_reflection+0x60/0x13b0
(XEN) sp=
f0000002b6067b10 bsp=
f0000002b60617b8
(XEN) [<
f4000000040f5b40>] ia64_leave_kernel+0x0/0x300
(XEN) sp=
f0000002b6067b20 bsp=
f0000002b60617b8
(XEN) [<
f4000000040c3a20>] __get_domain_bundle+0x0/0x40
(XEN) sp=
f0000002b6067d20 bsp=
f0000002b6061778
(XEN) [<
f4000000040bee20>] vcpu_get_domain_bundle+0xb0/0xa10
(XEN) sp=
f0000002b6067d20 bsp=
f0000002b60616e8
(XEN) [<
f4000000040b3f20>] handle_fpu_swa+0x360/0x4a0
(XEN) sp=
f0000002b6067d60 bsp=
f0000002b6061660
(XEN) vcpu.c:1371: vcpu_get_domain_bundle gip 0x40000000000008a0
(XEN) [<
f4000000040b5e90>] ia64_handle_reflection+0xb40/0x13b0
(XEN) sp=
f0000002b6067df0 bsp=
f0000002b6061610
(XEN) vcpu.c:1371: vcpu_get_domain_bundle gip 0x4000000000000730
(XEN) faults.c:343:d6 handle_fpu_swa(fault): floating-point bundle at 0x4000000000000730 not mapped
(XEN) [<
f4000000040f5b40>] ia64_leave_kernel+0x0/0x300
(XEN) sp=
f0000002b6067e00 bsp=
f0000002b6061610
(XEN) vcpu.c:1371: vcpu_get_domain_bundle gip 0x40000000000008a0
(XEN) faults.c:343:d6 handle_fpu_swa(fault): floating-point bundle at 0x40000000000008a0 not mapped
(XEN)
(XEN) ****************************************
(XEN) Panic on CPU 15:
(XEN) Xen BUG at faults.c:583
(XEN) ****************************************
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Isaku Yamahata [Fri, 12 Dec 2008 01:35:58 +0000 (10:35 +0900)]
IA64: make the fpswa emulation keep the previous behaviour.
When fpswa library return statue > 0, keep the previous behavior.
This case should be addressed somehow later, but it seems somewhat
difficult to resolve, so keep the previous behavor for now.
It is assumed that a guest kernel calls fpswa library
without preemption. This assumption breaks if a guest kernel is
preemptive.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Isaku Yamahata [Fri, 12 Dec 2008 01:34:18 +0000 (10:34 +0900)]
IA64: fix fp fault/trap handler.
This patch is a part of fixes to bug reported as
http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=1392
When fpswa handler fails to get a bundle in guest,
fp fault/trap should be injected into the guest and let a guest
to handle it.
When the fpswa library return a error, there is no way to
pass the value to the guest. In that case, just inject fpswa
fault/trap into a guest running a risk that guest may get
error with their own fpswa call. Here it is assumed that
no applications depend on SIGFP process signal to recover
their computation.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Isaku Yamahata [Fri, 12 Dec 2008 01:29:15 +0000 (10:29 +0900)]
IA64: fix emulation of fp emulation in pv domain
This patch is a part of fixes to bug reported as
http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=1392
When vmm fails to get a bundle in a question during fpswa processing,
there is no way, but a guest provides the bundle.
On the other hand the current implementation just returns random value.
This patch make the fpswa hypercall calling convention complicated and
pass necessary informations to the hypervisor.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Keir Fraser [Thu, 11 Dec 2008 22:32:20 +0000 (22:32 +0000)]
xentop: Fix fprintf() build failure.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Thu, 11 Dec 2008 13:26:02 +0000 (13:26 +0000)]
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>
Keir Fraser [Thu, 11 Dec 2008 13:25:28 +0000 (13:25 +0000)]
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>
Keir Fraser [Thu, 11 Dec 2008 13:10:19 +0000 (13:10 +0000)]
x86: Clean up early time setup.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Thu, 11 Dec 2008 13:09:59 +0000 (13:09 +0000)]
vga: Only vga_endboot() if vga_init() completed.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Thu, 11 Dec 2008 11:49:37 +0000 (11:49 +0000)]
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>
Keir Fraser [Thu, 11 Dec 2008 11:48:19 +0000 (11:48 +0000)]
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>