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

Re: [PATCH for-4.15 2/2] libs/foreignmem: Fix/simplify errno handling for map_resource


  • To: Ian Jackson <iwj@xxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Wed, 3 Feb 2021 17:27:01 +0000
  • 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-SenderADCheck; bh=4EkyiE2hrhjR80MlJZncWxzBHVWtp46zqd3s+A0L+Y0=; b=NNiLHwqGjEZ4RWcy0hOvwFKGnwWJ4aysePF/hwTXJe+61m3rYJvjwPtt509zkT/bGD+S10SJCOm0PU/3P0lT/F+rjCvSni2PSFcObAG8RtKEzZq9p65p4dgHYjzVeL+fndUQi2S6sta5VXw11mmnvEgKoY38aCiORWrdPMI4Ge7MvXGee3X97QwL3s87z/K5dx2dKUV6NnyGcps3JqZksk+lTENBJ07mFqWv5Ffd97FzPc1DNPlf+o8ZIj8kQs+NupxX8hd94KBqZ9k3s40CbOzDe+1CYpDOEFYh4njoJtdrHXQAg144xnuQdvaOPH+iH53me3naGy42BJSBtO1Qzg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SEDqIKplDlH+FvFgVMaU5pVF/Yb4uVIUjwX5+zBuIvvtN3m42xCrT1BN5Ws4JTR0KWfKUDhZ7UrRw3+jir8y+3WoF1u9TVgZPoz5KvXG3FM6fw5lYzcWcFtICRg562cAaIOTk+Nv8qtPuhVMEZXY8Vj2t4y+YOYy/71j+iz/RwJDLEWoVYk4jqfcPOxgag4lYV4eXQTVSTbsdjsxGcHteP6Q6Bfl0zEbR3Rk+Y6twby2ZgXOqCthQu3aPdX9s1qTklreyvPJnOxqWBd5ob3TkIcdB8LV12b4AfHyxvx65n7nxLiK+ceVX50CcbxoFIRlEuORccBumO7ZSj3kfs4XqA==
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Manuel Bouyer <bouyer@xxxxxxxxxx>
  • Delivery-date: Wed, 03 Feb 2021 17:27:44 +0000
  • Ironport-sdr: uQqKJc+TQayzNJHo8/PCrIwLEsdjrYb/PfC6PZA9BUNiw1x5/GCiSlo7KmvQNaFKMNuRboZwvS mfGpl5KkMyjCHJoVIlrtE0QIJG9eFa50i1CXrXf71zfedKBAbkUe3FtVG5wESUzKMQUTnZqKJI uufGXDVBJGvLyD4TG2Wvo9y1m2CTXc9OBWAdvBnzph37m1rA5n522JUBrnPHqATFTQ7ODiQJ/E xTj5zL7RFuUnTMYXnTFWk6kw20S3bCZ9NIt6CBEP6SiWbbOC2ABTJ5Ysjk29iiEdvhh2ywUwpy Ajg=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 03/02/2021 17:18, Ian Jackson wrote:
> Andrew Cooper writes ("[PATCH for-4.15 2/2] libs/foreignmem: Fix/simplify 
> errno handling for map_resource"):
>> Simplify the FreeBSD logic, and duplicate it for NetBSD as the userpace ABI
>> appears to be to consistently provide EOPNOTSUPP for missing Xen/Kernel
>> support.
>>
>> The Linux logic was contorted in what appears to be a deliberate attempt to
>> skip the now-deleted logic for the EOPNOTSUPP case.  Simplify it.
> AFAICT this is a mixture of cleanup/refactoring, and bugfix.  Is that
> correct ?
>
>> diff --git a/tools/libs/foreignmemory/netbsd.c 
>> b/tools/libs/foreignmemory/netbsd.c
>> index 565682e064..c0b1b8f79d 100644
>> --- a/tools/libs/foreignmemory/netbsd.c
>> +++ b/tools/libs/foreignmemory/netbsd.c
>> @@ -147,6 +147,9 @@ int osdep_xenforeignmemory_map_resource(
>>      rc = ioctl(fmem->fd, IOCTL_PRIVCMD_MMAP_RESOURCE, &mr);
>>      if ( rc )
>>      {
>> +        if ( errno == ENOSYS )
>> +            errno = EOPNOTSUPP;
>> +
>>          if ( fres->addr )
>>          {
>>              int saved_errno = errno;
> Specifically, I guess this is the bugfix ?

It is a bugfix on NetBSD (for brand new functionality), and cleanup on
FreeBSD/Linux specifically split out of the previous patch.

~Andrew



 


Rackspace

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