sh_remove_all_mappings() will walk roughly half of the shadow L1
tables for each MFN it's called with; calling it for every MFN in a
guest's framebuffer can be _very_ expensive, especially with the
shadow lock held across the whole operation. Avoid that by just
blowing away all the shadows.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Except for a published BIOS errata on family 11h processors,
all AMD servers that have the Invariant TSC bit set have
a reliable TSC so Xen should not write to the TSC.
Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Acked-by: Mark Langsdorf <mark.langsdorf@amd.com>
Fix the error of translation from int remapping table entry(IRTE) to
MSI msg. This error may write wrong IRTE back to the VTd hardware, and
block physical interrupts.
Signed-Off-By: Zhai Edwin <edwin.zhai@intel.com>
Fix the check in io_has_perm() to correctly check the start and end
of I/O Memory.
Signed-off-by : George Coker <gscoker@alpha.ncsc.mil>
Signed-off-by : Paul Nuzzi <pjnuzzi@tycho.ncsc.mil>
The PowerNow! driver does not support RevF and earlier parts.
The current code checks for RevF processors in a function that
is not called. Change the code path so that RevF processors
are detected and the driver fails registration.
Also fix cpufreq_add_cpu() to handle unsuccessful registration.
Signed-off-by: Mark Langsdorf <mark.langsdorf@amd.com>
The pause and unpause paths are currently broken due to a missing
slash. I took advantage of the opportunity to remove code repetition,
repeated strings that should point to the proper constants, etc
From: Andres Lagar Cavilla <andreslc@cs.toronto.edu>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
This patch exposes the getenforce and setenforce functionality for the
Flask XSM module.
Signed-off-by : Machon Gregory <mbgrego@tycho.ncsc.mil>
Signed-off-by : George S. Coker, II <gscoker@alpha.ncsc.mil>
This patch adds securty checks for pci passthrough related hypercalls
to enforce that the current domain owns the resources that it is about
to remap. It also adds a call to xc_assign_device to xend and removes
the PRIVILEGED_STUBDOMS flags.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
check_sharing() in blktapctrl does not work.
- It accesses to xenstore by using wrong paths.
- It compares image paths including image types.
- It misjudges a return value of strcmp().
This patch fixes those mistakes.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
running qemu with valgrind I found I couple of small memory leaks in
libxc, this patch fixes them.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Set map_frames_ex's stride parameter to 0 and increment to 1 to avoid
building an explicit list of mfns.
Signed-Off-By: Samuel Thibault <samuel.thibault@ens-lyon.org>
This patch adds support for mmap on /dev/mem in a stubdom; it is
secure because it only works for memory areas that have been
explicitly allowed by the toolstack (xc_domain_iomem_permission).
Incidentally this is all that is needed to make MSI-X passthrough work
with stubdoms.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To avoid strange output from debug-key "i", desc->affinity should
be the subset of the cfg->domain basically, so copy cfg->domain to
desc->affinity after assigning vector for the irq..
Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
1. Calling VDB.set_bootable(True) results in string 'True' in managed
config file. After xend restart, conversion int(bootable) in
server/blkif.py fails.
2. selection of bootable disks in XendDomainInfo.py requires
type(bootable) == int not str, otherwise all disks are taken as
bootable.
This patch converts the bootable flag always to int.
Signed-off-by: Lutz Dube <Lutz.Dube@ts.fujitsu.com>
This was happening for xmalloc request sizes between 3921 and 3951
bytes. The reason being that xmem_pool_alloc() may add extra padding
to the requested size, making the total block size greater than a
page.
Rather than add yet more smarts about TLSF to _xmalloc(), we just
dumbly attempt any request smaller than a page via xmem_pool_alloc()
first, then fall back on xmalloc_whole_pages() if this fails.
Based on bug diagnosis and initial patch by John Byrne <john.l.byrne@hp.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
This patch fixes the circular dependency problem in the toolstack that
prevented pci coldplug from working with stubdoms: after creating the
stubdom we wait for it to be properly initialized before going
further. We release the domain lock while we wait.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
When program msi, it has to mask it first, otherwise, it
may generate inconsistent interrupts. According to spec,
if not masked, the interrupt generation behaviour is undefined.
Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
The new nomigrate option can be set to non-zero in vm.cfg
(for both hvm and pvm) to disallow a guest from being
migrated or restored. (Save is still allowed for the purpose
of checkpointing.) The option persists into a save file
and is also communicated into the hypervisor, the latter
for the purposes of a to-be-added hypercall for communicating
to guests that migration is disallowed (which will be
used initially for userland TSC-related sensing, but may
find other uses).
Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Allow a guest to register a second location for the VCPU time info
structure for each vcpu. This is intended to allow the guest kernel
to map this information into a usermode accessible page, so that
usermode can efficiently calculate system time from the TSC without
having to make a syscall.
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
This reverts changeset 20323: 2370e16ab6d3 and adds a small
check to iommu_setup() which should more correctly cover all cases.
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
When running in PAE mode, Windows 7 (apparently) will occasionally
switch cr3 with one of the L3 entries invalid, make it valid, and then
expect the hardware to load the new value. (This behavior is
explicitly not promised in the hardware manuals.) This leads to a
situation where on a shadow fault, the guest walk succeeds but the
shadow walk fails. The code assumes this can only happen when the
domain is dying, and makes an ASSERT() to that effect. So currently,
in debug mode, this will cause the host to crash; in non-debug mode,
this will cause a page-fault loop.
This patch solves the problem by calling update_cr3() in that path
when the guest is in PAE mode, and only ASSERT()ing when the guest is
not in PAE mode. The guest will get one spurious page fault, but
subsequent accesses will succeed.
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
This patch enlarges interrupt remapping table to fix the out-of range
table access when using many multiple-function PCI devices.
Invalidation queue is also expanded.
Signed-Off-By: Zhai Edwin <edwin.zhai@intel.com>
Signed-Off-By: Cui Dexuan <dexuan.cui@intel.com>
There is a race between guest setting new vector and doing EOI on old
vector. Once guest sets new vector before its doing EOI on vector,
when guest does eoi, hypervisor may fail to find the related pirq, and
hypervisor may miss to EOI real vector and leads to system hang. We
may need to add a timer for each pirq interrupt source to avoid host
hang, but this is another topic, and will be addressed later.
Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
We can destroy a VDI by VDI.destroy even if the VDI is being used
to VBDs. This patch checks that the VDI is not used to VBDs.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
The general cpufreq infrastructure has been improved over the
last year. Update the AMD PowerNow! driver powernow.c to
take advantage of those improvements.
Specifically, addresses Novell bugzilla # 530035.
Signed-of-by: Mark Langsdorf <mark.langsdorf@amd.com>
When the option pci-passthrough-strict-check of
/etc/xen/xend-config.sxp is set to 'no', we don't check the
non-page-aligned MMIO BAR. This could be useful in some cases, e.g.,
when there is only 1 device in the range of the page and we try to
assign the device to pv guest.
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
Xen panics when "acpi=off noacpi" is set. Problem is caused by
dereferencing NULL pointer in drhd after calling
acpi_find_matched_drhd_unit. As acpi_find_matched_drhd_unit can
return NULL, checks has to be done before returned value is used.
From: Miroslav Rezanina <mrezanin@redhat.com>
Signed-off-by: Keir Fraser <keir.fraser@eu.citrix.com>
For vt-d's mmio address ranges, once ept enables, they should
be added to ept page tables with p2m lock held, and then guest can
access these ranges like conventional ram, but to change the ept
entries, it should take the p2m lock first.
Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Add a new option "description=" to each VM to increase the
manageability of VM, which could be accessed via "xm list -l
MACHINE".e.g add "description='(name, james),(priority 5), (owner
james.song@company.com)'" to configure file, User can get the VM's
attribute easily by "xm list -l Machine" or some tools.
Signed-off-by: James Song<jsong@novell.com>
It should be run on dom0 on gdbsx enabled hypervisor. For details,
please see tools/debugger/gdbsx/README
Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
In XenAPI mode, when we start a VM by using xm create command, VDIs
are always automatically created for VBDs. Once we shut down the
VM, then start the VM again, then VDIs are newly created. As a
result, a vdi.xml file continues to expand.
This patch reuses VDIs if location of the VDIs is same.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>