Received: by 10.213.65.68 with SMTP id h4csp3859151imn; Tue, 3 Apr 2018 11:55:38 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+UR2FpxSn7io3QLuPP3GRR6srKt8it4HqQcGcmve6mMZzjuyturc6m0X/4tU6JeKGfRV5S X-Received: by 2002:a17:902:968a:: with SMTP id n10-v6mr15059863plp.362.1522781738430; Tue, 03 Apr 2018 11:55:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522781738; cv=none; d=google.com; s=arc-20160816; b=zjSLi56xIAVM40FQZHG2XTms0mmiB4w4GMGeYdlRwRnQaXMOY/1nHD1in5oXmfsJNK NOUNKsoCbgOx3KKgLDZt/56+LmA+KN3oALoD8flMQK7iUxBumjNTpN9nZMdfsVlFA89I yZIM4n8JfkaLP8bliHJ0m8bY9i/qSb8ZDctCYprpyLoMRNCYTigkdExVqk3gKV4R60ws 37YwIqDgrxNpJJK4t1W+UljDxiP19axx948GgY1PUfH+fVzsRc7+Z+1Hk0Yp3h+Swz0A 9sQR21F27oLFN/pAxVHBTgv8WfkXbz8y72LUzKC1rj5NNGc11Yp0G7mTv6fedOwiW3HL JKjA== 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=j2JKsPkQmF0vgVKd808db93Sbadr4O0p0ss3ojojXqs=; b=XUttVWfTdN/M7G/Y6jUI30qxMjikr656P6OrtfRuHZhy21aVYeRDxjkKxa2q9XD9Vh 8PvqBe1XstxmhyP1g7HcbsAo6VkUn6h7sA1g4zOYnCglYp+YRFI7U6o6lqeqnZY3jGmi JO1KDHDB4C+Tf2j4Cp9MJBXHk7ZaLERvcGLRzlnc0FiCeXuaga8J+Shvib7P6GsfSABP gtJUGYpnBh1KRk4z4fgneDH7Wg+nQbX+jimGSky/tYzgjaJkd9usDZWZWIpPKlXkzT/u 79SHaeFtWZd6kVusNfHOTM14OSFLzu6JB6rhjetX3jTOqeQdAzgYPKwsMZMrasjWuUjZ Chvw== 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 u2-v6si3600014plm.671.2018.04.03.11.55.24; Tue, 03 Apr 2018 11:55:38 -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 S1752845AbeDCSyT (ORCPT + 99 others); Tue, 3 Apr 2018 14:54:19 -0400 Received: from mga17.intel.com ([192.55.52.151]:21204 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752117AbeDCSyS (ORCPT ); Tue, 3 Apr 2018 14:54:18 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Apr 2018 11:54:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,402,1517904000"; d="scan'208";a="29264352" Received: from vshiva-udesk.sc.intel.com (HELO vshiva-Udesk) ([10.3.52.52]) by fmsmga007.fm.intel.com with ESMTP; 03 Apr 2018 11:54:17 -0700 Date: Tue, 3 Apr 2018 11:51:18 -0700 (PDT) From: Shivappa Vikas X-X-Sender: vikas@vshiva-Udesk To: Thomas Gleixner cc: Vikas Shivappa , vikas.shivappa@intel.com, tony.luck@intel.com, ravi.v.shankar@intel.com, fenghua.yu@intel.com, sai.praneeth.prakhya@intel.com, x86@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org, ak@linux.intel.com Subject: Re: [PATCH 3/6] x86/intel_rdt/mba_sc: Add initialization support In-Reply-To: Message-ID: References: <1522362376-3505-1-git-send-email-vikas.shivappa@linux.intel.com> <1522362376-3505-4-git-send-email-vikas.shivappa@linux.intel.com> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 3 Apr 2018, Thomas Gleixner wrote: > On Thu, 29 Mar 2018, Vikas Shivappa wrote: >> +void setup_ctrlval(struct rdt_resource *r, u32 *dc, u32 *dm) >> +{ >> + int i; >> + >> + /* >> + * Initialize the Control MSRs to having no control. >> + * For Cache Allocation: Set all bits in cbm >> + * For Memory Allocation: Set b/w requested to 100% >> + * and the b/w in MB to U32_MAX >> + */ >> + for (i = 0; i < r->num_closid; i++, dc++, dm++) { >> + *dc = r->membw.bw_byte ? MBA_BW_MAX_MB : r->default_ctrl; >> + *dm = r->default_ctrl; > > No! Please stop duct taping your stuff into the existing code. So far the > ctrl value was the same as the value which was actually written into the > MSR. With your new mode you have to split that up into the user supplied > value and the value which gets written into the MSR. > > So the right thing to do is to separate the user value and the MSR value > first and independent of the mode. Then the new mode falls into place > naturally because r->default_ctrl and r->default_msrval are set up at mount > time with the values which correspond to the mount mode. will fix. I tried both and this implementation assumes what user modifies is the control values (because then schemata read and write is easy as user does it directly) but agree we can change that. Thanks, Vikas > > Thanks, > > tglx >