Commit Graph
22492 Commits
Author SHA1 Message Date
Ian Campbell c17ffaf89f libxl: return an error if connection to xenstore fails
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-12-10 18:29:50 +00:00
Ian Jackson af14d5a195 Merge 2010-12-10 18:27:54 +00:00
Jan Beulich c88b07f045 libxc: correct bounce direction for debug-key handling
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-12-10 18:27:17 +00:00
Keir Fraser a53f1cd767 mem_event: Remove unused fields and definitions.
Signed-off-by: Keir Fraser <keir@xen.org>
2010-12-10 18:20:25 +00:00
Wei Gang 3b45ec8c70 tools/ocaml: fix a typo in xc_lib.c:xc_domain_set_vpt_align
Fix a typo in xc_lib.c.

Signed-off-by: Wei Gang <gang.wei@intel.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-12-10 18:16:07 +00:00
Juergen Gross 8e6048545a tools/python: Rebuild python extensions if depends have changed
Adds depends information for building python extensions.
The extensions depend on the library binaries they are using.

Signed-off-by: juergen.gross@ts.fujitsu.com
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-12-10 18:13:15 +00:00
Jan Beulich d3d32407be xend: fix "xm block-detach 0 ..." for extended-ID devices
Simply taking stat()'s st_rdev doesn't work here, as the minor is
split into two parts, the major is present, and the "extended" bit
isn't set.

Rather than fixing this in a way that would likely be OS-dependent,
simply remove the access to the device file, and instead just parse
the provided string (as is done e.g. for block-attach).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-12-10 18:08:19 +00:00
Keir Fraser d3361c48d3 hvm vlapic: Fix tmcct read logic when in periodic mode.
Signed-off-by: Keir Fraser <keir@xen.org>
2010-12-10 16:49:05 +00:00
Keir Fraser 4000f53bc2 x86: acpi: Fix reboot attempt sequence.
Signed-off-by: Keir Fraser <keir@xen.org>
2010-12-10 16:40:05 +00:00
Keir Fraser 40bb4af7c0 x86 acpi: Follow Windows behaviour more closely during reset.
This follows some changes proposed for upstream Linux:
 1. Do not check the FADT reset register size/offset
 2. Try ACPI poking twice during our reset attempt sequence

Hopefully this will help us reset reliably on a wider range of
platforms.

Signed-off-by: Keir Fraser <keir@xen.org>
2010-12-10 11:32:19 +00:00
Keir Fraser ac989b123e tmem: Use of 'new' clashes with C++ reserved namespace.
Rename to 'creat', which does not conflict.

Signed-off-by: Keir Fraser <keir@xen.org>
2010-12-10 11:01:19 +00:00
Keir Fraser c2c4d13efe credit2: Implement cross-L2 migration "resistance"
Resist moving a vcpu from one L2 to another unless its credit
is past a certain amount.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2010-12-10 10:51:31 +00:00
Keir Fraser b913466098 credit2: Don't migrate cpus unnecessarily
Modern processors have one or two L3's per socket, and generally only
one core per L2.  Credit2's design relies on having credit shared
across several.  So as a first step to sharing a queue across L3 while
avoiding excessive cross-L2 migration

