All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH for-4.17?] x86/paging: return -EINVAL for paging domctls for dying domains
@ 2022-11-08 11:38 Roger Pau Monne
  2022-11-08 16:14 ` Jan Beulich
  2022-11-09 16:11 ` Andrew Cooper
  0 siblings, 2 replies; 17+ messages in thread
From: Roger Pau Monne @ 2022-11-08 11:38 UTC (permalink / raw)
  To: xen-devel
  Cc: Henry.Wang, Roger Pau Monne, Jan Beulich, Andrew Cooper,
	George Dunlap, Wei Liu, Edwin Török

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@citrix.com>
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
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



^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2022-11-10  9:04 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-08 11:38 [PATCH for-4.17?] x86/paging: return -EINVAL for paging domctls for dying domains Roger Pau Monne
2022-11-08 16:14 ` Jan Beulich
2022-11-08 16:43   ` Roger Pau Monné
2022-11-08 17:03     ` Jan Beulich
2022-11-08 17:15       ` Roger Pau Monné
2022-11-09  7:48         ` Jan Beulich
2022-11-09  9:45           ` Edwin Torok
2022-11-09  9:58             ` Jan Beulich
2022-11-09 10:11           ` Roger Pau Monné
2022-11-09 10:23             ` Jan Beulich
2022-11-09 11:36               ` Roger Pau Monné
2022-11-09 12:02                 ` Jan Beulich
2022-11-09 13:22                   ` Roger Pau Monné
2022-11-10  9:03                     ` Jan Beulich
2022-11-08 17:30     ` Edwin Torok
2022-11-09 16:11 ` Andrew Cooper
2022-11-10  9:02   ` Jan Beulich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.