Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp39370pxf; Wed, 24 Mar 2021 20:15:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxvCT82ohWBBrSnsH1730uMQoBR5siBn7CeqhrlzVGHqqrLwRh0v/PloSR1Bpd00lGB41IT X-Received: by 2002:aa7:c3c4:: with SMTP id l4mr6623470edr.335.1616642156541; Wed, 24 Mar 2021 20:15:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616642156; cv=none; d=google.com; s=arc-20160816; b=fcxRhxCKv/mgZ/DpeYVvK9z+ysh1GMEnf52q/jz4dycK19zH89p2QOtf48Eu/MsCms IE+A3wkAQEDneiZGC7eQ8UXX6S/ppMPOfG/Bi+HuRtAkZkyCW1+ro7+f6dkNdXxQOyue N/Vs0rBkQAKSsTSVMIl2Frn/D1Ezvc7k8RZCNdF2h5ZanJm+EbVSUaUObOzDRFfv+h5t r+cviCMNqTyw7RLRl0fJskJzt/Mf+TnifH05gsNgyFc4ASNUxZ4/ON0sUEVFc+EhBUDm nEKMe/GXgr/NYCKDpOhqNQjPoY1lW0/WA5c3vUgxpwXXcF4cxSQV05izHq2jkVy3TMIi j4TQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:ironport-sdr:ironport-sdr; bh=w7IaFohl+0LqObVXZa1scnhijwacTlaydR5XJlqUozY=; b=IM2tb200NafgemEIr6Gb55M8pdMvYwyu+exer2Kde5zfRg8+0MApv72G7yLs9uBCXM AqKCHhyP4C16d3V9PXxNLX0v8VxFnJu8/vxlLQHtQ5F026r/OWKgZ+kvRzW+KYs0u89q D5eim7YcJxzDQQN68xYMHomUrHq+rmmWjjB3K+ZzOW8XWXXNqQPrCnwdhVZt4/4GOgJN 361rhKr+Jcc1cFtZ+xAEw0zWgYt0x1tFY0ZdJMHqMzlBtWwD8sHy0V6JSiQYR1AfzrRI xjCnBN1y92lsEGjzvaRy6aK9ezWr/lMhwpOeN3E9LXxKlWCsB8/8w0CJUzWwA6XcnbTK 7eYQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y13si3243007edv.220.2021.03.24.20.15.33; Wed, 24 Mar 2021 20:15:56 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233333AbhCXQPI (ORCPT + 99 others); Wed, 24 Mar 2021 12:15:08 -0400 Received: from mga11.intel.com ([192.55.52.93]:57098 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230035AbhCXQOf (ORCPT ); Wed, 24 Mar 2021 12:14:35 -0400 IronPort-SDR: zfGTiFEjKYvtYdtrDBg2JmPFkHkDM31AVIESN2o4IN/pF8FZLlrYnuAeT6rTbFpQSWc+CyNxmY nhDw2gaHwFyA== X-IronPort-AV: E=McAfee;i="6000,8403,9933"; a="187430914" X-IronPort-AV: E=Sophos;i="5.81,275,1610438400"; d="scan'208";a="187430914" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Mar 2021 09:14:35 -0700 IronPort-SDR: QSC95SEdrOKTkNAZDK+sqyjUDZsIHx2HWakvGcOAsBjSY6RfDxOQm0tHKN5ZPswqAR2wDcgFXZ I+y6CZWu0a8w== X-IronPort-AV: E=Sophos;i="5.81,275,1610438400"; d="scan'208";a="391356730" Received: from jacob-builder.jf.intel.com (HELO jacob-builder) ([10.7.199.155]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Mar 2021 09:14:34 -0700 Date: Wed, 24 Mar 2021 09:17:01 -0700 From: Jacob Pan To: Vipin Sharma Cc: tj@kernel.org, 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, Jacob Pan , jacob.jun.pan@intel.com Subject: Re: [Patch v3 1/2] cgroup: sev: Add misc cgroup controller Message-ID: <20210324091701.63c9ce8e@jacob-builder> In-Reply-To: References: <20210304231946.2766648-1-vipinsh@google.com> <20210304231946.2766648-2-vipinsh@google.com> <20210319142801.7dcce403@jacob-builder> Organization: OTC X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Vipin, On Mon, 22 Mar 2021 11:54:39 -0700, Vipin Sharma wrote: > On Fri, Mar 19, 2021 at 02:28:01PM -0700, Jacob Pan wrote: > > On Thu, 4 Mar 2021 15:19:45 -0800, Vipin Sharma > > wrote: > > > +#ifndef _MISC_CGROUP_H_ > > > +#define _MISC_CGROUP_H_ > > > + > > nit: should you do #include ? > > Otherwise, css may be undefined. > > User of this controller will use get_curernt_misc_cg() API which returns > a pointer. Ideally the user should use this pointer and they shouldn't > have any need to access "css" in their code. They also don't need to > create a object of 'struct misc_cg{}', because that won't be correct misc > cgroup object. They should just declare a pointer like we are doing here > in 'struct kvm_sev_info {}'. > > If they do need to use "css" then they can include cgroup header in their > code. > I didn't mean the users of misc_cgroup will use css directly. I meant if I want to use misc cgruop in ioasid.c, I have to do the following to avoid undefined css: #include #include So it might be simpler if you do #include inside misc_cgroup.h. Then in ioasid.c, I only need to do #include . > Let me know if I am overlooking something here. > > Thanks > Vipin Sharma Thanks, Jacob