Step one: If the vcpu's current cpu is acceptable, just run it there.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2010-12-10 10:51:04 +00:00
Keir Fraser 8a743ca29c credit2: Trace rdtsc value with some more records
Makes the traces slightly larger, but easier to analyze.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2010-12-10 10:50:16 +00:00
Keir Fraser 9c95209b5b credit2: Use vcpu processor explicitly
No functional changes.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2010-12-10 10:49:48 +00:00
Keir Fraser ed00ef765e credit2: Putting a vcpu to sleep also removes the delayed_runq_add flag
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2010-12-10 10:49:20 +00:00
Keir Fraser 56343b7be1 x86: x2apic: Large cleanup
Signed-off-by: Keir Fraser <keir@xen.org>
2010-12-09 19:19:34 +00:00
Keir Fraser a50b1b8ddb Add CPU_STARTING notifier during CPU bringup.
Signed-off-by: Keir Fraser <keir@xen.org>
2010-12-09 16:17:33 +00:00
Keir Fraser d34920f300 x86: time: tsc_set_info() must skip the idle domain.
Signed-off-by: Keir Fraser <keir@xen.org>
2010-12-09 16:15:10 +00:00
Keir Fraser 45dc0eb888 Move IDLE_DOMAIN_ID defn to public header, and change DOMID_INVALID to fix clash.
Signed-off-by: Keir Fraser <keir@xen.org>
2010-12-09 10:09:59 +00:00
Keir Fraser 805a1afca3 x86: Simplify tsc_set_info() slightly -- no domain has id DOMID_INVALID.
Signed-off-by: Keir Fraser <keir@xen.org>
2010-12-09 09:57:08 +00:00
Keir Fraser 73c602edff x86:vlapic: Fix possible guest tick losing after save/restore
Guest vcpu may totally lose all ticks if the vlapic->pt.irq was not
restored during save/restore process. Fix it.

Signed-off-by: Wei Gang <gang.wei@intel.com>
2010-12-09 08:34:59 +00:00
Keir Fraser 1a5e650389 Fix xc_cpuid_hvm_policy to avoid guest CPUID feature missing.
Signed-off-by: Wei Gang <gang.wei@intel.com>
2010-12-09 08:34:04 +00:00
Keir Fraser d94fb68299 sched/arinc653: fix another unsigned < 0 comparison
replacing it with a test of the appopriate unsigned max.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2010-12-09 08:30:30 +00:00
Tim Deegan 14b3ef3645 x86/mm: change ASSERTs to BUG_ONs in mem_sharing.c
These two ASSERTs have important side-effects so make them into BUG_ONs
consistent with the rest of the file.
Bug found by Jui-Hao Chiang <juihaochiang@gmail.com>.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2010-12-08 10:46:31 +00:00
Keir Fraser ca2570b805 x86: remove BUG_ON() from QUIRK_IOAPIC_*_REGSEL handler
Since (non-pvops, 32-bit only up to 2.6.27) Linux would report "BAD"
unconditionally on all SiS chipset versions (it only looks for a PCI
device at 0000:00:00.0 with SiS as the vendor), we must not crash if
the report on a 64-bit hypervisor doesn't match the #define (which is
zero).

While we could honor the quirk indication even on 64-bit, it doesn't
seem worthwhile, as there's no evidence that newer SiS chipsets
(supporting 64-bit CPUs) are actually affected.

This should also address bug 1687 (mis-reported, however, afaict).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-12-07 18:32:04 +00:00
Keir Fraser 80d4ed4bb9 svm: dump VMCB physical address
VMCB physical address is useful for hardware debug. This small patch
dumps VMCB physical address.

Signed-off-by: Wei Huang <wei.huang2@amd.com>
2010-12-07 18:30:19 +00:00
Keir Fraser 97da42335e amd xsave: Enable SVM intercept for xsetbv instruction.
SVM introduces an intercept control bit for xsetbv instruction. This
patches enables xsetbv intercept for SVM.

Signed-off-by: Wei Huang <wei.huang2@amd.com>
2010-12-07 18:28:19 +00:00
Keir Fraser b2bef9fe49 amd xsave: Enable XSAVE/XRSTOR for SVM guest
This patch creates a common interface hanlding xsetbv.

Signed-off-by: Wei Huang <wei.huang2@amd.com>
2010-12-07 18:27:40 +00:00
Keir Fraser 658fe194c5 amd xsave: Move xsave initialization code to a common place
This patch moves xsave/xrstor code to CPU common file. First of all,
it prepares xsave/xrstor support for AMD CPUs. Secondly, Xen would
crash on __context_switch() without this patch on xsave-capable AMD
CPUs. The crash was due to cpu_has_xsave reports true in domain.c
while xsave space wasn't initialized.

