Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp5408650imm; Tue, 19 Jun 2018 09:55:18 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIMDBf5MGTXogR0na8atClrdtRDaPMmnwXMmFu+H4Rb8mDR2UQkAtv3mJSQQEK/PJ3CgE6m X-Received: by 2002:a17:902:7581:: with SMTP id j1-v6mr19804367pll.218.1529427318105; Tue, 19 Jun 2018 09:55:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529427318; cv=none; d=google.com; s=arc-20160816; b=buYtfoOuHUfkZdk5yb7o2OKF53REvM2haBHBe/vHf2oXGwrSJdznsWRqyrmtOYSvM6 eTqXEU3rU1iaal8YXMR8BzmWXvRrPp9pgZOyhjyfWw1SgpTLd2kVdsJchWOvq1unK00S TBjL043cJ0J4M9ck5lA1XyNGd0OOuuK8ZFbZae/XxyvQWPybcadU0B4fEsZ2NAQmvbF9 C5Y4cPWfCMth1qVInQU9HDW1IS5hYkRZuBIKAMPss2mTvTo4b4yy4AVBguYCFD9tnzcT EUIrGfrpaxdtPbSDdaokvkQkz/2Nex0cuw8ab978S3F/HynNlEVomVEYygtBsqaCEyEV K38w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=i2snKoL7ENU37Hca9ZGJMZ2cI6MHHPRyrOdhJC4IgbY=; b=hH+q8Z/kFc5UL3aUrxSsZhXxVZJoMh9ngzcRwrQtPMRVfgTUlDCy3+HAbnYXxnfk5K PSnSNG00VGRR0Ur7iz6lRZ4L8FKbIDW/LBo3zxmJ8DaQgksCqL/U8OsikFhv2NlsfDYh ThQPOBMmLlDXpC8QRwAGuQuCRMcki1nd68qU5CUEK1+itpYMPjnBj6AI8Ykhv+HEaNMR 9GXyFuZwzODyRVkfCOfLSWuyBMdlxLzAU7hjw+FnHxmVkEXpcSo1osK48BKbRY068N1b EvBHhXsbL5b2rDr6iQrNSKzz6H1ZmZrzTn6n0Dra5nDUQWNZG+d7veFzecJ4pAkUBu6k 9PzQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r59-v6si110706plb.187.2018.06.19.09.55.03; Tue, 19 Jun 2018 09:55:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966739AbeFSQyZ (ORCPT + 99 others); Tue, 19 Jun 2018 12:54:25 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:57727 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966510AbeFSQyY (ORCPT ); Tue, 19 Jun 2018 12:54:24 -0400 Received: from p4fea482e.dip0.t-ipconnect.de ([79.234.72.46] helo=nanos.glx-home) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fVJt2-0000pO-F0; Tue, 19 Jun 2018 18:53:44 +0200 Date: Tue, 19 Jun 2018 18:53:44 +0200 (CEST) From: Thomas Gleixner To: Reinette Chatre cc: fenghua.yu@intel.com, tony.luck@intel.com, vikas.shivappa@linux.intel.com, gavin.hindman@intel.com, jithu.joseph@intel.com, dave.hansen@intel.com, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH V6 07/38] x86/intel_rdt: Initialize new resource group with sane defaults In-Reply-To: Message-ID: References: <68030110df15615d95731fd354ff7adfb0476d37.1527593970.git.reinette.chatre@intel.com> <44af4ecef879e88ec1b74c5decbf5dccaf998866.1528405422.git.reinette.chatre@intel.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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;