Commit Graph
18802 Commits
Author SHA1 Message Date
Keir Fraser c193d476f0 Properly distinguish irq and vector spaces
This makes sure that there are no assumptions about NR_IRQS==NR_VECTORS
anymore, and it also renames various variables to properly reflect
what they represent.

While coded correctly, I wonder whether dump_irqs() shouldn't iterate
over the vector space rather than the irq space, so that MSI entries
are also processed.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2008-11-20 14:22:54 +00:00
Keir Fraser a5b98f7f34 x86: freeze non-current vCPUs of dom0 before entering S5
Signed-off-by: Jan Beulich <jbeulich@novell.com>
2008-11-20 14:21:17 +00:00
Keir Fraser ed2dbb7a0f xend: Make _setCPUAffinity() errors nonfatal on domain resume
This patch allows domains to be resumed on different number of CPUs. After
c/s 18764, a domain cannot be resumed when _setCPUAffinity() fails, which
happens when affinity should be set to a non-existent CPU. This patch
makes _setCPUAffinity() errors nonfatal.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2008-11-20 14:17:09 +00:00
Keir Fraser 9e70091fd7 x86, hpet: Fix initialisation of secondary timers.
Each channel may have different settings, and in the original
implementation, other Tn configuration will accidently overwrite T0
configuration.

Signed-off-by: Guanqun Lu <guanqun.lu@intel.com>
2008-11-20 14:15:50 +00:00
Keir Fraser c014d5785e xenapi: fix valid_object typo
Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
2008-11-20 14:14:20 +00:00
Keir Fraser ee324ed5c4 x86: Fix build for some versions of gcc.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-11-19 19:13:22 +00:00
Keir Fraser 65408dcf21 x86: secure ioapic_guest_write() against FREE_TO_ASSIGN irq values
Signed-off-by: Jan Beulich <jbeulich@novell.com>
2008-11-19 16:11:39 +00:00
Keir Fraser ceb1434f7d x86: support CPUID hypervisor feature bit
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-11-19 16:10:39 +00:00
Keir Fraser e1054557f9 x86, s3: Sync platform stamps at time suspend.
platform_timer_stamp and stime_platform_stamp are synced
to platform timer in time calibration (1s interval), and
thus doesn't reflect the latest value. If they're not
synced at time suspend, the offset can be lost after S3
resume. Average 0.8s lag-behind is observed for each S3
action, which accumulates to TOD inaccuracy.

Signed-off-by Kevin Tian <kevin.tian@intel.com>
2008-11-19 13:17:31 +00:00
Keir Fraser de48794325 Remove Xen-private definitions from kexec public header.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-11-19 13:13:39 +00:00
Keir Fraser 71e53fef6c xen s3, No need to check idle vcpu before update_vcpu_system_time().
Signed-off-by: Kevin Tian <kevin.tian@intel.com>
2008-11-19 12:52:03 +00:00
Keir Fraser f8b45adac4 x86, hpet: Avoud double initialisation on boot or after S3.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-11-19 12:48:31 +00:00
Keir Fraser 6146e844ab x86: Fix the clocksource= boot parameter after c/s 18786.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-11-19 12:40:23 +00:00
Keir Fraser d25a1286b4 x86, hvm: Fix domain restore bug with Intel VLAPIC acceleration.
r18383 mark video memory as ram, and make all valid pages migrated,
including vlapic page (0xFEE00), and share page(0xFFFFF).
An extra memory population for lapic page would override previous
mapping then cause HVM guest with vlapic acceleration hang.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-11-18 15:59:26 +00:00
Keir Fraser a67183644e x86: Re-initialise HPET on resume from S3
Signed-off-by: Guanqun Lu <guanqun.lu@intel.com>
Signed-off-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-11-18 15:55:14 +00:00
Keir Fraser bf7a186287 x86, time: Clean up platform timer initialisation.
Signed-off-by: Guanqun Lu <guanqun.lu@intel.com>
Signed-off-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-11-18 15:39:31 +00:00
Keir Fraser 5f8902540c x86, hvm: Implement interrupt routing to least priority processor.
Instead of round robin the vcpu with the lowest processor
priority is selected for the interrupt. If multiple vcpus
share the same low priority then interrupts are distributed between
those round robin.

