lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Sat, 30 Mar 2019 02:40:41 +0000
From:   "Pandruvada, Srinivas" <srinivas.pandruvada@...el.com>
To:     "Yazen.Ghannam@....com" <Yazen.Ghannam@....com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "devel@...ica.org" <devel@...ica.org>,
        "Janakarajan.Natarajan@....com" <Janakarajan.Natarajan@....com>,
        "linux-acpi@...r.kernel.org" <linux-acpi@...r.kernel.org>,
        "linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>
CC:     "lenb@...nel.org" <lenb@...nel.org>,
        "viresh.kumar@...aro.org" <viresh.kumar@...aro.org>,
        "Moore, Robert" <robert.moore@...el.com>,
        "Schmauss, Erik" <erik.schmauss@...el.com>,
        "rjw@...ysocki.net" <rjw@...ysocki.net>
Subject: Re: [PATCH 5/6] acpi/cppc: Add support for optional CPPC registers

On Fri, 2019-03-29 at 20:18 +0000, Ghannam, Yazen wrote:
> > -----Original Message-----
> > From: linux-acpi-owner@...r.kernel.org <
> > linux-acpi-owner@...r.kernel.org> On Behalf Of Pandruvada, Srinivas
> > Sent: Wednesday, March 27, 2019 10:48 AM
> > To: linux-kernel@...r.kernel.org; devel@...ica.org; Natarajan,
> > Janakarajan <Janakarajan.Natarajan@....com>; linux-
> > acpi@...r.kernel.org; linux-pm@...r.kernel.org
> > Cc: Ghannam, Yazen <Yazen.Ghannam@....com>; lenb@...nel.org; 
> > viresh.kumar@...aro.org; Moore, Robert
> > <robert.moore@...el.com>; Schmauss, Erik <erik.schmauss@...el.com>;
> > rjw@...ysocki.net
> > Subject: Re: [PATCH 5/6] acpi/cppc: Add support for optional CPPC
> > registers
> > 
> > On Fri, 2019-03-22 at 20:26 +0000, Natarajan, Janakarajan wrote:
> > > From: Yazen Ghannam <Yazen.Ghannam@....com>
> > > 
> > > Newer AMD processors support a subset of the optional CPPC
> > > registers.
> > > Create show, store and helper routines for supported CPPC
> > > registers.
> > > 
> > > Signed-off-by: Yazen Ghannam <Yazen.Ghannam@....com>
> > > [ carved out into a patch, cleaned up, productized ]
> > > Signed-off-by: Janakarajan Natarajan <
> > > Janakarajan.Natarajan@....com>
> > > 
> > 
> > [..]
> > 
> > > +	/* desired_perf is the only mandatory value in perf_ctrls */
> > > +	if (cpc_read(cpu, desired_reg, &desired))
> > > +		ret = -EFAULT;
> > > +
> > > +	if (CPC_SUPPORTED(max_reg) && cpc_read(cpu, max_reg, &max))
> > > +		ret = -EFAULT;
> > > +
> > 
> > We should create and use different macro other than CPPC_SUPPORTED.
> > CPC_SUPPORTED doesn't validate the correctness of object type for a
> > field. For example "Maximum Performance Register" can only be
> > buffer
> > not integer. In this way invalid field definitions can be ignored.
> > 
> 
> So create something like "CPPC_SUPPORTED_BUFFER" for buffer-only
> registers?
> 
> And then buffer/integer registers will continue to use
> "CPPC_SUPPORTED".
> 
> These seem to be the only two cases at this time. Is this okay?
Yes.

Thanks,
Srinivas

> 
> Thanks,
> Yazen
> 
> > 
> > > +	if (CPC_SUPPORTED(min_reg) && cpc_read(cpu, min_reg, &min))
> > > +		ret = -EFAULT;
> > > +
> > > +	if (CPC_SUPPORTED(energy_reg) && cpc_read(cpu, energy_reg,
> > > &energy))
> > > +		ret = -EFAULT;
> > > +
> > > +	if (CPC_SUPPORTED(auto_sel_enable_reg) &&
> > > +	    cpc_read(cpu, auto_sel_enable_reg, &auto_sel_enable))
> > > +		ret = -EFAULT;
> > > +
> > 
> > Here it is fine to use CPC_SUPPORTED as the "Autonomous Selection
> > Enable" can be both integer and buffer.
> > 
> > Thanks,
> > Srinivas
> 
> 

Download attachment "smime.p7s" of type "application/x-pkcs7-signature" (3290 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