[XSM] correctly located update_va_mapping hook within x86 ifdefs
The following patch addresses the issue where the XSM update_va_mapping
hook was not correctly located inside the x86 ifdefs. Included are
updates for the dummy and flask modules which are also effected by
this issue.
- update_va_mapping ifdef fix for xsm
- update_va_mapping ifdef fix for dummy module
- update_va_mapping ifdef fix for flask module
Signed-off-by: George Coker <gscoker@alpha.ncsc.mil>
Implement x86 continuable domain destroy.
This patch addresses the following bug report.
http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=1037 Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
xend: Always build lowlevel security modules, as there are some
dependencies on these from with xend proper. Signed-off-by: Keir Fraser <keir@xensource.com>
Print the following error when you give a wrong disk type to xm commands:
# xm create /xen/vm1.conf disk='tap:xxx:/xen/root-vm1.img,hda1,w'
Using config file "/xen/vm1.conf".
Error: tap:xxx not a valid disk type
# xm block-attach vm2 tap:yyy:/xen/second.img hdb1 w
Error: tap:yyy not a valid disk type
Usage: xm block-attach <Domain> <BackDev> <FrontDev> <Mode>
[BackDomain]
DEFINE_XEN_GUEST_HANDLE is evaluated by the pre-processor twice. Do this also for XEN_GUEST_HANDLE.
This fixes a build error for PV guests (OpenBSD, NetBSD) where the use
of XEN_GUEST_HANDLE(uint8_t) leads to a build error because uint8_t is
a #define instead a typedef.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Fix blktap script for versions of readlink command that do not handle
regular files. Signed-off-by: Ben Guthro <bguthro@virtualiron.com> Signed-off-by: Josh Nicholas <jnicholas@virtualiron.com>
Tim Deegan [Fri, 31 Aug 2007 10:06:22 +0000 (11:06 +0100)]
[HVM] Shadow: don't shadow the p2m table.
For HVM vcpus with paging disabled, we used to shadow the p2m table,
and skip the p2m lookup to go from gfn to mfn. Instead, we now
provide a simple pagetable that gives a one-to-one mapping of 4GB, and
shadow that, making the translations from gfn to mfn via the p2m.
This removes the paging-disabled special-case code from the shadow
fault handler, and allows us to expand the p2m interface, since all HVM
translations now go through the same p2m lookups. Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
Support extensions to Intel architecture for TXT/SMX. Signed-off-by: Joseph Cihula <joseph.cihula@intel.com> Signed-off-by: Keir Fraser <keir@xensource.com>
Made the QEMU IDE disk tolerate more power-mgmt commands, specifically:
WIN_SETFEATURE(EN_AAM) - enable automatic acoustic mgmt
WIN_SETFEATURE(DIS_AAM) - disable automatic acoustic mgmt
WIN_SETFEATURE(DIS_APM) - disable automatic power mgmt
WIN_STANDBY
WIN_SETIDLE1
WIN_SLEEPNOW1
WIN_STANDBY2
WIN_SETIDLE2
WIN_SLEEPNOW2
WIN_STANDBYNOW2
These are all essentially no-ops, like existing support for EN_RLA
(enable read lookahead) and WIN_STANDBYNOW1.
This fixes a crash in the SLES9-SP3 64bit kernel when the powersaved
was started (with ACPI or ACM). This guest really only needs EN_AAM,
DIS_APM, and WIN_SETIDLE1 support, but the others seemed sensible to
include.
I've excluded EN_APM since I'm unsure of what that's agreeing to do.
It's probably ok to include.
Signed-off-by: Ben Guthro <bguthro@virtualiron.com> Signed-off-by: David Lively <dlively@virtualiron.com>
Introduce xc_core_arch_gpfn_may_present() hook.
On ia64 trying to map a foreign domain page which isn't allocated
cause annoying warning message. xm dump-core results in too many
warnings. With this hook, ia64 dump-core can suprress warning. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Skipping image name at start of command line is an
architecture-specific action. Definitely not required on IA64, for now
make it just x86 specific. Signed-off-by: Keir Fraser <keir@xensource.com>
hvm: Intercept reads of MSR_IA32_MCG_CAP and return 0.
This indicates no machine check "units", which agrees more closely
with Xen's super-minimal machine check architecture (just enough to
allow Windows to run). This fixes a bug that occurs when migrating a
RHEL4-64bit guest to a host with fewer machine check units than the
original host. These host physical details shouldn't be leaking
through to guests.
Signed-off-by: David Lively <dlively@virtualiron.com>
x86: Remove (most) Centaur CPU support. Only VIA C7 can work, as it
has CMOV support. Leave a small amount of centaur.c around to support
that. MTRR code goes entirely, as 686-class Centaur CPUs have generic
MTRR support.
Don't carry dead code needlessly: this is a family 5 CPU, which Xen
doesn't support. Perhaps, other CPUs' files could use some cleanup in
that respect, too, but there it would increase the delta to the Linux
origin of these files, while here the entire file can go away.
ioemu: Avoid struct members clashing with POSIX apis
The TPM code in tools/ioemu/hw/tpm_tis.c has a struct containing a
number of function pointers with names open, close, read, write which
are the same as various POSIX apis already #included in the
file. POSIX allows these functions to be defined as macros and latest
GCC/glibc does indeed define them as macros depending on compiler
flags. This causes compile errors when deferencing the struct
members. The solution is either to change calls like ctx->open () to
be (* ctx->open) (), or simply to rename the struct members. Since
this struct was only used inside that one file I simply renamed them.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
When I tested xm create command, I saw the following error message.
I expected an error message "Error: (12, 'Cannot allocate memory')"
because I intentionally caused a memory shortage on the test.
But the error message was different from my expectation.
# xm create /xen/HVMdomain.1
Using config file "/xen/HVMdomain.1".
Error: an integer is required
I looked at xend.log to examine the cause why the error message was
shown. (Could you see the attached xend.log?)
xend had the error message "Error: (12, 'Cannot allocate memory')"
first. But xend changed the error message to "Error: an integer is
required" halfway. I'm not sure about the cause why an exception
occurred in logging processing. But when I applied an attached patch,
I confirmed that the error message that I expected was shown. The
patch does not call xc.domain_destroy_hook() if self.domid is None.
ioemu: error checkin when setting up the Cirrus Logic video device.
set_mm_mapping() may fail because of xc_domain_populate_physmap(). In
this case, we should not blindly go on; the xc_map_foreign_batch()
that follows will cause a page fault and, at best, get mapped in a
zeroed page from the dom0 (which is not what we want). While I'm in
here, fix a memory leak on an error path.
Signed-off-by: Chris Lalancette <clalance@redhat.com>
Fix VNC server after HVM save/restore/migrate, when no vncpasswd specified.
The basic problem was that the "image" section of the sxp had a "None"
in it, which means that on the restore (either on the local machine or
remote machine), the vnc server in the qemu device model literally
needed the string "None" to properly connect. This simple patch only
puts a vncpasswd entry in the image if it is *not* None in the python
code, thus avoiding the whole issue.
Signed-off-by: Chris Lalancette <clalance@redhat.com>
[xen, xencomm] xencomm multiple page support
Current implementation doesn't allow struct xencomm_desc::address
array to be more than single page. On IA64 it causes 64GB+ domain
creation failure. This patch generalizes xencomm to allow multipage
[xen, xencomm] fix various xencomm invalid racy access.
- Xencomm should check struct xencomm_desc alignment.
- Xencomm should check whether struct xencomm_desc itself (8 bytes)
doesn't cross page boundary. Otherwise a hostile guest kernel can
pass such a pointer that may across page boundary. Then xencomm
accesses an unrelated page.
- Xencomm shouldn't access struct xencomm_desc::nr_addrs multiple
times. Copy it to local area and use the copy.
Otherwise a hostile guest can modify at the same time.
- Xencomm should check whether struct xencomm_desc::address[] array
crosses page boundary. Otherwise xencomm may access unrelated pages.
- Xencomm should get_page()/put_page() after address conversion from
paddr to maddr because xen supports SMP and balloon driver.
Otherwise another vcpu may free the page at the same time.
Such a domain behaviour doesn't make sense, however nothing prevents
it.
Alex Williamson [Thu, 16 Aug 2007 15:37:54 +0000 (09:37 -0600)]
[IA64] Shrink vtlb size
Instrumenting thash_purge_all() shows a very low usage of vtlb
entries (21 at most).
This patch shrinks the default vtlb size from 512KB to 16KB
to optimize memory. This also speeds up ptc_e emulation.
To improve the hash function, frequency of collision never changed
and there is no performance degradation.
[xen, xencomm] preparetion for xencomm consolidation.
Xen/powerpc runs in real mode so that it uses maddr interchangably
with vaddr. But it isn't the case in xen/ia64. It is necessary to
convert maddr to vaddr to access the page. maddr_to_virt() doesn't
convert on powerpc, so it should work on both archtechture. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
xen: Do not accept DOMID_SELF as input to DOMCTL_getdomaininfo.
This was screwing up callers that loop on getdomaininfo(), if there
was a domain with domid DOMID_FIRST_RESERVED-1 (== DOMID_SELF-1).
They would see DOMID_SELF-1, then look up DOMID_SELF, which has domid
0 of course, and then start their domain-finding loop all over again!
Found by Kouya Shimura <kouya@jp.fujitsu.com>. Thanks! Signed-off-by: Keir Fraser <keir@xensource.com>
This patch adds missing includes that currently work through indirect
inclusions. This cannot be relied on and indeed does break on older
kernels (2.4 for PV-on-HVM).
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
- To remove device info, it waits for the backend path of the device
to be removed.
- It removes device info from domain info.
- It saves domain info to the config.sxp of the managed domain.
- prevent vlans from being relabeled when they are in use by the
current policy
- fix problems when doing an update of the policy and the name of the
policy changes while doing that
- refactor code that has to take into consideration that unlabeled
domains may be defined using the label __UNLABELED__
- make 'xm list --label' show the complete label of a domain
Clean up usage of 'current' in do_iret() hypercall. Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> Signed-off-by: Keir Fraser <keir@xensource.com>
Alex Williamson [Thu, 9 Aug 2007 02:48:11 +0000 (20:48 -0600)]
[IA64] Saner dom0 memory and cpu defaults
Some ia64 xen dom0 tweaks:
* Increase default memory allocation from 512M to 4G
* Increase default vcpu allocation from 1 to 4
* Implement rough calculation of what the maximum memory
that can be safely allocated to dom0 is
* If need be, scale down requested memory allocation to fit
available memory, rather than simply panicking
* If dom0_mem=0 is specified, allocate all available mem
hvm: Handle hw_cr[] array a bit more sanely.
SVM for the most part does not need to use it at all, and this makes
the code clearer. Signed-off-by: Keir Fraser <keir@xensource.com>