Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp5123268imm; Tue, 19 Jun 2018 05:32:21 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKtKftuX4lfiFiVqnkpXuzvHvJZNaFafdmsXI94uF6Z8jO8NNsrh/Qf5Boejx0lG+t90Fqh X-Received: by 2002:a63:a902:: with SMTP id u2-v6mr14635624pge.67.1529411541886; Tue, 19 Jun 2018 05:32:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529411541; cv=none; d=google.com; s=arc-20160816; b=BHj6fVfZvomSrRG7atHVQiYMx4tnfd+C/eS/JNvaXvXT4F0faCUwlkhqYthbiYsdUz D/refgC8mVJrzlczVw5yWyK6GSVdOyI6KDGNQldj4eHaNYTbmMvwUc/z4ttIfjjp+JFI GcTKu0Sj024QWWbsHypk9ot6cMQeEZvCIM+T8RbDOZ6l83CE12034aUwVdV33wPA//cj Z0go147BCkusSkLQh+b0d9O0/ihTr+xtHE24+d/Rx4V2wqp3/5OlIb0UUVhtTn12Dequ z4mOtih9B2tiMIczUK/LcYf7wbuxLnBellvRJzxMaPLWc3cCSuq+dK0FSc4R4+mzd4qq jx3g== 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=sLuPKP9ufP7Co0vVAkDfeCXL9w8VXSzDsCx2DaRdAIg=; b=Pggtyw2/csVP3423Woz2fIYgvtX8DCsAn0iWMYU+UL/mgnV0dtKmUxM5PoFyCSM47I 0ypC96hudesaTD62S7ksusbMKz1Pkz2vFH2on9Vus4GZeypH7xJvQFK4/lZ11udOrfuh YLn1CJJNHgJiopDE8yT7GSJf4GN698vBTY0oAk3kNZPV0Dni/nRDkCKFAVosDdKx+2GG OYY8OhIPXOq+ViBkIi3Zuz2S+XlEZ5QHguGFfF/XMz8ToUWMrQebNQmA/uwzFltgMkqg S31OEH+6tukDUrYrAhR7EP5xI8wfvotMw5EjmOTopWkxhBzP/aSwRPIrC+w28/UF8Lk+ YF6Q== 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 c14-v6si13926597pgw.478.2018.06.19.05.32.07; Tue, 19 Jun 2018 05:32:21 -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 S1757197AbeFSMbU (ORCPT + 99 others); Tue, 19 Jun 2018 08:31:20 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:57006 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756675AbeFSMbT (ORCPT ); Tue, 19 Jun 2018 08:31:19 -0400 Received: from hsi-kbw-5-158-153-52.hsi19.kabel-badenwuerttemberg.de ([5.158.153.52] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fVFmu-0004xH-1n; Tue, 19 Jun 2018 14:31:08 +0200 Date: Tue, 19 Jun 2018 14:31:07 +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: <44af4ecef879e88ec1b74c5decbf5dccaf998866.1528405422.git.reinette.chatre@intel.com> 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 7 Jun 2018, Reinette Chatre wrote: > +/** > + * cbm_ensure_valid - Enforce validity on provided CBM > + * @_val: Candidate CBM > + * @r: RDT resource to which the CBM belongs > + * > + * The provided CBM represents all cache portions available for use. This > + * may be represented by a bitmap that does not consist of contiguous ones > + * and thus be an invalid CBM. > + * Here the provided CBM is forced to be a valid CBM by only considering > + * the first set of contiguous bits as valid and clearing all bits. > + * The intention here is to provide a valid default CBM with which a new > + * resource group is initialized. The user can follow this with a > + * modification to the CBM if the default does not satisfy the > + * requirements. > + */ > +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. Thanks, tglx