Received: by 10.192.165.148 with SMTP id m20csp19442imm; Thu, 19 Apr 2018 12:12:16 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+UZtTobvo8GQE0dRwAJLyl5TCUNhrR3oL29z9rKzVK7ZQTea71gejw5vS8YuIx+B3glhLm X-Received: by 10.99.45.70 with SMTP id t67mr5997763pgt.439.1524165136234; Thu, 19 Apr 2018 12:12:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524165136; cv=none; d=google.com; s=arc-20160816; b=j5j5S6cTG8FRXkrUe5eG1LUZhmsC4OS8kP/xvuEaNiMJfBNpsmDqJC4Uf4fkCSrLkS 7l4qDfvf8W2r+aBY3NgrcrPdQKapRR4JdgRXhuCdqfL/hWTXLkiDXlZuCFPEoJ4jguB1 4d9hui6sOot0seULvudMP+kM0VpMjdqFKG2pcZQhhSed/vU2GcJudSNKcKs8V5GzlY5Q EmImkK2F6ObjJuCp4H7YpsIsteETvUGgT1mcI4LvX73n8nnGPedvEOqjQ4eb0r8IQdWE HBezn2whXoWYsg5cBGBs36UnObEV5KAqKlueAkdJ0MWKmyyz9NSsEC8yf0I+KGeITmJI 3Bkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=k5NiL7BlufbodjNg68z88Fj95M6/qpHK17Vxif8uR+U=; b=wU9bNnBa43mojggKF8l8wYu37mhCOYBJr4PyOlGuvPsXPirI3QzZKwVmy0b2EGGnR7 iVuBG6UX1HDjjoiNrSD8Cta1l9TCvz/ZHkmBWEYaySH7ISsJezqBGtPozUg7WOkSX0SU Z23S0OasxiiCoH84VEqVA3ho3fHUuXDMaWDF7eVOqbBh3HKSANzq97u32tU6kGXJv3HX aKphGu+kYpHRVBQAsAJbQthM0cA/tuoLWAb7d5ZHVQFhF3uGNp2Dqz2xTizdFeEIJt9U fsOz+gb1fdvmjvXWLyJlPCYNBWtVCNhtFftnVpD8M1Cmu9f/rn1j4gzUQ3SpIRUXAzCG Ohuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=HDc3FMI4; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z8-v6si3756376plk.194.2018.04.19.12.12.01; Thu, 19 Apr 2018 12:12:16 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=HDc3FMI4; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753428AbeDSTKx (ORCPT + 99 others); Thu, 19 Apr 2018 15:10:53 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:45800 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753117AbeDSTKv (ORCPT ); Thu, 19 Apr 2018 15:10:51 -0400 Received: by mail-wr0-f194.google.com with SMTP id u11-v6so16800261wri.12 for ; Thu, 19 Apr 2018 12:10:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=k5NiL7BlufbodjNg68z88Fj95M6/qpHK17Vxif8uR+U=; b=HDc3FMI4NEN3bQFQ6FJfuxH40ncoBtlnXaIMIL6TD4IFoLhG7Oxd1tceQ/fZ6X0o7G HxjMgqbJSOR+blEwOrn6h0N0p05Uj1UHqs8i+QSyEoLfDD/pABgL82IHp8R61yUEZxjp 95y5Qq2iY89eYjprfvlfqLtPfqxzumTcuBGZ1TzxU2WPIC3iKDK+3plstLsiYVHp8JtO KMO/BdIqjrdNucfPjOEr9ZWvyBuWTZyXSqZ5S1rPyLgzAM9SYW7eRbVwl2/dFFRYjV4t xsisGPBql0iMgfUdyEelYJtVtPwnoSMnDheQhoReyqMO82xYrtKgWq81Jo02MbM8IDdL mQtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=k5NiL7BlufbodjNg68z88Fj95M6/qpHK17Vxif8uR+U=; b=rnsJsE00VBK5rMC9YqXP/p38NZ0RJuRIbYznKZevT3vkBLS07AvnfYwsuYfHf8wGAi WUcpY5mOeCuL7h8BzmaJXqXelxELlHqZNPfvLw6Ae0aF0gk3nC+DkDNz4emHLb4zJcbU 75KGUOhDWVNXoaQB5S8I9//WgmvJUk4TV5xDsSnjf4mGX/+wKBFTTFxPbsqct0PHn7tI YK4J/qPGJl/rcFq0ahaZpHDjQl2E7JnBKwD2kRtAe1e/Hyh7Lh1SGmaIAtkeyVbRBrwp HfafHNCooqKIdO1sLUYK52HO5GLnrcEPhiC2+nNc1jZKQsCAavUD6dZRSg/ICXq+n7O5 bflA== X-Gm-Message-State: ALQs6tCWPrv/7kStsX/LQRd8FwZQbz6FfjU9+BQd1tsI6rv7cI4liKgm E3ooHaGS+SqSCdo3IcTD1/IkdhYC7yPCYlgXIfieFBlZ X-Received: by 2002:adf:c003:: with SMTP id z3-v6mr5564069wre.177.1524165050430; Thu, 19 Apr 2018 12:10:50 -0700 (PDT) MIME-Version: 1.0 References: <1521810690-2576-1-git-send-email-kan.liang@linux.intel.com> <1521810690-2576-2-git-send-email-kan.liang@linux.intel.com> In-Reply-To: <1521810690-2576-2-git-send-email-kan.liang@linux.intel.com> From: Stephane Eranian Date: Thu, 19 Apr 2018 19:10:39 +0000 Message-ID: Subject: Re: [RESEND PATCH 2/2] perf/x86/intel/uncore: Fix SBOX support for Broadwell CPUs To: "Liang, Kan" Cc: Peter Zijlstra , Thomas Gleixner , Ingo Molnar , LKML , Oskar Senft , mark@voidzero.net, Andi Kleen Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 23, 2018 at 6:12 AM Kan Liang wrote: > From: Oskar Senft > This fixes SBOX support for Broadwell CPUs by checking the Power Control > Unit CAPID4 register to determine the number of available SBOXes on the > particular CPU before trying to enable them. > Signed-off-by: Oskar Senft > Tested-by: Mark van Dijk > Reviewed-by: Kan Liang Could you please merge this change? Thanks. > --- > arch/x86/events/intel/uncore_snbep.c | 17 ++++++++++++++++- > 1 file changed, 16 insertions(+), 1 deletion(-) > diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c > index 47c6910..715eb14 100644 > --- a/arch/x86/events/intel/uncore_snbep.c > +++ b/arch/x86/events/intel/uncore_snbep.c > @@ -3060,6 +3060,8 @@ static struct event_constraint bdx_uncore_pcu_constraints[] = { > void bdx_uncore_cpu_init(void) > { > + int pkg = topology_phys_to_logical_pkg(0); > + > if (bdx_uncore_cbox.num_boxes > boot_cpu_data.x86_max_cores) > bdx_uncore_cbox.num_boxes = boot_cpu_data.x86_max_cores; > uncore_msr_uncores = bdx_msr_uncores; > @@ -3067,7 +3069,15 @@ void bdx_uncore_cpu_init(void) > /* BDX-DE doesn't have SBOX */ > if (boot_cpu_data.x86_model == 86) > uncore_msr_uncores[BDX_MSR_UNCORE_SBOX] = NULL; > - > + /* Detect systems with no SBOXes */ > + else if (uncore_extra_pci_dev[pkg].dev[HSWEP_PCI_PCU_3]) { > + u32 capid4; > + pci_read_config_dword( > + uncore_extra_pci_dev[pkg].dev[HSWEP_PCI_PCU_3], > + 0x94, &capid4); > + if (((capid4 >> 6) & 0x3) == 0) > + bdx_msr_uncores[BDX_MSR_UNCORE_SBOX] = NULL; > + } > hswep_uncore_pcu.constraints = bdx_uncore_pcu_constraints; > } > @@ -3285,6 +3295,11 @@ static const struct pci_device_id bdx_uncore_pci_ids[] = { > PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x6f46), > .driver_data = UNCORE_PCI_DEV_DATA(UNCORE_EXTRA_PCI_DEV, 2), > }, > + { /* PCU.3 (for Capability registers) */ > + PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x6fc0), > + .driver_data = UNCORE_PCI_DEV_DATA(UNCORE_EXTRA_PCI_DEV, > + HSWEP_PCI_PCU_3), > + }, > { /* end: all zeroes */ } > }; > -- > 2.4.11