From: "Jan Beulich" Subject: Re: [PATCH v3] xen: fix reboot/shutdown with running HVM guests Date: Thu, 05 Jun 2014 17:02:14 +0100 Message-ID: <5390B0A6020000780001861F@mail.emea.novell.com> References: <1401980484-47815-1-git-send-email-roger.pau@citrix.com> <539090DD.2040700@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Wsa7N-0006tm-Ti for xen-devel@lists.xenproject.org; Thu, 05 Jun 2014 16:02:18 +0000 In-Reply-To: <539090DD.2040700@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper Cc: Kevin Tian , KeirFraser , Suravee Suthikulpanit , Eddie Dong , Aravind Gopalakrishnan , Jun Nakajima , xen-devel@lists.xenproject.org, Boris Ostrovsky , Roger Pau Monne List-Id: xen-devel@lists.xenproject.org >>> On 05.06.14 at 17:46, wrote: > On 05/06/14 16:01, Roger Pau Monne wrote: >> If there's a guest using VMX/SVM when the hypervisor shuts down, it >> can lead to the following crash due to VMX/SVM functions being called >> after hvm_cpu_down has been called. In order to prevent that, check in >> {svm/vmx}_ctxt_switch_from that the cpu virtualization extensions are >> still enabled. > > I feel that this is still trying to fix the problem from the wrong end. > It is incorrect to be in a context switch at the point identified in the > stack trace. > > How about having the hvm_cpu_down functions look at current, and > optionally run sync_exec_state() ? I considered this too before suggesting the other alternative, but why would getting into the context switch path this way be any better than through map_domain_page()? Jan