[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC XEN PATCH v4 4/5] domctl: Use gsi to grant/revoke irq permission
- To: "Hildebrand, Stewart" <Stewart.Hildebrand@xxxxxxx>
- From: "Chen, Jiqian" <Jiqian.Chen@xxxxxxx>
- Date: Thu, 11 Jan 2024 02:39:29 +0000
- Accept-language: en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.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=O8H3k6dyh5KZVFqoEmtbTHt4mAO1M8enfs8gISBH+lA=; b=Aik0LWEeKTl0Ur4P7enoamTjuXdhEpfyEL+CnDtanOhTxvqTXH75nsCEeBn+OU/VLyndP48CgmPdpnM8aDIXy6DEDd12CpQa6q7ofkS4WiijZEyTjP+nm3dVcqNMWF7PItU57Wq65Eehe+x1yuLOpk9OICSXuh0ArUT9u2Ch5JeQkmyCSvta3cf4T7HyJo33Pa6v1gBv9W2hkewrnttMFrX+yNoLN7Vr/L9/80UnuwraGzI8VqMga5zrqnxIhg5dY2GzYd+Ovw0CF61kHJiWsQisrbS2ZB0JbILDmXNNyBBj5i6c2m0GkYE1JZ1cljaM/5g4nQhSrsJuzDH5GE/hdw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ntm+qRM3TeL9dWuE+kgYSDSSFLNuOaStvqBqT5OPz3vwj937NTl2n/2n/d80xucgefax4yiOggVoEU5Aub34jgYcHg4TCa7rBLYXndxhalb4Zm1pcmG7g+CeI3zI3RgBOwmBU0EuJvmLOBIWesA/MPRx/4ZjJof/dgtrCIIn98cJxWaKRvnLc7tqAEP8uBZMUYa8xNNCYaFEe3FSxuVJOqfNBpCr+lpnYwJsVRc5jnwYfXBxYOonx8ZWKTYPxuiFPIMbPl/S7S43RphGnAoxKUJ4Bt44FazmF+lFe52/SygTvYGoCrTZNF7R0SDyxuI7EnHBTEHweJ8LUsI9FAs0Sw==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
- Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, "Huang, Ray" <Ray.Huang@xxxxxxx>, "Chen, Jiqian" <Jiqian.Chen@xxxxxxx>
- Delivery-date: Thu, 11 Jan 2024 02:39:38 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHaP6Y1pt0ckfKChE+VsjXCWSj8+LDTgncAgADyZIA=
- Thread-topic: [RFC XEN PATCH v4 4/5] domctl: Use gsi to grant/revoke irq permission
On 2024/1/11 04:09, Stewart Hildebrand wrote:
> On 1/5/24 02:09, Jiqian Chen wrote:
>> diff --git a/xen/common/domctl.c b/xen/common/domctl.c
>> index f5a71ee5f78d..eeb975bd0194 100644
>> --- a/xen/common/domctl.c
>> +++ b/xen/common/domctl.c
>> @@ -653,12 +653,20 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t)
>> u_domctl)
>> unsigned int pirq = op->u.irq_permission.pirq, irq;
>> int allow = op->u.irq_permission.allow_access;
>>
>> - if ( pirq >= current->domain->nr_pirqs )
>> + if ( pirq >= nr_irqs_gsi )
>
> This doesn't build on ARM, as nr_irqs_gsi is x86 only. This is a wild guess:
> we may want keep the existing current->domain->nr_pirqs check, then add the
> new nr_irqs_gsi check wrapped in #ifdef CONFIG_X86.
As I will add a new hypercall in next version, then this change will not exist,
thank you.
>
>> {
>> ret = -EINVAL;
>> break;
>> }
>> - irq = pirq_access_permitted(current->domain, pirq);
>> +
>> + if ( irq_access_permitted(current->domain, pirq) )
>> + irq = pirq;
>> + else
>> + {
>> + ret = -EPERM;
>> + break;
>> + }
>> +
>> if ( !irq || xsm_irq_permission(XSM_HOOK, d, irq, allow) )
>> ret = -EPERM;
>> else if ( allow )
--
Best regards,
Jiqian Chen.
|