Commit Graph
19002 Commits
Author SHA1 Message Date
Keir Fraser b2d41b2077 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>
2009-01-07 11:25:00 +00:00
Keir Fraser b988ec6b11 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>
2009-01-07 11:21:50 +00:00
Isaku Yamahata 21887335cd [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>
2009-01-07 14:28:33 +09:00
Isaku Yamahata 7e9a3beb1e [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>
2009-01-07 14:27:03 +09:00
Isaku Yamahata e2b255ceff [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>
2009-01-07 12:20:31 +09:00
Isaku Yamahata 4d44b2eab3 merge with xen-unstable.hg 2009-01-07 12:20:18 +09:00
Isaku Yamahata fc10580219 [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>
2009-01-07 12:19:36 +09:00
Keir Fraser 303e213ce3 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>
2009-01-06 16:06:13 +00:00
Keir Fraser 872a09d262 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>
2009-01-06 16:02:10 +00:00
Keir Fraser 15c5bb9f92 xend: Fix error handling in device_create().
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2009-01-06 14:01:39 +00:00
Keir Fraser e3b7dde955 rombios: Do not initialise PCI devices after hvmloader.
Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
2009-01-06 14:00:58 +00:00
Keir Fraser f498e9065d hvm: Tell Viridian-enabled OS to relax timer interrupt checks.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-06 13:58:13 +00:00
Keir Fraser ece13f1fb3 x86: Disable MSI as it seems to be triggering ASSERT at irq.c:269.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-06 13:27:55 +00:00
Keir Fraser 7e72c30726 libxc: Define xc_ffs{8,16,32,64} functions. Use them.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-06 09:14:39 +00:00
Isaku Yamahata ed848f202a [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>
2009-01-06 18:05:32 +09:00
Keir Fraser c5e9f7aa3a x86: Poison initmem at end of Xen bootstrap
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-05 11:55:24 +00:00
Keir Fraser 0f326f46eb vmx: Print advanced features during boot
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-05 11:52:34 +00:00
Keir Fraser cbd07b72a3 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>
2009-01-05 11:19:16 +00:00
Keir Fraser 75c35a3fb6 Cpufreq: simplify cpufreq_statistic_lock init
Singed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
2009-01-05 11:16:41 +00:00
Keir Fraser 34c6decb5e 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>
2009-01-05 11:16:12 +00:00
Keir Fraser 8005ca26cb Cpufreq: remove redundant fragments
Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
2009-01-05 11:15:40 +00:00
Keir Fraser dca0b1a805 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>
2009-01-05 11:14:18 +00:00
Keir Fraser 19e94db949 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>
2009-01-05 11:13:22 +00:00
Keir Fraser 1d6e30c679 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>
2009-01-05 11:08:53 +00:00
Keir Fraser 446b916ca1 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>
2009-01-05 11:08:25 +00:00
Keir Fraser fcb1a7ac2f p2m: Small audit fixes.
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2009-01-05 10:47:51 +00:00
Keir Fraser 5bbed21d17 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>
2009-01-05 10:47:03 +00:00
Keir Fraser f5fec95647 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>
2009-01-05 10:46:37 +00:00
Keir Fraser 36e3044132 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>
2009-01-05 10:45:48 +00:00
Keir Fraser f25ed554f0 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>
2009-01-05 10:45:09 +00:00
Keir Fraser 9ad9a1609f 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>
2009-01-05 10:44:39 +00:00
Keir Fraser 41aa0b6269 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>
2009-01-05 10:43:50 +00:00
Keir Fraser a589ff6c17 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>
2009-01-05 10:43:19 +00:00
Keir Fraser e748f25403 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>
2009-01-05 10:42:39 +00:00
Keir Fraser 74e14a7867 PoD (populate-on-demand) memory 1/9: Add a p2m query type.
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2009-01-05 10:41:48 +00:00
Isaku Yamahata 7fa5f162da [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>
2009-01-05 14:13:38 +09:00
Isaku Yamahata d77e8b2664 [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>
2009-01-05 12:24:58 +09:00
Isaku Yamahata 658c654a05 [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>
2009-01-05 12:24:58 +09:00
Isaku Yamahata 3e67fc1ca8 [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>
2009-01-05 12:24:58 +09:00
Keir Fraser 9976adf65a 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>
2008-12-29 14:13:07 +00:00
Keir Fraser 119a6a6e07 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>
2008-12-29 14:08:46 +00:00
Keir Fraser bbdcb2fd41 x86, vmx: Fix single step on debugger
Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2008-12-29 14:05:26 +00:00
Keir Fraser 846d032508 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>
2008-12-29 14:03:26 +00:00
Keir Fraser bb53d1d5fd rombios: disable DEBUG_ROMBIOS by default.
Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
2008-12-29 14:00:45 +00:00
Keir Fraser d47fd604d0 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>
2008-12-29 14:00:15 +00:00
Keir Fraser 72d281ae08 rombios: enabling option ROM write access during initialisation.
Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
2008-12-29 13:55:59 +00:00
Keir Fraser 754ad39249 cpufreq: Fix a cpufreq cmdline parse bug, and change sample_rate unit
Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
2008-12-29 13:37:46 +00:00
Keir Fraser 723c9ab167 x86: Do not restrict 32-bit EPT to 4GB.
Signed-off-by: Xin, Xiaohui <xiaohui.xin@intel.com>
2008-12-29 13:32:32 +00:00
Keir Fraser cfbcb394f9 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>
2008-12-29 13:30:14 +00:00
Isaku Yamahata db6ae7983c merge with xen-unstable.hg 2008-12-24 12:52:34 +09:00