From: Daniel De Graaf Subject: Re: [PATCH 09/11] evtchn: implement EVTCHNOP_set_limit Date: Fri, 13 Sep 2013 14:32:00 -0400 Message-ID: <52335A20.1070606@tycho.nsa.gov> References: <1379091373-30293-1-git-send-email-david.vrabel@citrix.com> <1379091373-30293-10-git-send-email-david.vrabel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1379091373-30293-10-git-send-email-david.vrabel@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: David Vrabel Cc: Keir Fraser , Jan Beulich , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On 09/13/2013 12:56 PM, David Vrabel wrote: > From: David Vrabel > > Add max_evtchn_port to struct domain as the maximum port number that a > domain may bind. Allow a suitably privileged domain to set this limit > so it may restrict the other domain's usage of Xen resources for event > channels (primarily global mapping entries for the shared data > structures). > > The default values for this limit is unlimited for control domains or > NR_EVENT_CHANNELS - 1 for other domains. These defaults ensure that no > domain will regress in the number of event channels they may use. > > If a domain is expected to use the FIFO-based event channel ABI, a > toolstack may wish to set the limit to 1023 or lower to ensure a > minimum number of global mapping entries is used. > > Signed-off-by: David Vrabel > Cc: Daniel De Graaf This allows device model domains to adjust the limit of their target domain arbitrarily; I think it makes more sense for this to be XSM_PRIV so that only dom0 can adjust it, similar to max_mem. Control domains will already need an explicit XSM policy that can address this as a fine-grained permission. The new XSM hook also needs to be added to xsm/dummy.c. Adding a FLASK hook and permission similar to the one for evtchn_reset would also be nice, but that may fit better in a later patch that adds this operation to the example security policy. With the check changed to XSM_PRIV and a set_to_dummy_if_null line added to xsm/dummy.c, Acked-by: Daniel De Graaf -- Daniel De Graaf National Security Agency