Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2691349imm; Fri, 24 Aug 2018 03:48:05 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdbbhovbxsjc+stYEpBtg8+aVqA7/GQa8VVQOmjhYcI7OW/Ha4lqyfsptfsuTv+NHbgRQvRa X-Received: by 2002:a17:902:5998:: with SMTP id p24-v6mr1196469pli.36.1535107685541; Fri, 24 Aug 2018 03:48:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535107685; cv=none; d=google.com; s=arc-20160816; b=go5N2IdtElm+pW3v5KIaVeErAXek5xsV0MgZNCqCTIA7b6c0ABTpr6WTOpjkLwMtGv G7pR8UkVwAOQI0MWFfHDfXmV1C+fjEF3i32eJYtoTaOTNjUO/FlXPHdzjHPALDgnkait cbUjb/d1pSALlV7LIm6l5dpXxVQcUnsWWpLJiaap2D2CoOW9zDTMxHbWIyMbTdULu0NV fTqy1STIcxBcQKmRWGJkdcjEKIbUWzw7ogKgIeVhppKMZRSWPsMhf5MeC0iPTZLJ0nEO nh8EX/UQwWYVQRkk2un5TQvvalWfPYAz0ehAUY9mq7tiSUYLcUw8wPHdnrhJkGPuD4t2 yqwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=jvj8rs3jACzUNPr0ia5SIgGwl3Jtw/rKSdED9yqiH0w=; b=hMNurXvcQWaRtxwYYk3ZrEXM2zqTf5KWgj1QL1ShL/jDIljjcHGoARVHZIzu/9Y7ke j56SMVUQisUBBQyeanV0vVmYQsa2n2voUi7PEXbhvFjm4nnp26+Rw8eCzuSydebXJ2UW 7S8NMYts9eJvg0tsKoIZbjwdm5LdBRcEUoEvgyHBR48iQjoAd9KQ+MvA/3jbG0lDu+AL iZE/13YVGUJDQRaMBTX75NR3s13ABeN7InX+77uLt7GQnqUKQ1qbUzowCbZIURhqIB4Y 2Ra4hGy/f2IxHbp1u8VywikTGhejXFudnKo2X3BgwlDnmOcwoKWf1MnQ5LFE15uMK53x sgTg== 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 r69-v6si7156739pfl.260.2018.08.24.03.47.50; Fri, 24 Aug 2018 03:48:05 -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 S1727941AbeHXOUc (ORCPT + 99 others); Fri, 24 Aug 2018 10:20:32 -0400 Received: from foss.arm.com ([217.140.101.70]:55598 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726330AbeHXOUb (ORCPT ); Fri, 24 Aug 2018 10:20:31 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 28D5F1688; Fri, 24 Aug 2018 03:46:27 -0700 (PDT) Received: from melchizedek.Emea.Arm.com (melchizedek.emea.arm.com [10.4.12.81]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 80CA43F5A0; Fri, 24 Aug 2018 03:46:25 -0700 (PDT) From: James Morse To: linux-kernel@vger.kernel.org Cc: x86@kernel.org, Thomas Gleixner , Fenghua Yu , Tony Luck , Ingo Molnar , H Peter Anvin , Reinette Chatre , Vikas Shivappa Subject: [RFC PATCH 13/20] x86/intel_rdt: Allow different CODE/DATA configurations to be staged Date: Fri, 24 Aug 2018 11:45:12 +0100 Message-Id: <20180824104519.11203-14-james.morse@arm.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180824104519.11203-1-james.morse@arm.com> References: <20180824104519.11203-1-james.morse@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that the staged configuration holds its CDP type and hardware closid, allow resctrl to stage more than configuration at a time for a single resource. To detect the same schema being specified twice when the schemata file is written, the same slot in the staged_configuration array must be used for each schema. Use the cdp_type enum directly as an index. Signed-off-by: James Morse --- arch/x86/kernel/cpu/intel_rdt_ctrlmondata.c | 4 ++-- include/linux/resctrl.h | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/cpu/intel_rdt_ctrlmondata.c b/arch/x86/kernel/cpu/intel_rdt_ctrlmondata.c index 05c14d9f797c..f80a838cc36d 100644 --- a/arch/x86/kernel/cpu/intel_rdt_ctrlmondata.c +++ b/arch/x86/kernel/cpu/intel_rdt_ctrlmondata.c @@ -78,7 +78,7 @@ int parse_bw(char *buf, struct rdt_resource *r, struct rdt_domain *d, enum resctrl_conf_type t, u32 closid) { unsigned long data; - struct resctrl_staged_config *cfg = &d->staged_config[0]; + struct resctrl_staged_config *cfg = &d->staged_config[t]; if (cfg->have_new_ctrl) { rdt_last_cmd_printf("duplicate domain %d\n", d->id); @@ -144,7 +144,7 @@ int parse_cbm(char *buf, struct rdt_resource *r, struct rdt_domain *d, enum resctrl_conf_type t, u32 closid) { unsigned long data; - struct resctrl_staged_config *cfg = &d->staged_config[0]; + struct resctrl_staged_config *cfg = &d->staged_config[t]; if (cfg->have_new_ctrl) { rdt_last_cmd_printf("duplicate domain %d\n", d->id); diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h index dad266f9b0fe..ede5c40756b4 100644 --- a/include/linux/resctrl.h +++ b/include/linux/resctrl.h @@ -12,6 +12,8 @@ enum resctrl_conf_type { CDP_CODE, CDP_DATA, }; +#define NUM_CDP_TYPES CDP_DATA + 1 + /** * struct resctrl_staged_config - parsed configuration to be applied @@ -39,7 +41,7 @@ struct rdt_domain { int id; struct cpumask cpu_mask; - struct resctrl_staged_config staged_config[1]; + struct resctrl_staged_config staged_config[NUM_CDP_TYPES]; }; /** -- 2.18.0