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

Re: [PATCH v2 3/7] xen/evtchn: restrict the maximum number of evtchn supported for domUs


  • To: Julien Grall <julien@xxxxxxx>, Rahul Singh <rahul.singh@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 23 Aug 2022 10:29:06 +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=fV/AMztGcI3Kt30otJGmkIe11yMCQPqDFKTbdiuNXzg=; b=A9K0dp56tNV8ggLK87UbjeFILZ2wCRb6Pbu94evORyzJxOWNPfmIgH64N4eq4PCTKyxxz4IYbHPM+TeSwrC8gwUleBkF5Lr8gE0CI4fv/mmpJG8sygC5QCdzZPFZNpdH8N1wvNV583eW6E1F8/xI3HDcXGBPE6j6It62Vbqt06ucGHbJ+dy7XDmN92V4s7s0E/lLddjsjY0YPArmvY1+kviYht21dGegYI3kW/YPGTCzEsLqngj9xKOBtBaXAo+2ukizUWxNQ/vZR9v9JhDlWs8iRa4pWiJfrATYPv2+p9mw90cLjFK5MZmzHUGQ0gDs4Qq7x0PHyutzOdBMLGcGsg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dy2Nxrij1qCysWJti5HM3QkciekIh0/obWk2LgfUvwRK+/FEcauEbl3cSYLLfshyiRny98ob6QOFiuOW0/v1YhJS5sTWAPFkT3L0KmHZy7vv5B6VWkJRoetUSqJBAcQbTWgOqaBDX+PB8kKWPbnY/0ZPH5DBi+GWvaAxvbR2hdSbOEycR6meLfUoKvcl9SXhU/pzDggzpdji1nsaeoHu5dKBiAbXVKkZNzlQeWBLGjskKRPzvtRh3amMC5k/PwR+qpOTw1kmVgESi1K9p7bD21XSps9k29e3opsaEEr9TpPZal+63CTHqdFM5pAT9UclOpCDGuMA6y5m3U6o2iQlOw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: bertrand.marquis@xxxxxxx, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 23 Aug 2022 08:29:20 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 23.08.2022 09:56, Julien Grall wrote:
> On 22/08/2022 14:49, Jan Beulich wrote:
>> On 19.08.2022 12:02, Rahul Singh wrote:
>>> --- a/xen/arch/arm/domain_build.c
>>> +++ b/xen/arch/arm/domain_build.c
>>> @@ -3277,7 +3277,7 @@ void __init create_domUs(void)
>>>           struct xen_domctl_createdomain d_cfg = {
>>>               .arch.gic_version = XEN_DOMCTL_CONFIG_GIC_NATIVE,
>>>               .flags = XEN_DOMCTL_CDF_hvm | XEN_DOMCTL_CDF_hap,
>>> -            .max_evtchn_port = -1,
>>> +            .max_evtchn_port = MAX_EVTCHNS_PORT,
>>>               .max_grant_frames = -1,
>>>               .max_maptrack_frames = -1,
>>>               .grant_opts = 
>>> XEN_DOMCTL_GRANT_version(opt_gnttab_max_version),
>>> --- a/xen/include/xen/sched.h
>>> +++ b/xen/include/xen/sched.h
>>> @@ -76,6 +76,9 @@ extern domid_t hardware_domid;
>>>   /* Maximum number of event channels for any ABI. */
>>>   #define MAX_NR_EVTCHNS MAX(EVTCHN_2L_NR_CHANNELS, EVTCHN_FIFO_NR_CHANNELS)
>>>   
>>> +/* Maximum number of event channels supported for domUs. */
>>> +#define MAX_EVTCHNS_PORT 4096
>>
>> I'm afraid the variable name doesn't express its purpose, and the
>> comment also claims wider applicability than is actually the case.
>> It's also not clear whether the constant really needs to live in
>> the already heavily overloaded xen/sched.h.
> 
> IMHO, I think the value would be better hardcoded with an explanation on 
> top how we chose the default value.

Indeed that might be best, at least as long as no 2nd party appears.
What I was actually considering a valid reason for having a constant
in a header was the case of other arches also wanting to support
dom0less, at which point they likely ought to use the same value
without needing to duplicate any commentary or alike.

Jan



 


Rackspace

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