Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp11302pxb; Tue, 19 Jan 2021 23:17:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJy+4Vq3wJwCKu3Y38szCfagjg6t4F9/iMOE8mJpdwClj4kkDtfVurde+bStpjxN4Fe9l/O2 X-Received: by 2002:a05:6402:3130:: with SMTP id dd16mr1507465edb.282.1611127050425; Tue, 19 Jan 2021 23:17:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611127050; cv=none; d=google.com; s=arc-20160816; b=ZW7rstyddPuFNgENA8a7fzsU5Urd+zpi3yCXDqHXBvhvZItqOeHu69pA8ns3oUT+rC Fwv9ZGTkZ9CMi9mX5vZSuOXM6R5LnnDw3LXdkWSdW9CJPVN7aX992wc9gMsguPLC7bKU LR9mgZ4ToLpqGec00pTv7SPCHk30SMSQPWn01G6uiu0RbmJNbgqUQ3TmwEm3ez/LZE/K 9zFZ+lxpq5BiyhbtE75GBZrqC+vTqtstC64zegtakjsZl4cntLXQNRuoaV4TnnZ5I3Kc Kg/MPOMfefjKlmRkrs4xVXYlUbGYQiQgNnpALMMyzKgds+2LZmW7GY+B/+3heyiGOT7e S5Rg== 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:dkim-signature; bh=TTV6nYqcO5XSWys9zWm8wnK0Pv6PThaQer4+oGm8NGU=; b=S1g+xX8l04xWoVIgRRuBIFXOXNAGPBZtJtg7SBBFardAJ7inSEheMsE0PQ1q54HDKj 6wz+z48hD08eX2+Y95EhdkFgA9uuOvecx38bBqdmpmBPTGjTSk9p6v8Iat+Z4SA0Tl+h 6KWa2dapqjKjgXEyXuZ1nK+pe9sT2YtgHrbjYhyI8JujqL1JVBLGidiJEVJu2hUW8O2n 1VKZgvi4Hhb+RNzv4Bg/IACctKbjPLf0I8BroQxZKYVQKlbbFb2h4N5i6IL3mmpY0z74 tlREGqW8Ld8/Gnl7xvlsoBJklIq6qkfSrAbcPQlv0uZyAEFWYOiJJzX3yGE60B2c8eJy WsWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=HIc1eaI5; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n23si402380ejj.160.2021.01.19.23.16.44; Tue, 19 Jan 2021 23:17:30 -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=@google.com header.s=20161025 header.b=HIc1eaI5; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726552AbhATHO4 (ORCPT + 99 others); Wed, 20 Jan 2021 02:14:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725320AbhATHOi (ORCPT ); Wed, 20 Jan 2021 02:14:38 -0500 Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B0DAC061757 for ; Tue, 19 Jan 2021 23:13:57 -0800 (PST) Received: by mail-pf1-x435.google.com with SMTP id b3so13961686pft.3 for ; Tue, 19 Jan 2021 23:13:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=TTV6nYqcO5XSWys9zWm8wnK0Pv6PThaQer4+oGm8NGU=; b=HIc1eaI5kMbParlqoxUe710DEIElJcljsyDbh1ppcnKJbXKV202dwYfKtT37vYEsJd Igzd1+h2pYuRhJQincqk99FJ7Oi0Wm9IdIVFJ++zyiGx10XzKtS66jPCa7AxoVZejV2c hURdb8ummwjbEbDuaQonFCLiiarN8aM8f0PmyI6fka/dVXK6rZWjpLBAs6H340vKVaCM k7zNarmhmjrPX/jP+fmDQnR71WNX7fB8drCbiPH45F+dbEWVt+u6DIFOwR0CzZtXFah6 5gHgWAQ0EhY5hXY/+S3ovR79cyKl37oyqvG6K/KYsz8LzYyDSEyhL3ZxSK3FAohzXA2j mG9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=TTV6nYqcO5XSWys9zWm8wnK0Pv6PThaQer4+oGm8NGU=; b=jzoDHpCiqaztOzmDm9omiKZUhNsiwYNXnKfplRFHIzk6i5gFRWcWBFQE5kB5isClDk DAVBTdNwNyCxVLbjuGXCNlZeRbQuF2t6YnhaTO3uS6/9HdIoA/owgDZzR3/msxuvqk2y +OgNW+FY8umaowUIy4KkMfM/ZYZ1TZMosK3g/dMa8KwQM08IMZohQcbyRnt6TEiFq+TJ Alvq58EwKS01gOC10/kuxUzwWchcW4dPdFb6swqJ2wtmFxN3MN0u1M2qVWO6DzOvc0eD rHpHKyqWVkJOivZbL5l2M1lGce9QgZMWQzGP6TTtLI+BgL85vPpBtEUUOtRLCctqoNGF oXUw== X-Gm-Message-State: AOAM532LjkV719K1cBy/tTWSlhdDoL9G31jiMLVemLuDWSg4POuV4pn3 rO4c67OM6RXyve5vCE7NPNBsiQ== X-Received: by 2002:a65:4983:: with SMTP id r3mr8245442pgs.288.1611126836639; Tue, 19 Jan 2021 23:13:56 -0800 (PST) Received: from google.com ([2620:0:1008:10:1ea0:b8ff:fe75:b885]) by smtp.gmail.com with ESMTPSA id bt8sm6171170pjb.0.2021.01.19.23.13.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Jan 2021 23:13:55 -0800 (PST) Date: Tue, 19 Jan 2021 23:13:51 -0800 From: Vipin Sharma To: Tejun Heo Cc: thomas.lendacky@amd.com, brijesh.singh@amd.com, jon.grimm@amd.com, eric.vantassell@amd.com, pbonzini@redhat.com, seanjc@google.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, rientjes@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: <20210108012846.4134815-1-vipinsh@google.com> <20210108012846.4134815-2-vipinsh@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 19, 2021 at 10:51:24AM -0500, Tejun Heo wrote: > Hello, > > On Fri, Jan 15, 2021 at 08:32:19PM -0800, Vipin Sharma wrote: > > SEV-ES has stronger memory encryption gurantees compared to SEV, apart > > from encrypting the application memory it also encrypts register state > > among other things. In a single host ASIDs can be distributed between > > these two types by BIOS settings. > > > > Currently, Google Cloud has Confidential VM machines offering using SEV. > > ASIDs are not compatible between SEV and SEV-ES, so a VM running on SEV > > cannot run on SEV-ES and vice versa > > > > There are use cases for both types of VMs getting used in future. > > Can you please elaborate? I skimmed through the amd manual and it seemed to > say that SEV-ES ASIDs are superset of SEV but !SEV-ES ASIDs. What's the use > case for mixing those two? For example, customers can be given options for which kind of protection they want to choose for their workloads based on factors like data protection requirement, cost, speed, etc. In terms of features SEV-ES is superset of SEV but that doesn't mean SEV ASIDs are superset of SEV ASIDs. SEV ASIDs cannot be used for SEV-ES VMs and similarly SEV-ES ASIDs cannot be used for SEV VMs. Once a system is booted, based on the BIOS settings each type will have their own capacity and that number cannot be changed until the next boot and BIOS changes. We are not mixing the two types of ASIDs, they are separate and used separately. > > > > > > > Other ID types can be easily added in the controller in the same way. > > > > > > > > > > I'm not sure this is necessarily a good thing. > > > > > > > > This is to just say that when Intel and PowerPC changes are ready it > > > > won't be difficult for them to add their controller. > > > > > > I'm not really enthused about having per-hardware-type control knobs. None > > > of other controllers behave that way. Unless it can be abstracted into > > > something common, I'm likely to object. > > > > There was a discussion in Patch v1 and consensus was to have individual > > files because it makes kernel implementation extremely simple. > > > > https://lore.kernel.org/lkml/alpine.DEB.2.23.453.2011131615510.333518@chino.kir.corp.google.com/#t > > I'm very reluctant to ack vendor specific interfaces for a few reasons but > most importantly because they usually indicate abstraction and/or the > underlying feature not being sufficiently developed and they tend to become > baggages after a while. So, here are my suggestions: My first patch was only for SEV, but soon we got comments that this can be abstracted and used by TDX and SEID for their use cases. I see this patch as providing an abstraction for simple accounting of resources used for creating secure execution contexts. Here, secure execution is achieved through different means. SEID, TDX, and SEV provide security using different features and capabilities. I am not sure if we will reach a point where all three and other vendors will use the same approach and technology for this purpose. Instead of each one coming up with their own resource tracking for their features, this patch is providing a common framework and cgroup for tracking these resources. > > * If there can be a shared abstraction which hopefully makes intuitive > sense, that'd be ideal. It doesn't have to be one knob but it shouldn't be > something arbitrary to specific vendors. I think we should see these as features provided on a host. Tasks can be executed securely on a host with the guarantees provided by the specific feature (SEV, SEV-ES, TDX, SEID) used by the task. I don't think each H/W vendor can agree to a common set of security guarantees and approach. > > * If we aren't there yet and vendor-specific interface is a must, attach > that part to an interface which is already vendor-aware. Sorry, I don't understand this approach. Can you please give more details about it? Thanks Vipin