From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 19DDFC4161D for ; Tue, 20 Nov 2018 12:06:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6DC6620831 for ; Tue, 20 Nov 2018 12:05:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alien8.de header.i=@alien8.de header.b="eJnqoDxZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6DC6620831 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=alien8.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728855AbeKTWeT (ORCPT ); Tue, 20 Nov 2018 17:34:19 -0500 Received: from mail.skyhub.de ([5.9.137.197]:33966 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727950AbeKTWeS (ORCPT ); Tue, 20 Nov 2018 17:34:18 -0500 Received: from zn.tnic (p200300EC2BCDE000F95221CD056129B8.dip0.t-ipconnect.de [IPv6:2003:ec:2bcd:e000:f952:21cd:561:29b8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id B43141EC0319; Tue, 20 Nov 2018 13:05:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1542715528; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=fmc8fmk0DAUUUCgwGXKxLH70Qcn+pzFzqewsbPZK5dc=; b=eJnqoDxZazHipYa6SRKWn7qH1f9OYWZUFvJEN+nQo3rR7FVuuAnirDyXs0HVi1T41ERwux 9U5joho020JsfFIxc8gQToVwotqiU/caCG28i0JhpKG9bJzCg3x34RtUjR8DY/3Uv9Sttb VCeho3COUSrgON+Na4scbC3Nb1voeTk= Date: Tue, 20 Nov 2018 13:05:20 +0100 From: Borislav Petkov To: "Moger, Babu" Cc: "tglx@linutronix.de" , "mingo@redhat.com" , "corbet@lwn.net" , "fenghua.yu@intel.com" , "reinette.chatre@intel.com" , "peterz@infradead.org" , "gregkh@linuxfoundation.org" , "davem@davemloft.net" , "akpm@linux-foundation.org" , "hpa@zytor.com" , "x86@kernel.org" , "mchehab+samsung@kernel.org" , "arnd@arndb.de" , "kstewart@linuxfoundation.org" , "pombredanne@nexb.com" , "rafael@kernel.org" , "kirill.shutemov@linux.intel.com" , "tony.luck@intel.com" , "qianyue.zj@alibaba-inc.com" , "xiaochen.shen@intel.com" , "pbonzini@redhat.com" , "Singh, Brijesh" , "Hurwitz, Sherry" , "dwmw2@infradead.org" , "Lendacky, Thomas" , "luto@kernel.org" , "joro@8bytes.org" , "jannh@google.com" , "vkuznets@redhat.com" , "rian@alum.mit.edu" , "jpoimboe@redhat.com" , "linux-kernel@vger.kernel.org" , "linux-doc@vger.kernel.org" Subject: Re: [PATCH v8 06/13] arch/resctrl: Initialize the resource functions that are different Message-ID: <20181120120519.GE2527@zn.tnic> References: <20181116205407.10457-1-babu.moger@amd.com> <20181116205407.10457-7-babu.moger@amd.com> <20181120095918.GD2527@zn.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20181120095918.GD2527@zn.tnic> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 20, 2018 at 10:59:18AM +0100, Borislav Petkov wrote: > So I'm wondering: instead of having mba_wrmsr_intel() and > mba_wrmsr_amd() and adding those per-vendor initialization functions, > why don't you push down the vendor differentiation into mba_wrmsr()? > > Then in that function you do > > if (vendor == X86_VENDOR_INTEL) > __mba_wrmsr_intel(); > else if (vendor == X86_VENDOR_AMD) > __mba_wrmsr_amd(); > > and so on and then you don't have to do any of that initialization dance > here and the struct rdt_resource assignment for the MBA will remain > nicely similar to the other ones... > > Hmmm? Yeah, after having look at the patchset further, that might not be a good idea as you need to assign more per-vendor stuff than just an MSR accessor function... -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.