Signed-off-by: Wei Huang <wei.huang2@amd.com>
2010-12-07 18:26:38 +00:00
Keir Fraser 21c4d089ba x86 hvm: x2APIC emulation
This patch would enable Xen to handle x2APIC MSR accessing of HVM
guest, which is faster(avoid decoding of MMIO accessing). The credit
comes to Gleb Natapov who complete the work for KVM.

Have tested with 4 vcpus guest, with/without x2apic support.

From: Sheng Yang <sheng.yang@intel.com>
Signed-off-by: Keir Fraser <keir@xen.org>
2010-12-07 18:24:12 +00:00
Keir Fraser 91ddbc059f x86 hvm: Fix VLAPIC TMCCT register when timer is one-shot
Signed-off-by: Keir Fraser <keir@xen.org>
2010-12-07 18:10:46 +00:00
Keir Fraser d5c277ab26 minios: reverse layering of xc vs minios fd close
Having minios close() call back into the libxc core close routines is
backwards and unexpected. On every other OS the libxc core close
routine calls close().

Export minios specific functions from the minios libxc code to
implement fd closing for each type of xc file handle and simply call
close() in the core close routine.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2010-12-03 06:37:48 +00:00
Keir Fraser bc20e3f30f MAINTAINERS: Correct Winston Wang's email address.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2010-12-03 06:36:41 +00:00
Keir Fraser b779d4c30d xen: x86_32p: fix build breakage from 22456:1b6cc8c6d1c7
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2010-12-03 06:35:40 +00:00
Keir Fraser 788b4a623e x86: Add -Wredundant-decls to Xen build flags.
Fix up the fallout.

Signed-off-by: Keir Fraser <keir@xen.org>
2010-12-02 09:37:04 +00:00
Keir Fraser 22787f2e10 ARINC 653 scheduler
From: Josh Holtrop <Josh.Holtrop@dornerworks.com>
Signed-off-by: Keir Fraser <keir@xen.org>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
2010-12-01 21:20:14 +00:00
Keir Fraser 7fe20b9f96 x86/IRQ: pass CPU masks by reference rather than by value in more places
Additionally simplify operations on them in a few cases.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-12-01 20:12:12 +00:00
Keir Fraser 4f2ae0a845 x86/IRQ: consolidate declarations
Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-12-01 20:11:30 +00:00
Keir Fraser 1901379769 x86: fix IRQ migration when using directed EOI (broken with c/s 20465)
In directed-EOI mode, there is no chance to do the migration in
mask_and_ack_level_ioapic_irq(), as the remote IRR bit can't possibly
be clear after issuing the EOI to the LAPIC. Consequently, there's no
point to even try. Instead, migration must be done in
end_level_ioapic_irq(), and it requires masking the interrupt source
prior to issuing the EOI to the IO-APIC.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-12-01 20:10:27 +00:00
Keir Fraser 4a380f72ba x86 hvm: Do not overwrite boot-cpu capability data on VMX/SVM startup.
Apparently required back in the earliest days of Xen, we now properly
initialise CPU capabilities early during bootstrap. Re-writing
capability data later now causes problems if specific features have
been deliberately masked out.

Thanks to Weidong Han at Intel for finding such a bug where XSAVE
feature is masked out by default, but then erroneously written back
during VMX initialisation. This would cause memory corruption problems
during boot for XSAVE-capable systems.

