Received: by 2002:ac0:a874:0:0:0:0:0 with SMTP id c49csp561114ima; Fri, 15 Mar 2019 08:53:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqxi/XCQBq0/1JZIekd6EeTjHsrdOPQObKW7zFlUwK7txlsHNwkexa5cxXreTzLdIKcj5h8b X-Received: by 2002:a17:902:681:: with SMTP id 1mr4950383plh.185.1552665209725; Fri, 15 Mar 2019 08:53:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552665209; cv=none; d=google.com; s=arc-20160816; b=YMzpj7PgC72k1GUik2DBKHr3eTWmc/9JNqY61U4zSlnnAci9PyMMoFz4sAr10JAkD9 tvh8hc3HjJc3Mgdi++XFtfIFqCiwvU4emY1V0GPTXdTbpdEg6HEKaF4jvpVNo3PQglHr Sh5AqWXyarSLhFWz3aW1H1RkINk3q2ZctsoRDZlsoocDc9Eq11S1eJSmpZ6wbiwB9WNu RaVmczIUFmEOnbfR0EQ1GKAuXJLPDrAKQ6LI58MwrihLCmoExTJYywXTBIDcXgyX5HL3 xQ0H70ocmsyl4DTlXq+RAAm76dphSMCdyAvDQhCbBRC+zl4eUhFwjdG8fgufcRezC7sd 5Mmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-id:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :dkim-signature; bh=1kOZ9zjymdiQ6OzSKNCr44jeY6C+Kn2aCf9rN7QiWps=; b=wvu0z9giXbXZ+C6/zXtk+mn6qPva/Ws6DNsyx1IHCBH3wDOibf0AAoRhqPDd0S8SbE B2ZUxORabl3zh8czyEuiylsv1Mf/EKIeui3rvp8abZwUqTDWlyKeK4Na3TQ1b31wvtFw cBY1T6fd6wJXE01H/JO3BXQlHECEeG1nr6vsiu4KpJon/+JqUPYG+/yLz5wsh8SwilSQ 1rz20l9uEF9116rGYntx52VXr9de2n6+EcbzVHKSmsapRUPQJOm365myHNeqJvZnXxYb 9niDKr3pBC/oUebE2rZLAVYIdAcYoUFr85VJuu7UbuFOhsksooHC8eFbuWMeQbEqk5PM 1HMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=RhAc0MJg; 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 z11si2067347pgu.306.2019.03.15.08.53.14; Fri, 15 Mar 2019 08:53:29 -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=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=RhAc0MJg; 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 S1729398AbfCOPux (ORCPT + 99 others); Fri, 15 Mar 2019 11:50:53 -0400 Received: from mail-eopbgr810055.outbound.protection.outlook.com ([40.107.81.55]:18419 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726792AbfCOPux (ORCPT ); Fri, 15 Mar 2019 11:50:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1kOZ9zjymdiQ6OzSKNCr44jeY6C+Kn2aCf9rN7QiWps=; b=RhAc0MJgKfSQ0WemYYVbECtve4/FcIHl7ubCkm0xG6yEmk721WwH+olLYJWxmBNrNMuyPjfrMw3s3zGxmBnj5/Ht7ATCKYtl3zDNuB3SVZ5QX2Mu/wxeLXyEjrkPWbM1FKUr5H66kn7NV0XORFEvYl6LGPFL33R/+P7DX0UAEFg= Received: from DM6PR12MB3163.namprd12.prod.outlook.com (20.179.104.150) by DM6PR12MB3290.namprd12.prod.outlook.com (20.179.106.78) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1709.14; Fri, 15 Mar 2019 15:50:00 +0000 Received: from DM6PR12MB3163.namprd12.prod.outlook.com ([fe80::a8aa:c9af:1f69:2a89]) by DM6PR12MB3163.namprd12.prod.outlook.com ([fe80::a8aa:c9af:1f69:2a89%6]) with mapi id 15.20.1709.011; Fri, 15 Mar 2019 15:50:00 +0000 From: "Lendacky, Thomas" To: Peter Zijlstra CC: "x86@kernel.org" , "linux-kernel@vger.kernel.org" , Arnaldo Carvalho de Melo , Alexander Shishkin , Ingo Molnar , Borislav Petkov , Namhyung Kim , Thomas Gleixner , Jiri Olsa Subject: Re: [RFC PATCH 2/2] x86/perf/amd: Resolve NMI latency issues when multiple PMCs are active Thread-Topic: [RFC PATCH 2/2] x86/perf/amd: Resolve NMI latency issues when multiple PMCs are active Thread-Index: AQHU2CpOuC8N+vFHqESTwWx3yJMr4aYMncqAgAAtDoCAAAd0gIAACteA Date: Fri, 15 Mar 2019 15:50:00 +0000 Message-ID: <40b3c397-0d21-b8e2-c80f-14e3fe850cb2@amd.com> References: <155232291547.21417.2499429555505085131.stgit@tlendack-t1.amdoffice.net> <155232292961.21417.3665243457569518550.stgit@tlendack-t1.amdoffice.net> <20190315120311.GX5996@hirez.programming.kicks-ass.net> <20190315151107.GG6058@hirez.programming.kicks-ass.net> In-Reply-To: <20190315151107.GG6058@hirez.programming.kicks-ass.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: SN6PR15CA0009.namprd15.prod.outlook.com (2603:10b6:805:16::22) To DM6PR12MB3163.namprd12.prod.outlook.com (2603:10b6:5:182::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Thomas.Lendacky@amd.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [165.204.84.11] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 79ad5b41-3a4c-4daa-3207-08d6a95de1c4 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020);SRVR:DM6PR12MB3290; x-ms-traffictypediagnostic: DM6PR12MB3290: x-microsoft-antispam-prvs: x-forefront-prvs: 09778E995A x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(396003)(346002)(376002)(366004)(136003)(39860400002)(54094003)(52314003)(199004)(189003)(6506007)(105586002)(186003)(102836004)(54906003)(386003)(36756003)(76176011)(8676002)(81166006)(2906002)(6916009)(93886005)(3846002)(6116002)(53546011)(81156014)(31686004)(106356001)(97736004)(52116002)(316002)(26005)(6512007)(229853002)(6486002)(6436002)(53936002)(6246003)(99286004)(68736007)(4326008)(14444005)(256004)(71200400001)(71190400001)(72206003)(7736002)(476003)(8936002)(5660300002)(7416002)(11346002)(14454004)(25786009)(2616005)(305945005)(66066001)(86362001)(31696002)(486006)(446003)(478600001);DIR:OUT;SFP:1101;SCL:1;SRVR:DM6PR12MB3290;H:DM6PR12MB3163.namprd12.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: amd.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 2ZfJMeZos7RjuDPNju5BlEjXeeXfxRPXiAQzT4C9zDcIJIgWMSEWmRf3Ma3ScCPsOCQ3ONfto3pYlIlZIudJwJPzf1BddcOvRkngSIMINlXLhNn/3PQsNSGjzuQwVh8bj1Nhh96Dah3cyS4fbqstth/VZHgMaoYosR0g0eftMMaaY4VKNROmYB7yVXxxWqfKrpxk4v24tSFlgG3H7K4YUealTs2k6QrMdM88/I4RSJAEOthQhIjs6gobBwFruWK4v88LLRGsKkiU/2rUgBjwmoGA8Xm4kWEszo8ZkyW/KbsZ0MMRuJ6pmEmeGto5zODeMjezIhP89INXR9HrLIO4w3eoYdn6KtRMGKXiCaWOOlSYlpnN+aL+btldNMt1jih5dVi1TaR/Y7wGjtIK4ow3Yvqlkuk2YN5nyJulEVTN95U= Content-Type: text/plain; charset="utf-8" Content-ID: <513F48CAA384A149A1FEA9CD5971FCD9@namprd12.prod.outlook.com> Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 79ad5b41-3a4c-4daa-3207-08d6a95de1c4 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Mar 2019 15:50:00.7900 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3290 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org T24gMy8xNS8xOSAxMDoxMSBBTSwgUGV0ZXIgWmlqbHN0cmEgd3JvdGU6DQo+IE9uIEZyaSwgTWFy IDE1LCAyMDE5IGF0IDAyOjQ0OjMyUE0gKzAwMDAsIExlbmRhY2t5LCBUaG9tYXMgd3JvdGU6DQo+ IA0KPj4+PiBAQCAtNjg5LDYgKzczMSw3IEBAIHN0YXRpYyBfX2luaXRjb25zdCBjb25zdCBzdHJ1 Y3QgeDg2X3BtdSBhbWRfcG11ID0gew0KPj4+PiAgICANCj4+Pj4gICAgCS5hbWRfbmJfY29uc3Ry YWludHMJPSAxLA0KPj4+PiAgICAJ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