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

Re: [PATCH v2 2/2] domain: expose newly introduced hypercalls as XENFEAT


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 16 Oct 2023 16:04:34 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=896e5e+8rUBXODkOEmQWwo6Ms7TNzLX0CaqBiFR7UTw=; b=QRWZqYbeBbslT124q3WiLLhLcnP5c+krfC4rCi3WNfG9MR5Ieh0xcBqXLdSj05YpwsqSTvFPUITYpY5NUjCzhlKDGZTloM0Lk842zQCKi7ESK+pYCn6T3/75uOO0kTsiobECzHfp/+nvKsdyQjEIGnApo+IY7WlOs7SlaUfmkIhkBnlSMtKf1O5TDvROofszgzpDlpOMScKpyFSEYqWclSh20mVor+rFI/UvGUGPLTujT7YzLRAlnbXysNl6KK4wwToL1xi6kAbFHXqUzWcKg/pyjgF7CYW/JXRtPUpSD4NMQ2cdckqDVMqdqXfDpAXIAhy91EqdkZCbkuVdwbVG0A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OI1bBuy17/7EwTuW2XXlIY3z+WW1g5bDAW4KFgXoumHmwbLuqt0SGvppnEIAsgk5jgai2QdLWzgJerQdCu4jM4lDpa7uaAi1xabD2Dk3IvmKkEu/kFyFU3jcJTQY4z6xDZ5V9oDDCZioRzyAA5oW1q1KYRzdab9BEW8+lRXYQSOYUnZCfA5/0vwVqEGKGHXyiTSI1A7N7lhMGumrPgsipOX5hh6SLgoYPVNncs622riCEPw9YvJnFhhG41GJXWChFPsbymCZoOssKG5+Fi51WZ1sfhjr4jTG7vAm1zLztvw5+1+NK8ZbAgogHUlmNVSWAU/kMIyx2C1iR2oE5WiI0A==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Henry Wang <Henry.Wang@xxxxxxx>, Community Manager <community.manager@xxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 16 Oct 2023 14:04:45 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 16.10.2023 16:01, Roger Pau Monné wrote:
> On Mon, Oct 16, 2023 at 03:58:22PM +0200, Jan Beulich wrote:
>> On 16.10.2023 15:00, Roger Pau Monné wrote:
>>> On Mon, Oct 16, 2023 at 02:35:44PM +0200, Jan Beulich wrote:
>>>> On 06.10.2023 15:00, Roger Pau Monne wrote:
>>>>> --- a/xen/common/domain.c
>>>>> +++ b/xen/common/domain.c
>>>>> @@ -1998,6 +1998,10 @@ long common_vcpu_op(int cmd, struct vcpu *v, 
>>>>> XEN_GUEST_HANDLE_PARAM(void) arg)
>>>>>      {
>>>>>          struct vcpu_register_runstate_memory_area area;
>>>>>  
>>>>> +        rc = -ENOSYS;
>>>>> +        if ( 0 /* TODO: Dom's XENFEAT_runstate_phys_area setting */ )
>>>>> +            break;
>>>>> +
>>>>>          rc = -EFAULT;
>>>>>          if ( copy_from_guest(&area.addr.p, arg, 1) )
>>>>>              break;
>>>>
>>>> ENOSYS is not correct here. EPERM, EACCES, or EOPNOTSUPP would all be more
>>>> correct.
>>>
>>> I don't think so, common_vcpu_op() default case does return -ENOSYS,
>>> and the point of this path is to mimic the behavior of an hypervisor
>>> that doesn't have the hypercalls implemented, hence -ENOSYS is the
>>> correct behavior.
>>
>> Besides that other ENOSYS being wrong too, I question such "mimic-ing".
>> Imo error codes should be the best representation of the real reason,
>> not be arbitrarily "made up".
> 
> The point is for the guest to not take any action that it won't take
> on an hypervisor that doesn't have the hypercalls implemented, and the
> only way to be sure about that is to return the same exact error code.

I don't follow this kind of reasoning. Why would a guest, whose code to
use the new sub-functions has to be newly written, key its decision to
the specific error code it gets, when at the same time you expose
feature bits that it can use to decide whether to invoke the hypercall
in the first place.

Jan



 


Rackspace

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