Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1007490imu; Tue, 11 Dec 2018 11:04:08 -0800 (PST) X-Google-Smtp-Source: AFSGD/VNq8N5rtSHshG4SbelZo776FkXh/eTElm2KIUAwNTsxjsUNTJhuKbNurL0hc2ze4katyHG X-Received: by 2002:a17:902:7d90:: with SMTP id a16mr16335750plm.249.1544555048762; Tue, 11 Dec 2018 11:04:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544555048; cv=none; d=google.com; s=arc-20160816; b=P8Jf5k8wia0eyqCgm2GVeII4Nd74qJ7AA6DCEwWP5kJh5hpANVsITqALD5rO4OUPFB N3QGgfpxu5pNzim+oIHC/xDwUyeAt4q67XFceU6RVVoPaFosPhP2muvES6V19mcRpDo7 PdvPwJ+XPtEd+AXpX3XDD8IjYEE0J81rbO3ay215/v4S73XuxrAIkzWhTIDXTpDyNyn6 XTWhJIrYgLXgC+47CqQJHk7Hf6BqPukX5NQLvnevQOkWGPob10U5lwr779sPcfFzsXsi fmBJCxmWzj8MYMHuFFBonQS7ru6msQsAf+OG9YaIt/Yn8yIeWXx2ZVs7nPvMFmGMDJcs jr/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=5ncEn2XcVqeF/lnB/eR9/Xi6hTbBlqSlcvlZ6OxxR6o=; b=RdlQcGXz1dsLd9b27iQ2epaY5Wyee2vNai37jsCIOG+ltDWS6ni6KPKiXknhqO/T2z qnH2WP5zJXrhkhqYabHGnUN9i5902SzeQXKBXI2jmhBsNlG0e6bb3GDeaTlDXzd7CquT m5DHZguvAaj+d/0XZmVtxWAOCGW2vMBqVtDnjE8SwqCLL0d+8ob6t0xYV7s1K8/QJLhC GFiIrUDWc/DpX8byoNBivkLSUWwOdZhUqFcsKijXohb0Ul1IZjyS2H76ku5/XVvDck2C FxWo44yos7dSM+otRjCCFLBqKJSvzStxbSDK0pM9KOrkD7Prrt2nnM4ZuUzJNXyIhFwu gGxg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q18si12920088pls.30.2018.12.11.11.03.53; Tue, 11 Dec 2018 11:04:08 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726870AbeLKTCJ (ORCPT + 99 others); Tue, 11 Dec 2018 14:02:09 -0500 Received: from mga01.intel.com ([192.55.52.88]:14986 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726329AbeLKTCJ (ORCPT ); Tue, 11 Dec 2018 14:02:09 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Dec 2018 11:02:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,343,1539673200"; d="scan'208";a="97952655" Received: from rchatre-mobl.amr.corp.intel.com (HELO [10.24.14.157]) ([10.24.14.157]) by orsmga007.jf.intel.com with ESMTP; 11 Dec 2018 11:02:08 -0800 Subject: Re: [PATCH V2] x86/intel_rdt: Ensure usage of CPUs are locked while needed To: Borislav Petkov Cc: tglx@linutronix.de, fenghua.yu@intel.com, tony.luck@intel.com, gavin.hindman@intel.com, jithu.joseph@intel.com, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org References: <20181211123404.GC27375@zn.tnic> <20181211185059.GP27375@zn.tnic> From: Reinette Chatre Message-ID: Date: Tue, 11 Dec 2018 11:02:08 -0800 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20181211185059.GP27375@zn.tnic> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Boris, On 12/11/2018 10:50 AM, Borislav Petkov wrote: > On Tue, Dec 11, 2018 at 10:33:59AM -0800, Reinette Chatre wrote: >> I am not sure that this is an issue when updating a schemata in the >> general case. In the case when just CAT schemata (without >> pseudo-locking) is updated then the cpu mask associated with the cache >> instance is indeed used to determine which CPUs should have their >> registers changed but only the current CPU is not checked for being >> online, for the other CPUs smp_call_function_many() is used that >> includes an online check. > > Well, in your fix rdtgroup_schemata_write() disables hotplug for its > whole duration and doesn't look at what schemata update is being done, > right? Correct. I just wanted to emphasize that it is not the schemata writing that needs to be protected, but instead the pseudo-locking code that runs after schemata programming that needs to run on a particular CPU. The new patch subject could be interpreted to mean the former ... but that is starting to sound like nitpicking by me. >> I had the same question in V1's notes to the maintainer :) > > Whoops, and I read that... Sorry. :-\ Not a problem at all :) >> My initial concern was the lack of IS_ERR checking. Understanding the >> flow better now it seems to me that this is indeed not a bug now. The >> reasoning is that an ERR_PTR is only returned when a negative id is >> provided in the parameters to rdt_find_domain(). There are currently >> only two places where a negative id could be provided to >> rdt_find_domain(), domain_add_cpu() and domain_remove_cpu(), and both >> locations test the return value using IS_ERR. > > Right. I'll queue it for the normal merge window. Thank you very much. Reinette