Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp458712pxb; Wed, 27 Jan 2021 11:58:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJx14bCa8QI4cW3fmzo3GWlToS6S2IBb3YCEUgraoZiQvF2jd8hYzT1EELdpH+9pt/erj1ZV X-Received: by 2002:a05:6402:10ce:: with SMTP id p14mr8518042edu.261.1611777503570; Wed, 27 Jan 2021 11:58:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611777503; cv=none; d=google.com; s=arc-20160816; b=WAxvOJqhRqu1t/GsqPm3YYqbSARP2BeyWdWXsh06GRwKiNiFD388ls5XGiIrANam43 bZ6bHpkZozv5RvpJOBbd88GyWfEaJWDETjEaT0+TTMPPtJHq3cIRsFqITvhlivSd8MoA 19fJP6dSV3pKqFUcBXcCPnaox4f0TZdce51jg5/hQkm2vmGYwEaNHOMISzlxH2HuWB6d VB9piJ5cPU7FAHh6JhkVzrAgGrHZu+dckMhwgGvgl96E6MnGzGkjormSBF1NrX1K4uVI eTlV0Yr9sg0dX2uBDinBqhu2bnIEqzHiKHJoi8U5eerHTkyabqxfTzSykrlWziPIRzvk ZjoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:sender:dkim-signature; bh=MIH2UNLi2fhCMoMNiRx154+VpM0NIRieyzpHxs5Dshw=; b=Aidhon22/+ShYbRvyutkbyI1q2U/BfsmlAX9WE7447ocTOroFP+Zll3PynYPpzBjxf sdR47xI/vSr5D/6JQvdsX5AYzXxPxUCb3TA1yYsLH5afcWnYpdr8UQV7CR6qPAaUQoSu hqh3kgh3Gxbo5W54V+mys2FOULGerRfi466xYTdk3yQwzVlnMB55+XGt2psuB5ybfP5h xT3QqzlIyIlWeOjl6amd/dmIRF4tj+VFwp3e+Lq0vV5Wr577M3OcNKNEXlI5RsoWFqlR SKpwCUEu7OQEyCga8u33ZZ+x5Ejx7YZHQoJfrufa+2o86ktBWrbdU5nwZSppzfjmsqPg Zw2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DEjU2Vlz; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c10si1273428ejs.369.2021.01.27.11.57.58; Wed, 27 Jan 2021 11:58:23 -0800 (PST) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DEjU2Vlz; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236669AbhA0Diz (ORCPT + 99 others); Tue, 26 Jan 2021 22:38:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727745AbhAZWBu (ORCPT ); Tue, 26 Jan 2021 17:01:50 -0500 Received: from mail-qk1-x72c.google.com (mail-qk1-x72c.google.com [IPv6:2607:f8b0:4864:20::72c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56E15C06174A; Tue, 26 Jan 2021 14:01:06 -0800 (PST) Received: by mail-qk1-x72c.google.com with SMTP id x81so14730873qkb.0; Tue, 26 Jan 2021 14:01:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=MIH2UNLi2fhCMoMNiRx154+VpM0NIRieyzpHxs5Dshw=; b=DEjU2Vlz+c8s8l7i4VvNrOHrZX1BFA/CoCHLraoX/TGR7m7IOU/Tk+tMXGz2Ie8kVj NRrXxn6RiYvZpVsXxyW2ANxFvOjsPw4fYgILW+Q5wT0h4ekogKQAo1eKS1P77lgKI3nI 1mkQ+1lcbvQhLF8LTabfIIo+NAgLtSI25NYjLc4f8IcvqpFBJSRSI43sJ5oVpm02n96D QVU/+8yE+q/cn9U/oK+XTtYMJXq+KdR1HO8fMUu0+7yHtjfPTvUZedtrUjvG7fCSneZs e9r9Ve3hIZgRPOpS/7mGJOTQ3Etujv//AbXyOlHj1gMJpEg1TnivcCjUgu+u+sloivxz wPuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=MIH2UNLi2fhCMoMNiRx154+VpM0NIRieyzpHxs5Dshw=; b=d/+dpZBRwpV39dm8EzskT6p0ZDamIMjc17bYtgk+i8QCBZxWhDDIbZzrmBLfRpPRah gTjm3cXaMkM2XO8wFzmWkQ0cZlpmTl9xDlUGL18UrCsvNROcc3NS0NRD82u4wcFSRLfd Gp8tCSlVCARYlqSwjAIQWiRbiTgB/olGXUrfgq8BgHStjIJgytzZrgK+OK7TSbhltRfg TiayRUtdw1XHxc9WoeQ/JmkNEuSSZdTa8CtpBhpUfnJxVo6uPlzlgjLO99uvMkBquOo3 CCiKC8woPe7ugKfjCqerzqksCT+SIoT9Q8GKPV27u5N1SE+qUhAMQTk5GYViOYEKSwwQ JbhQ== X-Gm-Message-State: AOAM531m3KGh0bxj/2ebS+RKlojNjTpXXNHon96rAOtsS2bYERvVuWR2 9uV7mqRTanbr+kunlgoFWkc= X-Received: by 2002:a37:9f55:: with SMTP id i82mr6102308qke.205.1611698465257; Tue, 26 Jan 2021 14:01:05 -0800 (PST) Received: from localhost (dhcp-6c-ae-f6-dc-d8-61.cpe.echoes.net. [72.28.8.195]) by smtp.gmail.com with ESMTPSA id q92sm13832qtd.92.2021.01.26.14.01.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Jan 2021 14:01:04 -0800 (PST) Sender: Tejun Heo Date: Tue, 26 Jan 2021 17:01:04 -0500 From: Tejun Heo To: David Rientjes Cc: Sean Christopherson , Tom Lendacky , Vipin Sharma , "Singh, Brijesh" , "Grimm, Jon" , "Van Tassell, Eric" , pbonzini@redhat.com, lizefan@huawei.com, hannes@cmpxchg.org, frankja@linux.ibm.com, borntraeger@de.ibm.com, corbet@lwn.net, joro@8bytes.org, vkuznets@redhat.com, wanpengli@tencent.com, jmattson@google.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, gingell@google.com, dionnaglaze@google.com, kvm@vger.kernel.org, x86@kernel.org, cgroups@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [Patch v4 1/2] cgroup: svm: Add Encryption ID controller Message-ID: References: <1744f6c-551b-8de8-263e-5dac291b7ef@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1744f6c-551b-8de8-263e-5dac291b7ef@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Tue, Jan 26, 2021 at 12:49:14PM -0800, David Rientjes wrote: > > SEV-SNP, another incremental enhancement (on SEV-ES), further strengthens the > > argument for SEV and SEV-* coexistenence. SEV-SNP and SEV-ES will share the > > same ASID range, so the question is really, "do we expect to run SEV guests and > > any flavor of SEV-* guests on the same platform". And due to SEV-* not being > > directly backward compatible with SEV, the answer will eventually be "yes", as > > we'll want to keep running existing SEV guest while also spinning up new SEV-* > > guests. > > > > Agreed, cloud providers will most certainly want to run both SEV and SEV-* > guests on the same platform. Am I correct in thinking that the reason why these IDs are limited is because they need to be embedded into the page table entries? If so, we aren't talking about that many IDs and having to divide the already small pool into disjoint purposes doesn't seem like a particularly smart use of those bits. It is what it is, I guess. > I'm slightly concerned about extensibility if there is to be an > incremental enhancement atop SEV-* or TDX with yet another pool of > encryption ids. (For example, when we only had hugepages, this name was > perfect; then we got 1GB pages which became "gigantic pages", so are 512GB > pages "enormous"? :) I could argue (encryption_ids.basic.*, > encryption_ids.enhanced.*) should map to > (encryption_ids.legacy.*, encryption_ids.*) but that's likely > bikeshedding. > > Thomas: does encryption_ids.{basic,enhanced}.* make sense for ASID > partitioning? > > Tejun: if this makes sense for legacy SEV and SEV-* per Thomas, and this > is now abstracted to be technology (vendor) neutral, does this make sense > to you? The whole thing seems pretty immature to me and I agree with you that coming up with an abstraction at this stage feels risky. I'm leaning towards creating a misc controller to shove these things into: * misc.max and misc.current: nested keyed files listing max and current usage for the cgroup. * Have an API to activate or update a given resource with total resource count. I'd much prefer the resource list to be in the controller itself rather than being through some dynamic API just so that there is some review in what keys get added. * Top level cgroup lists which resource is active and how many are available. So, behavior-wise, not that different from the proposed code. Just made generic into a misc controller. Would that work? Thanks. -- tejun