From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87397C433E6 for ; Mon, 15 Mar 2021 22:20:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 53F4764F51 for ; Mon, 15 Mar 2021 22:20:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229605AbhCOWTp (ORCPT ); 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-Google-Smtp-Source: ABdhPJzvXqprKoAutME/Zx0t4IAmyvOYWNNLf7LhOP5C6LVfWPeE7qFKtLKEj9qf8W3FiHj+NYGgGw== 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: kvm@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