Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp8903462rwp; Wed, 19 Jul 2023 18:01:29 -0700 (PDT) X-Google-Smtp-Source: APBJJlFjPc9MTyV8b4XvzAid1UCDbu7xsJiC2Vegr3k9ThMQuNyOb7r3BnijSvdvjfuWUKeLhwms X-Received: by 2002:a2e:9ccb:0:b0:2b6:c2e4:a57a with SMTP id g11-20020a2e9ccb000000b002b6c2e4a57amr1012697ljj.38.1689814889386; Wed, 19 Jul 2023 18:01:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689814889; cv=none; d=google.com; s=arc-20160816; b=Xh9KftvRgnqOZw9VY9uYaNXhglTMFBqrN0k7VwY8AYOM9S6cyd62fklWdO86f42BEO KR3OppxAIXpHsskOxD9zJufv5AevQaSNsv53mXSrJR3UEM1vWj+RIBfbDZvJQH/kKQHk D2IwmaCm61W7US5zojTbSkvd3mqhnqUz+8pJfakx2TTv57TK2Z1ap9aVAbFWHM6rzahF tTvGfCuMjArYhkME1xrTmZT0AAXMs9jwpN/AElOAKoEObN+WDpOq6U6jldhoDbiz/UIl BdjyO1vjvTQNsP44cv5w0FDUwO4xBgsdaVHxCRmlLrn88xkz2SrO76Y49FxK/p0K2FXB GMWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date:dkim-signature; bh=KPnHMIOtF/95d8J4L4eGde/SbgCJEa6iueJ2041YPB0=; fh=rGoRT1R6umegMUJ2gE7qdyVJ58vzOkJvSylORxiT6qc=; b=0Mc5XbYhLWk7bRTloizni6x0SdzUL/lkzPVBlE8mpd0QPT170k+woqqSnYAX+81ds6 +nEza/zxrgy30qZ4VDGy9eDMOjdt1M6RfNT9DYCYfOOEHx1WGlqhejT+Waxhs8MlZ8sh ZXk9vVe8qyqouL7HPV6COg6xCVQ+7cQS2S7pUAXK0UGKupRMvMBZ500YpdPSs6lVHbGC AajLXXmKsRrHjtJRGJuSxZND+K+6+3nRtyFwY7JPd/xNdUCHe28TB9Z+nDcCteYTYmr4 yJrdOxr/QUqcPwXcZ1oiE0nsnNcldVP62L5A54IlqcRgqU4ve4gKr2J4k56aEY+n1eZf wnVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="lDAkS2y/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m14-20020a1709060d8e00b009787b15aa51si3506342eji.713.2023.07.19.18.00.55; Wed, 19 Jul 2023 18:01:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="lDAkS2y/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229694AbjGTAWu (ORCPT + 99 others); Wed, 19 Jul 2023 20:22:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229569AbjGTAWt (ORCPT ); Wed, 19 Jul 2023 20:22:49 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E24526B2 for ; Wed, 19 Jul 2023 17:22:17 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 22C276133D for ; Thu, 20 Jul 2023 00:22:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5B817C433C7; Thu, 20 Jul 2023 00:22:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689812532; bh=iOhtG18Xjx35RfOoBf0pJWVGi8TqQirc725rJUlwmzk=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=lDAkS2y/rn4oqw1FHxQLNGIklfDbgrJoCMbXTU7b//CGZq15PX6F/Y6htgT7/H+0B 4gM9BVSeU4xNQ3Knbc52XgNboDZKrKSKIPZY+p+WRmBK2izjDflj4Yu6dwmRITciQ6 03Fb4GjlVMplSqJJpeXni/KCvfD1WRWFe4owrQuSnS7efq/xgUGniAgAX5adsRMYWG LY+4V1vgN4kd6imrz9r20g5h78H+dIf04xQaG+898vINATyKh18QK3rSizEEtR5N8X OwPURvG25OOCPlt6AfYt7kOieFSkynrOlWygY5ESJl3ZD66LF4l59TXtL7UvMC6Av8 nlVq06NNKB5OA== Date: Wed, 19 Jul 2023 17:22:09 -0700 (PDT) From: Stefano Stabellini X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop To: Oleksandr Tyshchenko cc: Rahul Singh , "xen-devel@lists.xenproject.org" , "linux-kernel@vger.kernel.org" , Juergen Gross , Stefano Stabellini , Boris Ostrovsky , David Woodhouse , Jane Malalane Subject: Re: [PATCH v3] xen/evtchn: Introduce new IOCTL to bind static evtchn In-Reply-To: <9a917f42-1a22-0c75-459e-db30c17dbe78@epam.com> Message-ID: References: <9a917f42-1a22-0c75-459e-db30c17dbe78@epam.com> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-27211591-1689812531=:3118466" X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-27211591-1689812531=:3118466 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT On Tue, 18 Jul 2023, Oleksandr Tyshchenko wrote: > On 18.07.23 14:31, Rahul Singh wrote: > > > Hello Rahul > > > > Xen 4.17 supports the creation of static evtchns. To allow user space > > application to bind static evtchns introduce new ioctl > > "IOCTL_EVTCHN_BIND_STATIC". Existing IOCTL doing more than binding > > that’s why we need to introduce the new IOCTL to only bind the static > > event channels. > > > > Static evtchns to be available for use during the lifetime of the > > guest. When the application exits, __unbind_from_irq() ends up being > > called from release() file operations because of that static evtchns > > are getting closed. To avoid closing the static event channel, add the > > new bool variable "is_static" in "struct irq_info" to mark the event > > channel static when creating the event channel to avoid closing the > > static evtchn. > > > > Also, take this opportunity to remove the open-coded version of the > > evtchn close in drivers/xen/evtchn.c file and use xen_evtchn_close(). > > > > Signed-off-by: Rahul Singh > > --- > > v3: > > * Remove the open-coded version of the evtchn close in drivers/xen/evtchn.c > > Thanks! > > Looks like there is one unmentioned change in change-log since v2: > * Make sure that evtchn hasn't been added yet before binding it in > evtchn_ioctl():case IOCTL_EVTCHN_BIND_STATIC > > Reviewed-by: Oleksandr Tyshchenko Acked-by: Stefano Stabellini --8323329-27211591-1689812531=:3118466--