From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: -EINTR return in domain_relinquish_resources Date: Wed, 21 Jan 2015 16:27:20 -0500 Message-ID: <20150121212720.GA24555@l.oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YE2oA-00085v-DB for xen-devel@lists.xenproject.org; Wed, 21 Jan 2015 21:27:26 +0000 Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t0LLRM4N022414 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 21 Jan 2015 21:27:23 GMT Received: from userz7021.oracle.com (userz7021.oracle.com [156.151.31.85]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id t0LLRLYe016541 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Wed, 21 Jan 2015 21:27:22 GMT Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by userz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id t0LLRLcL016523 for ; Wed, 21 Jan 2015 21:27:21 GMT 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: xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org As I was looking at some of the XSA I realized that the call-chain of: domain_relinquish_resources ->vcpu_destroy_pagetables -> put_page_and_type_preemptible -> __put_page_type returns -EINTR which means we end up at: 618 rc = domain_relinquish_resources(d); 619 if ( rc != 0 ) 620 { 621 if ( rc == -ERESTART ) 622 rc = -EAGAIN; 623 break; <=== with rc=-EINTR 624 } And return -EINTR to user-space - which loop in 'xc_domain_destroy' is only looking for: 112 int xc_domain_destroy(xc_interface *xch, 113 uint32_t domid) 114 { 115 int ret; 116 DECLARE_DOMCTL; 117 domctl.cmd = XEN_DOMCTL_destroydomain; 118 domctl.domain = (domid_t)domid; 119 do { 120 ret = do_domctl(xch, &domctl); 121 } while ( ret && (errno == EAGAIN) ); 122 return ret; 123 } which to my reading looks like we would exit out and leave an DOMDYING_dying domain. Looking at the code it seems possible to continue on if the user does 'xl destroy ' guest again, but I was wondering if: a). Should the toolstack (libxl or libxc) have the code to handle -EINTR? b). Or should the hypervisor convert the -EINTR to -ERESTART (or -EAGAIN) - which most of the code (see users of get_page_type_preemptible) do right now? Thanks!