[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH for-4.17?] x86/paging: return -EINVAL for paging domctls for dying domains


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • Date: Tue, 8 Nov 2022 12:38:50 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=PuHguRhkn384S2div7GHC9RgTOUnCSdIgdLDcC0eJSc=; b=bsEVIgIY1KrWz4haKP2DON1DNQsjCgV4lT/zEpO30UD3Vxd61OfBMojtrSsOANxHuMblvSVNbx8xSpwNZzZD++zVME6ysOSWakjQVUuqNTNy9YGdpZ464oQ+qS3qC3E96KzhDnstzLFbJJ8Mqwfux56JWq2igcpmHD286Re9ekbCwnY7LivSVkPdGTp3u4UrJOAJk+TqaRCUJ+0eDQ6eQ44bc2brZ2afZZgGZtAgrDLRKM+GFZeLENplVuncauLeGkVEXfcYfKHz4dpm8Yl0y2pUOXaEVTeIqhM6rM6fzlwPYCBicpFuAwZIqQPl43bDEuc61/2Y2m7GDf2B7z5kqA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EitHfZOpkcPa7bzv7OKL5Z22f2SIJo/mMQxnNi9FD4SJhCkAhf7Mkq7DxPijq02lNXR9teqc9MfPRSuWnxYKk7lenxsRALnRNWMGaWxtu29wKjF69py3E1axzOZtioEaiNpCRB+Od61JHSp+Ax0jFfz8Wxv2p76vAo8bacP/waONrl2Uab6LWTDjj/wVgTr+hsKIZoG7kLA0ABwnVE5Dx1iq47ZA4Nu+ceW+9AyDDcD2OZAakpCh6xe+13cvxXO9ut6i0fklC8L9X/4/y08rzejojResVIgakz0DKQwEpe+EgML+eEJOnadRpnm+PlNEQE7EGr1IzuQw7TCEzQk2gg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Henry.Wang@xxxxxxx, Roger Pau Monne <roger.pau@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Edwin Török <edvin.torok@xxxxxxxxxx>
  • Delivery-date: Tue, 08 Nov 2022 11:39:29 +0000
  • Ironport-data: A9a23:mYwPoK0+aKOdj4g5sPbD5eBwkn2cJEfYwER7XKvMYLTBsI5bpzRVz jcaUDiOPPaJZDanfdogPYm1/UMAvJ7RnIRiGgM/pC1hF35El5HIVI+TRqvS04F+DeWYFR46s J9OAjXkBJppJpMJjk71atANlVEliefTAOK5ULSfUsxIbVcMYD87jh5+kPIOjIdtgNyoayuAo tq3qMDEULOf82cc3lk8tuTS9nuDgNyo4GlC5wVmNagS1LPjvyJ94Kw3dPnZw0TQGuG4LsbiL 87fwbew+H/u/htFIrtJRZ6iLyXm6paLVeS/oiI+t5qK23CulQRrukoPD9IOaF8/ttm8t4sZJ OOhF3CHYVxB0qXkwIzxWvTDes10FfUuFLTveRBTvSEPpqFvnrSFL/hGVSkL0YMkFulfLkQex f8kGjw2bxmu1rO3yuuRWPtIr5F2RCXrFNt3VnBI6xj8VK5ja7acBqLA6JlfwSs6gd1IEbDGf c0FZDFzbRPGJRpSJlMQD5F4l+Ct7pX9W2QA9BTJ+uxouy6KlFMZPLvFabI5fvSQQspYhACAr 3/u9GXlGBAKcteYzFJp91r82L6WwH2nBOr+EpWF8PIx0GysyFBPSzMIcAOKi+jmjRWXDoc3x 0s8v3BGQbIJ3FymSJzxUgO1pFaAvwUAQJxAHusi8gaPx6HIpQGDCQAsbjNHcs1gi8YwShQjz FrPlNTsbRRturCITXOW9p+PsCi/fyMSKAcqeissXQYDpd75r+kOYgnnS99iFOu/iILzEDSpm zSS9nFm2PMUkNIB0Li98RbfmTWwq5PVTwkzoALKQmai6QA/b4mgD2C11WXmAT97BN7xZjG8U LIswqByMMhm4UmxqRGw
  • Ironport-hdrordr: A9a23:GfCMoKqoMXsWprTyOh/QBJMaV5vEL9V00zEX/kB9WHVpm5Oj+v xGzc5w6farsl0ssREb9uxo9pPwI080kqQFmbX5XI3SJTUO3VHFEGgM1/qH/9SNIU3DH41mpN pdmtZFebrN5DFB5K6VgTVQe+xQuuVvm5rY4Ns2oU0dLj2DPMpbnnxE40ugYzlLbTgDIaB8OI uX58JBqTblUXMLbv6jDn1Ae+TYvdXEmL/vfBZDXnccmX+zpALtzIS/PwmT3x8YXT8K6bA+8V Ldmwi8wqm4qfm0xjLVymeWxZVLn9nKzMdFGaW3+78oAwSprjztSJVqWrWEsjxwiOaz6GwymN 2JmBskN9Qb0QKjQkiF5T/WnyXw2jcn7HHvjXWCh2H4nMD/TDUmT+JcmINwaHLimgAdleA59J gO83OStpJRAx+Ftj/6/cL0WxZjkVfxiWY+kNQUk2dUXeIlGfRsRLQkjQ9o+ao7bW3HANhNKp ghMCic3ocfTbqiVQGVgoE1q+bcH0jaHX+9Mzg/U4KuonhrdUtCvjUlLfwk7ws9Ha0GOuZ5Dp z/Q8JVfZF1P70rhPFGdZI8aPryLFDxajTxF0/XCWjbNcg8SgPwQtjMkfwI2N0=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Like on the Arm side, return -EINVAL when attempting to do a p2m
operation on dying domains.

The current logic returns 0 and leaves the domctl parameter
uninitialized for any parameter fetching operations (like the
GET_ALLOCATION operation), which is not helpful from a toolstack point
of view, because there's no indication that the data hasn't been
fetched.

Reported-by: Edwin Török <edvin.torok@xxxxxxxxxx>
Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
I'm adding the for-4.17 tag because I think this is a backport
candidate to older Xen versions also.
---
 xen/arch/x86/mm/paging.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c
index 3a355eee9c..3e7be07e86 100644
--- a/xen/arch/x86/mm/paging.c
+++ b/xen/arch/x86/mm/paging.c
@@ -694,9 +694,10 @@ int paging_domctl(struct domain *d, struct 
xen_domctl_shadow_op *sc,
 
     if ( unlikely(d->is_dying) )
     {
-        gdprintk(XENLOG_INFO, "Ignoring paging op on dying domain %u\n",
+        gdprintk(XENLOG_INFO,
+                 "Tried to do a paging domctl op on dying domain %u\n",
                  d->domain_id);
-        return 0;
+        return -EINVAL;
     }
 
     if ( unlikely(d->vcpu == NULL) || unlikely(d->vcpu[0] == NULL) )
-- 
2.37.3




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.