Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3840310pxb; Tue, 17 Nov 2020 05:07:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJzHTOOoqQbcOicZDV8VE8tejL1aCor/x/Fq9TSCe1MrUc/LH8ybX8mlrKCno2qLr2XN2K0m X-Received: by 2002:adf:eb91:: with SMTP id t17mr24291436wrn.330.1605618475329; Tue, 17 Nov 2020 05:07:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605618475; cv=none; d=google.com; s=arc-20160816; b=zJKujQxW8wkLo0+EEM3EKP6qIxiqZsF0PHHxKLvNBj455l9qq3Qwh5CGT/y8T+Ev1j mi527mtvpt+y9AAj+aYeXiYiqIO0NcKwWEy1K5EmnanNRr+v93cCQ8osSVL4Lo4vJOtz /YTHZWg7GDEwhQHkZ3gDE5BFANQSFwz9L21a2oa1fGiDTNZmYW52lqzg/0m1Jn2yCV4X VaQRKiQVWuw7NcDv0IPz2gi0ty47ixXJrnVZDxKMsoGZfa9Bw7cAwT/v7znqqdfaNQCy ly/y5GiLwP8mnbPjKWeBiBoEo5JOnxj7Qrz/ylro3CjcIPO7kPc/2828U60pLR8ra0m7 Q7cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=kLpH8gAX8OqQiunXIJdVDq43/WFOxd2cISgg38mov+I=; b=o49HdsZqPLKzXiD/l2s4+Tz9ggxqVqQwVBbTtkOFzcrHwjhx0z0L+h/9rSzY7EgmpG 6DvnvIaJSc2sp7VamL7ghGZn6d4Ld29yJ3gnPe4+1tS5QVgwgsJ//BrMqpHpnfk4N3aw 4BCd10/TDqLRGTRRtZ/LkhPAbdDIpe7+7Lh7wpsDYTehWoiCq/c62YZ0dZ62lxRxJv+n 4m9WyX0DwF0KlsrQn0GZneVoa779s4zAfLAnAn5ztszIMT5q2v5CGtesJixXzyJaqSwS NjiaV/u/Qeyc4VAHtinCef1ulEArK/MGdeJqEahc28lNK5yHy9nC5MIbrjKAxmxwzYEP I1Tg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id co22si13637057edb.469.2020.11.17.05.07.30; Tue, 17 Nov 2020 05:07:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728360AbgKQNFp (ORCPT + 99 others); Tue, 17 Nov 2020 08:05:45 -0500 Received: from foss.arm.com ([217.140.110.172]:56224 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726035AbgKQNFo (ORCPT ); Tue, 17 Nov 2020 08:05:44 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2D843101E; Tue, 17 Nov 2020 05:05:44 -0800 (PST) Received: from [192.168.2.21] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D53A33F719; Tue, 17 Nov 2020 05:05:41 -0800 (PST) Subject: Re: [PATCH 00/24] x86/resctrl: Merge the CDP resources To: Reinette Chatre Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Fenghua Yu , Thomas Gleixner , Ingo Molnar , Borislav Petkov , shameerali.kolothum.thodi@huawei.com, Jamie Iles , D Scott Phillips OS References: <20201030161120.227225-1-james.morse@arm.com> <04fdd774-99e0-4b99-2d70-06cfd0ab3be6@intel.com> From: James Morse Message-ID: Date: Tue, 17 Nov 2020 13:05:39 +0000 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <04fdd774-99e0-4b99-2d70-06cfd0ab3be6@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Reinette, On 16/11/2020 17:54, Reinette Chatre wrote: > On 10/30/2020 9:10 AM, James Morse wrote: >> MPAM has an equivalent feature to CDP, but its a property of the CPU, >> not the cache. Resctrl needs to have x86's odd/even behaviour, as that >> its the ABI, but this isn't how the MPAM hardware works. It is entirely >> possible that an in-kernel user of MPAM would not be using CDP, whereas >> resctrl is. > The above seems to distinguish between "in-kernel user of MPAM" and resctrl (now obtaining > support for MPAM). Could you please provide more details on the "in-kernel user of MPAM" > and elaborate on how these two usages are expected to interact with MPAM concurrently? This is a badly phrased reference to all the bits of MPAM that are left on the floor after the resctrl support is plumbed up. Currently none of the software exists, but MPAM also has support for: virtualisation, the interrupt-controller (GIC) and the IO-MMU. None of these things are exposed via resctrl, so they either need new schema (which must also work for x86), or handling 'invisibly' in the kernel. Virtualisation is probably the easiest example: With MPAM, the guest may be 'using CDP' whereas the host is not, or vice-versa. The guest will never be allowed to access the MMIO configuration directly, it will be managed via the host's driver. Now the host's driver has to handle CDP-on and CDP-off configurations. Keeping the odd/even CDP stuff in resctrl means the arch-code/driver doesn't need to know or care about this stuff if the hardware doesn't. If the interrupt-controller or IO-MMU consume closid/rmid, then I'd describe them as in-kernel users (as the kernel owns their configuration). These would never use CDP as they don't fetch instructions. How do I envision these things working concurrently? (a) closid/rmid can be reserved before resctrl is mounted, or (b) allocated by user-space and handed back to the kernel (e.g. virtualisation). The ctrlval values move to belong to the arch-code/driver, so if 'something' changes the configuration behind resctrls back, the new schema values are immediately visible via the corresponding schema file in case (b). In case (a), resctrl would never look at those closid, but it wouldn't matter if it did. (the counter-example is mba_sc, which may need to convert the current ctrlval back to a mbps_val if its being managed by something other than resctrl) Thanks, James