Signed-off-by: Juergen Gross <juergen.gross@fujitsu-siemens.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-11-18 11:16:36 +00:00
Keir Fraser eab9e6e242 vtd: fix memory allocation from NUMA node for VT-d.
Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
2008-11-18 10:52:42 +00:00
Keir Fraser a4c8fdfc7c hvm: Fix hvm_vcpu_reset_state() to act on specified domain, rather
than current.

Signed-off-by: Liping Ke <liping.ke@intel.com>
2008-11-17 15:55:56 +00:00
Keir Fraser 336c683373 tools: use sysfs interface to balloon driver if present
The pvops dom0 kernel does not expose the balloon driver via
/proc/xen, so use the sysfs interface.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
2008-11-17 15:54:31 +00:00
Keir Fraser b332f34777 Remove NR_PIRQS definition -- always use NR_IRQS.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-11-14 14:33:25 +00:00
Keir Fraser 541e42472a Fix to save CPU affinity for xm save/restore
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-11-14 14:27:51 +00:00
Keir Fraser 317b951c7b vt-d: Fix ia64 build.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-11-14 14:27:08 +00:00
Keir Fraser f250210b16 x86: don't disable MSI in order to mask an IRQ
... as that's not really correct, and there are devices which can't
even cope with that. Instead, check whether an MSI IRQ can be masked,
and if it can't, treat it just like a level triggered IO-APIC IRQ.

There's one other bug fix in here, correcting an off-by-one error on
the entry_nr range check in __pci_enable_msix().

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2008-11-13 16:31:08 +00:00
Keir Fraser f49717baea x86, hvm: Provide access to limited VCPUOP_ hypercalls.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-11-13 14:19:56 +00:00
Keir Fraser 49bd5ded4e x86: Use the shadow-code PT walker from the HAP functions
Replace the guts of the HAP pagetable walker with a call to the
newly-commonified walker from the shadow code.  This reduces
duplication, and gives HAP guests proper access control and A/D-bit
setting for memory accesses from the emulator

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2008-11-13 13:03:16 +00:00
Keir Fraser 8bbb3c689c x86: Move the guest pagetable walker out of shadow/multi.c
Move the guest PT walker into its own file, and purge it of references
to the rest of the shadow code.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2008-11-13 13:02:08 +00:00
Keir Fraser c7b0916019 x86: Move guest_l*e definitions into common code
Move the definitions of guest pagetable types and the guest pagetable
walk record out of the shadow-code headers into asm-x86.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2008-11-13 13:01:22 +00:00
Keir Fraser 3c66521c46 xm: display domain id on domain creation
Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2008-11-13 10:50:50 +00:00
Keir Fraser be3d9af19c x86: add SSE-based copy_page()
In top of the highmem asstance hypercalls added earlier, this provides
a performance improvement of another 12% (measured on Xeon E5345) for
the page copying case.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2008-11-12 12:04:15 +00:00
Keir Fraser 71e65dbc3e x86: reduce GDT switching
Both idle and HVM vCPU-s can easily run on the GDT mapped into general
hypervisor space (rather than that placed in per-vCPU virtual space).

This makes unnecessary some of the additions c/s 18520 did.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2008-11-12 12:01:35 +00:00
Keir Fraser ac1e2634bc xend, pciif: fix some indentation
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2008-11-12 11:50:25 +00:00
Keir Fraser 98cb2ef797 hvm: fix single stepping on debugger
The debuggee domain will die with unexpected trap
on single stepping of emulated instruction.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-11-11 11:47:03 +00:00
Keir Fraser ef755ee444 vmx: Clean up exception delivery logic.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-11-11 11:35:00 +00:00
Keir Fraser 12c17be8e9 x86: fix getvcpucontext for HVM segment registers
Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-11-11 11:13:57 +00:00
Keir Fraser 2bca9275d1 vmx: Fix realmode exception delivery to correctly check stack pointer size.
Bug tracked down by Tim Deegan <tim.deegan@citrix.com>

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-11-11 11:10:59 +00:00
Keir Fraser 0b33972b25 vtd cleanup: change some function return types to void
iommu_suspend(), iommu_resume(), iommu_enable() translation don't have
meaningful return values.  Changed their function types to void.