Signed-off-by: Keir Fraser <keir@xen.org>
2010-11-30 11:34:08 +00:00
Keir Fraser 9e1a3415b7 x86: fixes after emuirq changes
Signed-off-by: Wei Wang <wei.wang2@amd.com>
2010-11-29 17:44:32 +00:00
Keir Fraser 3604b2eafb x86: tighten filter on ptwr_do_page_fault()
Even not-so-recent Linux may, due to post-2.6.18 changes to the
process creation code, cause quite a number (depending on environment
and argument size) of faulting accesses to user space originating from
kernel mode. Generally those happen for non-present pages and would
lead to a nested page fault from guest_get_eff_l1e(). They can be
avoided by checking for PFEC_page_present as long as the guest isn't
running on shadow page tables.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir@xen.org>
2010-11-29 14:40:55 +00:00
Keir Fraser d4d2cb2113 x86-64: don't crash Xen upon direct pv guest access to GDT/LDT mapping area
handle_gdt_ldt_mapping_fault() is intended to deal with indirect
accesses (i.e. those caused by descriptor loads) to the GDT/LDT
mapping area only. While for 32-bit segment limits indeed prevent the
function being entered for direct accesses (i.e. a #GP fault will be
raised even before the address translation gets done, on 64-bit even
user mode accesses would lead to control reaching the BUG_ON() at the
beginning of that function.

Fortunately the fix is simple: Since the guest kernel runs in ring 3,
any guest direct access will have the "user mode" bit set, whereas
descriptor loads always do the translations to access the actual
descriptors as kernel mode ones.

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

Further, relax the BUG_ON() in handle_gdt_ldt_mapping_fault() to a
check-and-bail. This avoids any problems in future, if we don't
execute x86_64 guest kernels in ring 3 (e.g., because we use a
lightweight HVM container).

Signed-off-by: Keir Fraser <keir@xen.org>
2010-11-29 14:34:32 +00:00
Keir Fraser 375547eb76 xenpaging: increase recently used pages from 4MB to 64MB
Increase recently used pages from 4MB to 64MB.  Keeping more pages in
memory allows the guest to make more progress if the paging file spans
the entire guest memory.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
2010-11-26 14:25:30 +00:00
Keir Fraser 88267ccbbf xenpaging: handle temporary out-of-memory conditions during page-in
p2m_mem_paging_prep() should return -ENOMEM if a new page could not be
allocated. This can be handled in xenpaging to retry the
page-in. Right now such condition would stall the guest because the
requested page will not come back, xenpaging simply exits. So
xenpaging could very well retry the allocation forever to rescue the
guest.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
2010-11-26 14:23:31 +00:00
Keir Fraser b063e011a0 xenpaging: print xenpaging cmdline options
Print xenpaging arguments to simplify domain_id mapping from xenpaging
logfile to other logfiles and Xen console output.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
2010-11-26 14:22:38 +00:00
Keir Fraser 0d16f75ded xenpaging: optimize p2m_mem_paging_populate
p2m_mem_paging_populate will always put another request in the ring.
To reduce pressure on the ring, place only required requests in the
ring.  If the gfn was already processed by another thread, and the
current vcpu does not need to be paused, p2m_mem_paging_resume will do
nothing with the request.  And also xenpaging will drop the request if
the vcpu does not need a wakeup.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
2010-11-26 14:22:11 +00:00
Keir Fraser 55121cdb79 xenpaging: when populating a page, check if populating is already in progress
p2m_mem_paging_populate can be called serveral times from different
vcpus. If the page is already in state p2m_ram_paging_in and has a new
valid mfn, invalidating this new mfn will cause trouble later if
p2m_mem_paging_resume will set the new gfn/mfn pair back to state
p2m_ram_rw.  Detect this situation and keep p2m state if the page is
in the process of being still paged-out or already paged-in.  In fact,
p2m state p2m_ram_paged is the only state where the mfn type can be
invalidated.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
2010-11-26 14:21:33 +00:00
Keir Fraser cbf6a23dab xenpaging: allow negative num_pages and limit num_pages
Simplify paging size argument. If a negative number is specified, it
means the entire guest memory should be paged out. This is useful for
debugging. Also limit num_pages to the guests max_pages.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
2010-11-26 14:20:39 +00:00