Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp144642ybg; Sun, 31 May 2020 19:55:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxuQ2sWYQosXdkLpiyxjK+HVrEFDgx5uIztPZhkY4FDz85ZJJnTaOjPM/jHZb+atwyQah9A X-Received: by 2002:a50:d78f:: with SMTP id w15mr3861190edi.245.1590980147035; Sun, 31 May 2020 19:55:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590980147; cv=none; d=google.com; s=arc-20160816; b=Twtz5ZKvGct332ZaHt0W2quwmc6GVrLgmcCq70BlURCGtJ+yy6FQGyyyDGYEr4c0WS wyjS3snhJy/E+kdfF+SACvu7dG8YjYbKEWYP4/H3rwWLNhBCMywJg1kG24UTRviGsEwy SM00E9sn5wHNqaUa0EhawGrBYBaDyfPN286tCGBFP3C+UhyCS6geWPwbNxPQPGKCAhaX CN580YbK0uRUR5L07ceKZO+JHsC7kiKXbRK0DhHoiOTspBJB7rim6BxBuKuqiwPrY/43 REEyQbL2Sk4p2ZCdQ8Ih4SAsfneG884tmsqCPjHXzzBRAiI0fjyELZ69YqLj3+8z+5tj WgCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=3Z30Aj7DWdiryvWWRCamQh7/ZunHJKYEyQE4I3X5YSY=; b=MEdrEnChHWcR9ciPh0WhKtPTSXu0i/IRCjDCrpikEmfNm+FMSSwR3K2TVl+EqEvA2c 1MzU6eeyKe8IGpmynoFbWnvmE3lJ5bJrDagHxoR2UTHpC/lTt+jCRZRHkz/g7LiGS9D1 9PlJoSGHBDrIaT5xZnQE8rU51St+bvGwRpaXrPyuVZBeOdF7gZmJ8v8zpEWFnQ7Axw5B bMEmTnsQqVesTuqjNmexfjZLnLwzf5i9tb47FS4GXsOegyRD6W1wszOmYeUUurJ7tSUr oFVmkLBuuQgVsY0MddFmnLXz/IlbTZ3CukLkXh9T4KBxX+CPWOhHv/9A+Dbh8a52iHyG DgcA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c17si3586007edv.2.2020.05.31.19.55.23; Sun, 31 May 2020 19:55:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727121AbgFACvl (ORCPT + 99 others); Sun, 31 May 2020 22:51:41 -0400 Received: from kernel.crashing.org ([76.164.61.194]:53906 "EHLO kernel.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726218AbgFACvl (ORCPT ); Sun, 31 May 2020 22:51:41 -0400 Received: from localhost (gate.crashing.org [63.228.1.57]) (authenticated bits=0) by kernel.crashing.org (8.14.7/8.14.7) with ESMTP id 0512pHeQ003129 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 31 May 2020 21:51:21 -0500 Message-ID: Subject: Re: [PATCH v3 07/18] nitro_enclaves: Init misc device providing the ioctl interface From: Benjamin Herrenschmidt To: Alexander Graf , Greg KH Cc: Andra Paraschiv , linux-kernel@vger.kernel.org, Anthony Liguori , Colm MacCarthaigh , Bjoern Doebel , David Woodhouse , Frank van der Linden , Martin Pohlack , Matt Wilson , Paolo Bonzini , Balbir Singh , Stefano Garzarella , Stefan Hajnoczi , Stewart Smith , Uwe Dannowski , kvm@vger.kernel.org, ne-devel-upstream@amazon.com Date: Mon, 01 Jun 2020 12:51:16 +1000 In-Reply-To: <59007eb9-fad3-9655-a856-f5989fa9fdb3@amazon.de> References: <20200525221334.62966-1-andraprs@amazon.com> <20200525221334.62966-8-andraprs@amazon.com> <20200526065133.GD2580530@kroah.com> <72647fa4-79d9-7754-9843-a254487703ea@amazon.de> <20200526123300.GA2798@kroah.com> <59007eb9-fad3-9655-a856-f5989fa9fdb3@amazon.de> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2020-05-26 at 14:44 +0200, Alexander Graf wrote: > So I really don't think an ioctl would be a great user experience. Same > for a sysfs file - although that's probably slightly better than the ioctl. What would be wrong with a sysfs file ? Another way to approach that makes sense from a kernel perspective is to have the user first offline the CPUs, then "donate" them to the driver via a sysfs file. > Other options I can think of: > > * sysctl (for modules?) Why would that be any good ? If anything sysctl's are even more awkward in my book :) > * module parameter (as implemented here) > * proc file (deprecated FWIW) Yeah no. > The key is the tenant split: Admin sets the pool up, user consumes. This > setup should happen (early) on boot, so that system services can spawn > enclaves. Right and you can have some init script or udev rule that sets that up from a sys admin produced config file at boot upon detection of the enclave PCI device for example. > > module parameters are a major pain, you know this :) > > I think in this case it's the least painful option ;). But I'm really > happy to hear about an actually good alternative to it. Right now, I > just can't think of any. Cheers, Ben.