From 19014daf9fbd8e9bb3c26cb0fdbb993f82471d5a Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Tue, 5 Feb 2013 09:16:07 +0100 Subject: [PATCH] Revert 26503:69398345c10e This conflicts with changes done in 26486:7648ef657fe7 and 26489:83a3fa9c8434 (i.e. the code added by them needs adjustment in order for the change here to be correct). --- xen/arch/x86/hvm/hvm.c | 11 +++-------- xen/arch/x86/hvm/nestedhvm.c | 2 +- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index 9a2d49e1af..34b86f4f39 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -3900,25 +3900,20 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg) rc = -EPERM; break; } - if ( !a.value ) - break; if ( a.value > 1 ) rc = -EINVAL; + if ( !is_hvm_domain(d) ) + rc = -EINVAL; /* Remove the check below once we have * shadow-on-shadow. */ - if ( cpu_has_svm && !paging_mode_hap(d) ) + if ( cpu_has_svm && !paging_mode_hap(d) && a.value ) rc = -EINVAL; /* Set up NHVM state for any vcpus that are already up */ if ( !d->arch.hvm_domain.params[HVM_PARAM_NESTEDHVM] ) - { for_each_vcpu(d, v) if ( rc == 0 ) rc = nestedhvm_vcpu_initialise(v); - if ( rc ) - for_each_vcpu(d, v) - nestedhvm_vcpu_destroy(v); - } break; case HVM_PARAM_BUFIOREQ_EVTCHN: rc = -EINVAL; diff --git a/xen/arch/x86/hvm/nestedhvm.c b/xen/arch/x86/hvm/nestedhvm.c index 964f58f1a5..b3cf07dda3 100644 --- a/xen/arch/x86/hvm/nestedhvm.c +++ b/xen/arch/x86/hvm/nestedhvm.c @@ -87,7 +87,7 @@ nestedhvm_vcpu_initialise(struct vcpu *v) void nestedhvm_vcpu_destroy(struct vcpu *v) { - if ( hvm_funcs.nhvm_vcpu_destroy ) + if ( nestedhvm_enabled(v->domain) && hvm_funcs.nhvm_vcpu_destroy ) hvm_funcs.nhvm_vcpu_destroy(v); } -- 2.30.2