Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3661514pxf; Mon, 15 Mar 2021 15:21:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy084vvrv30r1w78UjAOHyWQThqGr+DXf/j6to5ov5W2pHwrkFDg93jZ1pxdQ34islScQik X-Received: by 2002:a17:906:39a:: with SMTP id b26mr26632432eja.158.1615846862940; Mon, 15 Mar 2021 15:21:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615846862; cv=none; d=google.com; s=arc-20160816; b=oYt9/YO4JXm0dPMx/n93fz7IJCG1aHlrZoyJttvGgbGcKk6+1HnRt/RiHyIi7XZ03p c0cpQKwG6DJsF0gPaO9mPYwJSfCpXX7DsxK6a+eTrzx2eohOmvoV3+Qc/lS73eSYm8bh hDJ95qjG5vqKJpIqFTHe3GlrmHUMHlI99A7IVGyfs5rvQnoNy7DGJJGzuFZJk0+ke/tq gMtaJ3McpxSBjbhJZlWK7xUOjXWninVefH27+cDB6J6Eh2L7NdYSHyxCbEp/uaOQnk+k Hw1JdRxBqaMyDdvD5ypukyj0gqzJFAehEPUiynRJBSSJ2Shm1Axwt6WETTlyHMapMHWK tAaA== 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=3mc7yshphWRfddErbP6ANAyJjIp9vav1KVv/MqnV+08=; b=B1jQHKAl7Z/33CrRnFH1DXEIOwuh2EF3JhPxTgFcwGiIcb14NfzI/yW8Yt1HUcD9qb wXGYBSPMCyErubzSgJJNrAhw7CVbKTXfa1LQUcLPhszcLldQvf+yJ6k2iR4Wb5T8EJKu ZhuRRBOyGiV+222Qk72VYZAVXvoOxH5raTVCsoTzrc/elLeu7S+r+Kj04JaAYkXVXAFm Pz+imJFtW2RgFWt3HKjf972L7QI583yzJIKae2WpvMdbA4abILAnC6yhjsxLJnhaf6sx TUcOkOck5QbJF5sLA280LrU8uJEmpdr99EqMH56r6e/XBLkquHXpFkWNpi8vD10i+2Qf Novg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=k4pm+oGH; 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 c9si11944418ejb.466.2021.03.15.15.20.40; Mon, 15 Mar 2021 15:21:02 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=k4pm+oGH; 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 S231331AbhCOWTp (ORCPT + 99 others); Mon, 15 Mar 2021 18:19:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229948AbhCOWTh (ORCPT ); Mon, 15 Mar 2021 18:19:37 -0400 Received: from mail-qt1-x830.google.com (mail-qt1-x830.google.com [IPv6:2607:f8b0:4864:20::830]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DEA6C06175F; Mon, 15 Mar 2021 15:19:37 -0700 (PDT) Received: by mail-qt1-x830.google.com with SMTP id x9so10339619qto.8; Mon, 15 Mar 2021 15:19:37 -0700 (PDT) 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=3mc7yshphWRfddErbP6ANAyJjIp9vav1KVv/MqnV+08=; b=k4pm+oGHyW/0Hrhbuc7q0+8SgSfdHGYYhPiguGQUh3briuu3jw/5TCyzMGYg8w060V MryXnAFafYTZSEg8Y+OqxpfH8TPufBlnRmse3CpAcUakPqZ4TqGz08U1Dp6IHGvZo6dO XzvFYARQvIi9vwCArHIBTKB7h0shngcktmS2v27/iOr9YVJOqXHOVsRyLEZeZV/XAEBz wTWFgYDv6KA49YfmbS8Kz1BvuHErK/RNw44PjG4hs4LhLyftup1EIv+0wxbGVYDzlIxn sKPxsUOx+ytNRtofdhTLCw/ZiSovafjqT75OP8vBE51uc2DsudjKzAuXR9mAJe0PxXw2 7Y0g== 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=3mc7yshphWRfddErbP6ANAyJjIp9vav1KVv/MqnV+08=; b=fhDP/AO+qKTx3lp1qLorflGV5wFmAvIcpV4H5Pwdls3FlQTL4oTzcBQsG+zCJZ7Qz6 T+E7x/sIr3Qn8vK478HrOBdUv6vhqbGS2Dy9cRXMa/XZSHZo+M9SDl8WPkH0ysZfGoOp jbDv65stZjKDXCGJGUhDLsjsc6+FyY+H7r0MBtnzpfIhVbQXagtxnOEPQfQfx1aAQZnR /bHvn+tezX8aUESBs/Pjj10L88/27d5L6AcXrU+lyk2KVAJ11ziXLhZwUVUDACGNHPo3 8ZuKrwPW4R/4iWmNOKB4hQuOhV1ux02RpzphdGBmlN32E1e4UhwE6Bb5AT2K6Ly0JblJ B45A== X-Gm-Message-State: AOAM530NhVJUjbvXGHahEf7MXYUuSJrP+w4bNXvxGDcfVaYkchSA3A/P o1fIVL+fVRO7zWl66e5pN+U= X-Received: by 2002:ac8:7a95:: with SMTP id x21mr6759670qtr.209.1615846776285; Mon, 15 Mar 2021 15:19:36 -0700 (PDT) Received: from localhost (2603-7000-9602-8233-06d4-c4ff-fe48-9d05.res6.spectrum.com. [2603:7000:9602:8233:6d4:c4ff:fe48:9d05]) by smtp.gmail.com with ESMTPSA id 6sm12369287qth.82.2021.03.15.15.19.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Mar 2021 15:19:35 -0700 (PDT) Sender: Tejun Heo Date: Mon, 15 Mar 2021 18:19:35 -0400 From: Tejun Heo To: Jacob Pan Cc: Vipin Sharma , mkoutny@suse.com, rdunlap@infradead.org, thomas.lendacky@amd.com, brijesh.singh@amd.com, jon.grimm@amd.com, eric.vantassell@amd.com, pbonzini@redhat.com, hannes@cmpxchg.org, frankja@linux.ibm.com, borntraeger@de.ibm.com, corbet@lwn.net, seanjc@google.com, vkuznets@redhat.com, wanpengli@tencent.com, jmattson@google.com, joro@8bytes.org, 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, "Tian, Kevin" , "Liu, Yi L" , "Raj, Ashok" , Alex Williamson , Jason Gunthorpe , Jacob Pan , "jean-philippe@linaro.org" Subject: Re: [RFC v2 2/2] cgroup: sev: Miscellaneous cgroup documentation. Message-ID: References: <20210303185513.27e18fce@jacob-builder> <20210312125821.22d9bfca@jacob-builder> <20210312145904.4071a9d6@jacob-builder> <20210313085701.1fd16a39@jacob-builder> <20210315151155.383a7e6e@jacob-builder> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210315151155.383a7e6e@jacob-builder> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Mon, Mar 15, 2021 at 03:11:55PM -0700, Jacob Pan wrote: > > Migration itself doesn't have restrictions but all resources are > > distributed on the same hierarchy, so the controllers are supposed to > > follow the same conventions that can be implemented by all controllers. > > > Got it, I guess that is the behavior required by the unified hierarchy. > Cgroup v1 would be ok? But I am guessing we are not extending on v1? A new cgroup1 only controller is unlikely to be accpeted. > The IOASIDs are programmed into devices to generate DMA requests tagged > with them. The IOMMU has a per device IOASID table with each entry has two > pointers: > - the PGD of the guest process. > - the PGD of the host process > > The result of this 2 stage/nested translation is that we can share virtual > address (SVA) between guest process and DMA. The host process needs to > allocate multiple IOASIDs since one IOASID is needed for each guest process > who wants SVA. > > The DMA binding among device-IOMMU-process is setup via a series of user > APIs (e.g. via VFIO). > > If a process calls fork(), the children does not inherit the IOASIDs and > their bindings. Children who wish to use SVA has to call those APIs to > establish the binding for themselves. > > Therefore, if a host process allocates 10 IOASIDs then does a > fork()/clone(), it cannot charge 10 IOASIDs in the new cgroup. i.e. the 10 > IOASIDs stays with the process wherever it goes. > > I feel this fit in the domain model, true? I still don't get where migration is coming into the picture. Who's migrating where? Thanks. -- tejun