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

Re: [PATCH] x86/shim: Report -ENOSYS instead of -EOPNOTSUPP


  • To: Jan Beulich <jbeulich@xxxxxxxx>, Teddy Astie <teddy.astie@xxxxxxxxxx>
  • From: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>
  • Date: Tue, 6 Oct 2026 10:53:08 +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=arcselector10001; 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=FBKbnSwT38Ox90wLcSxenGv+kipT2bjKYVcjPp2CxFQ=; b=dCq4+2W1mWOloVJkeTjCnCieQggrODgdV11odAqK3xXnB/shA01JAp+oY1Z0xIwHAulUciz6k84hqpmf7MkjgfX7d2EvYIuX/X60bO6LQa0F9vvCb7RlDBkdxP8B8/A3rEcQI7yP35mT3S4Uh/2hSKJOTWdudGYcrxhP4E/gwzKI1pLEghyIAwDVrLJnnXNUBObHy/fiJ1yEl+zm/MBPle/l5us193Ik+SAjRfYE7ITXr+DzJ3dzTnGFJQMbEyOr2ccY4HmoTVdyUJh7deV+Lu1PdSGu3nMoZcvSZe46d4HyNGfmK3O/+5l1SR0rNHxWQCX3GZyrjwRwLHlfe7EDEA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=s43iHrtebMfPHlmmIRmahRL0rhVA4J+3SE1zDCz4WdVi5CHsuoWlZ9rxL/eeV4zpwheo3wUWvokJSr9HmtzqzPmuipaJe96DCoeNZLggFarWSBdKVjUbvtK4VY9tqlT3kYhQACGlZWCd/UL1gn1rXGfoQRKev8QzuxaPThwHlHh4LoDijnF9MR2rBKmqwsByb9hg5FWICxteqphIGVtYXpkQobYOeht5T5UV8ppzqdArRLXXLkHB+0HrBs6slXvz6AUEeseKmgCaKk3/Rbx7/NKX5+sFF6/Cxu38rRQfx7XvpGCtY2Gxat8Grspu8ahACbyXJin92jShsnLnIAfNAA==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Authentication-results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger@xxxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 06 Oct 2026 09:53:40 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 10/5/26 4:11 PM, Jan Beulich wrote:
On 05.10.2026 16:41, Teddy Astie wrote:
Main Xen reported -ENOSYS if the operation is not implemented, however,
shim errorneously reported it as -EOPNOTSUPP, potentially confusing the
guest.

I question "erroneously". -ENOSYS has, according to my understanding, exactly
one valid use case: A top-level hypercall (normally: syscall) function which
is not implemented. Unknown sub-ops etc shouldn't be using that error
indicator, or else callers can't tell one from the other.

Maybe they shouldn't be using -ENOSYS but AFAICT the majority of hypercalls with
subops do return -ENOSYS for unknown subops (with the exception of kexec_op).
This is something we tripped over when implementing the hypercall filter for
XenServer's Secure Boot.

Ross


That said, it may still be legitimate to make the change here, as making the
change in do_grant_table_op() and do_event_channel_op() can be viewed as an
ABI change, which then we cannot easily do.

Make shim more consistent with Xen by reporting -ENOSYS instead.

Fixes: 49f79fe03dfe ("xen/pvshim: add grant table operations")
Fixes: 368ae9a05fee ("xen/pvshim: forward evtchn ops between L0 Xen and L2 
DomU")
Reported-by: Teddy Astie <teddy.astie@xxxxxxxxxx>
Suggested-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Signed-off-by: Teddy Astie <teddy.astie@xxxxxxxxxx>

Reported-by for yourself is pretty unusual, btw.

Jan




 


Rackspace

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