aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/xen/tmem_xen.h
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2010-06-21 19:19:25 +0100
committerKeir Fraser <keir.fraser@citrix.com>2010-06-21 19:19:25 +0100
commit5afab625f400e571b78aaf3b7d2f5644c06d07b3 (patch)
tree28deac6896ee1fcad69373b3fa92ec345c618e67 /xen/include/xen/tmem_xen.h
parent3d5e6a3ff38302913fff925660e947b0256166f7 (diff)
downloadxen-5afab625f400e571b78aaf3b7d2f5644c06d07b3.tar.gz
xen-5afab625f400e571b78aaf3b7d2f5644c06d07b3.tar.bz2
xen-5afab625f400e571b78aaf3b7d2f5644c06d07b3.zip
Enable tmem functionality for PV on HVM guests. Guest kernel
must still be tmem-enabled to use this functionality (e.g. won't work for Windows), but upstream Linux tmem (aka cleancache and frontswap) patches apply cleanly on top of PV on HVM patches. Also, fix up some ASSERTS and code used only when bad guest mfns are passed to tmem. Previous code could crash Xen if a buggy/malicious guest passes bad gmfns. Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Diffstat (limited to 'xen/include/xen/tmem_xen.h')
-rw-r--r--xen/include/xen/tmem_xen.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/xen/include/xen/tmem_xen.h b/xen/include/xen/tmem_xen.h
index 84bb6dd238..f409cbf1a9 100644
--- a/xen/include/xen/tmem_xen.h
+++ b/xen/include/xen/tmem_xen.h
@@ -456,7 +456,9 @@ typedef XEN_GUEST_HANDLE(tmem_op_t) tmem_cli_op_t;
static inline int tmh_get_tmemop_from_client(tmem_op_t *op, tmem_cli_op_t uops)
{
#ifdef CONFIG_COMPAT
- if ( is_pv_32on64_vcpu(current) )
+ if ( is_hvm_vcpu(current) ?
+ hvm_guest_x86_mode(current) != 8 :
+ is_pv_32on64_vcpu(current) )
{
int rc;
enum XLAT_tmem_op_u u;