Re: [Patch v3 1/2] cgroup: sev: Add misc cgroup controller

2021-03-24 Thread Vipin Sharma
On Wed, Mar 24, 2021 at 09:17:01AM -0700, Jacob Pan wrote: > 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

Re: [Patch v3 1/2] cgroup: sev: Add misc cgroup controller

2021-03-24 Thread Jacob Pan
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

Re: [Patch v3 1/2] cgroup: sev: Add misc cgroup controller

2021-03-22 Thread Vipin Sharma
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

Re: [Patch v3 1/2] cgroup: sev: Add misc cgroup controller

2021-03-19 Thread Jacob Pan
Hi Vipin, On Thu, 4 Mar 2021 15:19:45 -0800, Vipin Sharma wrote: > +/* SPDX-License-Identifier: GPL-2.0 */ > +/* > + * Miscellaneous cgroup controller. > + * > + * Copyright 2020 Google LLC > + * Author: Vipin Sharma > + */ > +#ifndef _MISC_CGROUP_H_ > +#define _MISC_CGROUP_H_ > + nit: should

Re: [Patch v3 1/2] cgroup: sev: Add misc cgroup controller

2021-03-15 Thread Michal Koutný
On Fri, Mar 12, 2021 at 11:07:14AM -0800, Vipin Sharma wrote: > We should be fine without atomic64_t because we are using unsigned > long and not 64 bit explicitly. This will work on both 32 and 64 bit > machines. I see. > But I will add READ_ONCE and WRITE_ONCE because of potential chances of

Re: [Patch v3 1/2] cgroup: sev: Add misc cgroup controller

2021-03-12 Thread Tom Lendacky
On 3/12/21 2:51 PM, Sean Christopherson wrote: On Fri, Mar 12, 2021, Vipin Sharma wrote: On Thu, Mar 11, 2021 at 07:59:03PM +0100, Michal Koutný wrote: +#ifndef CONFIG_KVM_AMD_SEV +/* + * When this config is not defined, SEV feature is not supported and APIs in + * this file are not used but

Re: [Patch v3 1/2] cgroup: sev: Add misc cgroup controller

2021-03-12 Thread Sean Christopherson
On Fri, Mar 12, 2021, Vipin Sharma wrote: > On Thu, Mar 11, 2021 at 07:59:03PM +0100, Michal Koutný wrote: > > > +#ifndef CONFIG_KVM_AMD_SEV > > > +/* > > > + * When this config is not defined, SEV feature is not supported and > > > APIs in > > > + * this file are not used but this file still

Re: [Patch v3 1/2] cgroup: sev: Add misc cgroup controller

2021-03-12 Thread Vipin Sharma
On Thu, Mar 11, 2021 at 07:59:03PM +0100, Michal Koutný wrote: > > +#ifndef CONFIG_KVM_AMD_SEV > > +/* > > + * When this config is not defined, SEV feature is not supported and APIs > > in > > + * this file are not used but this file still gets compiled into the KVM > > AMD > > + * module. > > +

Re: [Patch v3 1/2] cgroup: sev: Add misc cgroup controller

2021-03-12 Thread Vipin Sharma
On Thu, Mar 11, 2021 at 07:59:03PM +0100, Michal Koutný wrote: > Given different two-fold nature (SEV caller vs misc controller) of some > remarks below, I think it makes sense to split this into two patches: > a) generic controller implementation, > b) hooking the controller into SEV ASIDs

Re: [Patch v3 1/2] cgroup: sev: Add misc cgroup controller

2021-03-11 Thread Michal Koutný
Hi Vipin. On Thu, Mar 04, 2021 at 03:19:45PM -0800, Vipin Sharma wrote: > arch/x86/kvm/svm/sev.c| 65 +- > arch/x86/kvm/svm/svm.h| 1 + > include/linux/cgroup_subsys.h | 4 + > include/linux/misc_cgroup.h | 130 +++ > init/Kconfig | 14 ++ >

[Patch v3 1/2] cgroup: sev: Add misc cgroup controller

2021-03-04 Thread Vipin Sharma
The Miscellaneous cgroup provides the resource limiting and tracking mechanism for the scalar resources which cannot be abstracted like the other cgroup resources. Controller is enabled by the CONFIG_CGROUP_MISC config option. The first two resources added to the miscellaneous controller are