lkml.org 
[lkml]   [2018]   [Jun]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V6 07/38] x86/intel_rdt: Initialize new resource group with sane defaults
On Tue, 19 Jun 2018, Reinette Chatre wrote:
> On 6/19/2018 5:31 AM, Thomas Gleixner wrote:
> > On Thu, 7 Jun 2018, Reinette Chatre wrote:
> >> +static void cbm_ensure_valid(u32 *_val, struct rdt_resource *r)
> >> +{
> >> + unsigned long *val = (unsigned long *)_val;
> >
> > I'm a bit worried about the u32 to unsigned long case here. I know that
> > cbm_len cannot exceed 32, but still. At least it wants a comment.
>
> Will do.
>
> I am planning to add the following to the next version.

Don't bother. I'm picking up the delta as I'm halfways through the whole
thing by now and if there is no major update pending from your side, I'm
going to merge it as is.

Thanks,

tglx

> -->8--
> diff --git a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
> b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
> index bef736f6ba2f..7b4a09d81a30 100644
> --- a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
> +++ b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
> @@ -2285,6 +2285,14 @@ static int mkdir_mondata_all(struct kernfs_node
> *parent_kn,
> */
> static void cbm_ensure_valid(u32 *_val, struct rdt_resource *r)
> {
> + /*
> + * Convert the u32 _val to an unsigned long required by all the bit
> + * operations within this function. No more than 32 bits of this
> + * converted value can be accessed because all bit operations are
> + * additionally provided with cbm_len that is initialized during
> + * hardware enumeration using five bits from the EAX register and
> + * thus never can exceed 32 bits.
> + */
> unsigned long *val = (unsigned long *)_val;
> unsigned int cbm_len = r->cache.cbm_len;
> unsigned long first_bit, zero_bit;

\
 
 \ /
  Last update: 2018-06-19 18:54    [W:0.073 / U:2.704 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site