Signed-off-by: Allen Kay <allen.m.kay@intel.com>
2008-11-11 11:07:21 +00:00
Keir Fraser 21f2630b0f xend: Restore CPU affinity on domain resume.
Move affinity-setting logic into its own function and call from
relevant places.

From: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-11-11 11:06:27 +00:00
Keir Fraser a1ffd2d114 minios: add a barebone net/if.h
net/if.h is a standard header but unfortunately lwip doesn't provide
it for any target but linux. Therefore I am adding a net/if.h, with an
empty implementation of the declared functions.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2008-11-11 11:03:58 +00:00
Keir Fraser 82c9748428 vtd: fix interrupt remapping to handle SMI RTE's with uninitialized
reserved fields

Some BIOS does not zero out reserve fields in IOAPIC RTE's.
clear_IO_APIC() zeroes out all RTE's except for RTE with MSI delivery
type.  This is a problem when the host OS converts SMI delivery type
to some other type but leaving the reserved field uninitialized.  This
can cause interrupt remapping table out of bound error if "format"
field is 1 and the uninitialized "index" field has a value that that
is larger than the maximum index of interrupt remapping table.

Signed-off-by: Allen Kay <allen.m.kay@intel.com>=
2008-11-10 10:41:41 +00:00
Keir Fraser ed675eda42 x86, vmx realmode: Stack manipulation on interrupt/exception injection
should respect SS size, not CS size.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-11-07 17:06:21 +00:00
Keir Fraser 925f5786c7 xenpm: Fix an error path.
Signed-off-by: Jinsong Liu <jinsong.liu@intel.com>
2008-11-07 17:00:39 +00:00
Keir Fraser f1a4dd1545 x86, hvm: Better MTRR type check.
From: Disheng Su <disheng.su@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-11-06 11:50:21 +00:00
Keir Fraser fc7613ed39 x86: Fix an inverted flags conversion in map_page_to_xen()
Signed-off-by: Jan Beulich <jbeulich@novell.com>
2008-11-06 11:48:11 +00:00
Keir Fraser 2d0a9babf4 x86: Use gfn_to_mfn() rather than gfn_to_mfn_current() in callers
which can execute on arbitrary domains.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-11-06 11:07:02 +00:00
Keir Fraser bd1cd81d64 x86: PV support for hugepages
Hugepage support must be enabled via the hypervisor command line
option "allowhugepage". There is currently no support in the tools for
saving/restoring/migrating guests who use hugepages.

Signed-off-by: Dave McCracken <dave.mccracken@oracle.com>
2008-11-05 10:57:21 +00:00
Keir Fraser 5c111d24bd x86: fix a typo
Signed-off-by Kevin Tian <kevin.tian@intel.com>
2008-11-05 10:26:19 +00:00
Keir Fraser f154ddb585 x86, hvm: Only warn on memory attribute conflicts for real RAM.
From: Disheng Su <disheng.su@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-11-05 10:25:11 +00:00
Keir Fraser 9d2a3ef6e8 xend, security: Prevent changing of the policy while VMs are migrating
The net changes of this patch are that the reader-side lock is put
into the path of the migration code and the writer lock into the path
of the code that handles the changing of the policy. Simultaneous
migrations of multiple hosts still work after this lock has been added.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2008-11-05 10:23:26 +00:00
Keir Fraser 4b5d0b9cfb xend: Add a multi-reader-single-writer lock implementation
This patch adds a reader-writer lock primitive to xend since python
does not provide it by default. The implementation is based on a
condition variable. Some test code is appended at the end of the file.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2008-11-05 10:22:19 +00:00