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

Re: [RFC PATCH v5 06/10] xen/domctl: extend XEN_DOMCTL_assign_device to handle not only iommu


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Oleksii Moisieiev <Oleksii_Moisieiev@xxxxxxxx>
  • Date: Thu, 28 Aug 2025 05:48:45 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.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=XqC3N9DMASgfPW6lFP2YNm96SmEdAhjb7HDeJKcvCas=; b=O8eqFxFm39g6YmKrU5A5BKppqoIVs6TknqMZKIG4B1E1eaLHuJUUauWVgpCA/nIclbxwH7UjNE0u9ZgfnGMNtEqJmxXuyqAd51FnvqwWUfIwvXRYIKnRcMYB+koOdrwq+Yx//9tOmrNxLWhxR+rx9kil3pwWaVAlkQyw1m2eWhTI2gR8y7ki6rGWh49Cl6b6fMYL4daAFnnyzTJzqPUAu1YNHwyJkxm3ZRkndyh4qQ/F1U5zibiECER6HDwmz8iWLImlcPSwUgDJbAKwDEKP/vrHXT7FgaL8vp8Rcw4LRV78kqQI1VmN5v/wRbXdr6lz94cnX3SbTq9dPHRfnsJ9HQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=S/jUUnveh+obbIuNjgNb2basutzAoQjYkw7J5/tpn85dDkdx19qoZyCmkLNCSkeb5R7Eu9rwufiYHMJnFknsWnrvyx3PJ6UejDqz8WkClfX7yxmfqhNqx0W8orbcH3eLeRb8b+DebPZmGShwP7jqxhiRGrQyEo4rSKUfkcB/jMyJjioV1+hRoLKm3hTZAkf4Tl5UgGvYcckPBYTkSLeD1JEHJVGFa2ThNNcf2+CDguDsIwgRuvm+GniThpvNWtc97rWSjKMEDoGg1r5wnOtdeap8misvTRkQBBHVSQZ3ybEE0KSjjxSx6c4EVEajLciqj04e38aOG+HEAWVctIDr6Q==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Grygorii Strashko <grygorii_strashko@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 28 Aug 2025 05:49:03 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHb+v2XIf5rVjN6B0ydmKskjXCNlrQ+E9WAgDm1BAA=
  • Thread-topic: [RFC PATCH v5 06/10] xen/domctl: extend XEN_DOMCTL_assign_device to handle not only iommu


On 22/07/2025 15:34, Jan Beulich wrote:
> On 22.07.2025 13:41, Oleksii Moisieiev wrote:
>> @@ -859,7 +860,25 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) 
>> u_domctl)
>>       case XEN_DOMCTL_test_assign_device:
>>       case XEN_DOMCTL_deassign_device:
>>       case XEN_DOMCTL_get_device_group:
>> +        int ret1;
>> +
>>           ret = iommu_do_domctl(op, d, u_domctl);
>> +        if ( ret < 0 && ret != -ENXIO )
>> +            return ret;
> If this is where you want the ENXIO for that the previous patch switched to,
> then I see no reason for that earlier change at all. Inside the hypervisor
> you can simply figure out what the right thing to do is; you could avoid
> calling iommu_do_domctl() altogether and call ...

My point was to leave the decision making to the calls themselves.
So iommu_do_domctl will make a decision whether to process the node or 
not, same for the scmi call.
I can figure out if there is a need to call iommu_do_domctl or 
sci_do_domctl here but this means moving
part of the logic from specific calls to the common code.
>> +        /*
>> +         * Add chained handling of assigned DT devices to support
>> +         * access-controller functionality through SCI framework, so
>> +         * DT device assign request can be passed to FW for processing and
>> +         * enabling VM access to requested device.
>> +         * The access-controller DT device processing is chained after IOMMU
>> +         * processing and expected to be executed for any DT device
>> +         * regardless if DT device is protected by IOMMU or not (or IOMMU
>> +         * is disabled).
>> +         */
>> +        ret1 = sci_do_domctl(op, d, u_domctl);
> ... this one right away, for example. (Which of course doesn't eliminate the
> question towards the overloading done here, which iirc was raised before.)
>
> Jan

 


Rackspace

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