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

Re: [PATCH v4 1/7] xen/evtchn: Make sure all buckets below d->valid_evtchns are allocated


  • To: Rahul Singh <rahul.singh@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 6 Sep 2022 15:45:56 +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=GGXccUyWSLHz6EGoEyQUK+LDy6zqf2bKneLndoVOg50=; b=bxxHTDGEDKlR6dZ2rBHc31BL2L8lbwN3b4fpz/JMVrlenIGXcd50umIOL5WoW8Ug1Rpw53aYx4K5Yt5II3Zq4YCNZBkVovgtT9vI/gAOmjHEk7SEZoc1MslhsuZ1SGuPbYBt9zlSJ0lk8zQdFv60jf9kEbMeoWkAzLB2id3NuJyUkrVSG0Z1VeDYhRQyxAIOHTtd3U4huqDEVZZi7rxDRRHm5TzDxlu+P0wZ+AAJYoXXNDK7n+f7SMoYKEpLO8p2esECIn3DQojE0IarogekktbWTPFVQ33Wuoqr2tVp08dY6sd5amztM+lpbRUbsWlEsHOVOStHrd7iSRYAr/Bbjg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jAK2cknF+APzDmk46xbDggNy6ljcyNYps9PQ5OyHUMGZPJrPbGfNgEWgq0H/qHyhm8p5ExMQBZAKQHsCa6knZVxp0NOqBPamhhyzcb+CfcEZFnyfwTqWaywQirKMLIB3436EujGLHVjvHRu+ct0T5CdC9DGjmBJ9EZ3KjjPy2hCH+ATlPyvOVCRPp3l6aCXx2BxP/mRWs4ChINW6swcasblC2XXKwEBUbllBbpgup9mVc1a1YhuEWDub23fcPKIoad6hKYLFISSKxmN5cqo4VgdqMYSTXCOEyRF7pGeKD0IBuhZMI0j5MGKlBwX2rYab5c719EZu+HOj7j+/Sx0YIg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Julien Grall <jgrall@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 06 Sep 2022 13:46:08 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 06.09.2022 15:40, Rahul Singh wrote:
> From: Julien Grall <jgrall@xxxxxxxxxx>
> 
> Since commit 01280dc19cf3 "evtchn: simplify port_is_valid()", the event
> channels code assumes that all the buckets below d->valid_evtchns are
> always allocated.
> 
> This assumption hold in most of the situation because a guest is not
> allowed to chose the port. Instead, it will be the first free from port
> 0.
> 
> When static event channel support will be added for dom0less domains
> user can request to allocate the evtchn port numbers that are scattered
> in nature.
> 
> The existing implementation of evtchn_allocate_port() is not able to
> deal with such situation and will end up to override bucket or/and leave
> some bucket unallocated. The latter will result to a droplet crash if
> the event channel belongs to an unallocated bucket.
> 
> This can be solved by making sure that all the buckets below
> d->valid_evtchns are allocated. There should be no impact for most of
> the situation but LM/LU as only one bucket would be allocated. For
> LM/LU, we may end up to allocate multiple buckets if ports in use are
> sparse.
> 
> A potential alternative is to check that the bucket is valid in
> is_port_valid(). This should still possible to do it without taking
> per-domain lock but will result a couple more of memory access.
> 
> Signed-off-by: Julien Grall <jgrall@xxxxxxxxxx>
> Signed-off-by: Rahul Singh <rahul.singh@xxxxxxx>
> Reviewed-by: Michal Orzel <michal.orzel@xxxxxxx>

Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>





 


Rackspace

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