Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp571480img; Mon, 18 Mar 2019 09:21:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqyTGnp7k7JCwYvTk39eWb6fVGVdTxCzKkMfHWtjBpLDeM4XkikmfdhUU4wB+F92AmZlWDd/ X-Received: by 2002:aa7:9090:: with SMTP id i16mr19492395pfa.85.1552926100303; Mon, 18 Mar 2019 09:21:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552926100; cv=none; d=google.com; s=arc-20160816; b=KbdanuVJNC+Y0Z7FjcThFa7HPXXtm1LN90O8NsXl9ZN9IiaLYUHf9qk7uopa9Zss7d Epar5GQ5CzTaC2g3+DsFkvTLR1AytpwcHeS3HF5TyaKRREsqwVabHeMKOGXMHeXQcCQ+ tw8e9m1Ol2WTdsM2gyMNBL7cY9WJ5wNDLTDoK4ZCV0mqmm5Q9MTiJCyA39/k/cb8g3pK t3bq77wb84WUYJgQYw6TmYS9GFqrS+xcMqhCh0YO1SfKI4Jm1TH87nYzT7ZhzIaZ8E46 Hi/5LP2qBwJlrMYnVjYTJgJWL6sJXWedZTWeDv5BOJpIjf3+YmdlxjZjG7iaa+ElJNJl uZCA== 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=MfwHR/Ws2oa7MwfBtsC3RRRpWmzCI7me652l+fI2Ieg=; b=XB5Tr0jrGmV1VPuk65jtC2xafyD29uw+Tuq9Eub8V665+7jmIo7MfQvGvmfe77UW70 RoYxVBpWdK3s20YskJu2GC/4DtkxEFWyIFgUNWzJcCXwtN3Gt0Kcm3IwJnIcb4bDu3QG y/xLaPPDnGd02sEDByW7SbZBiWKrUA/ZJTzAJhjNWPO/hNnX60CpdZ9KD+a9H7QtTOAF 3JgWQT+kOlOAMD20ajiqAHb6RoSVMHefLcfBVN7Ol0tsh2HlFg78dETko8ACop3mj8IV UwkxOe+CZko12LR758/8uBbN2VKG9hPPmgJ3e4HyN83gNLAoAiEYIfR8AbK1bnzl8RGR +wtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=c7EHo+5B; 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 be11si9306921plb.355.2019.03.18.09.21.24; Mon, 18 Mar 2019 09:21:40 -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=c7EHo+5B; 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 S1727594AbfCRQUY (ORCPT + 99 others); Mon, 18 Mar 2019 12:20:24 -0400 Received: from mail-eopbgr760054.outbound.protection.outlook.com ([40.107.76.54]:30678 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726788AbfCRQUX (ORCPT ); Mon, 18 Mar 2019 12:20:23 -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=MfwHR/Ws2oa7MwfBtsC3RRRpWmzCI7me652l+fI2Ieg=; b=c7EHo+5BFwq24U/AfFy4I+UPQRIYAeRqVb07FaxHC8M+XhFvAxVa/k35DNFsumNKzHcLpB7zIZ/G0WyYNcb0GcjYLB6a/xSpSuR0eam8t+D1T22SXX/1DpDSKBiHBLfjaYpodB1hsKPEAJBXbKVBoRtIfBPzEemu/lZV4sBVPII= Received: from DM6PR12MB3163.namprd12.prod.outlook.com (20.179.104.150) by DM6PR12MB2650.namprd12.prod.outlook.com (20.176.116.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1709.14; Mon, 18 Mar 2019 16:20:20 +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.015; Mon, 18 Mar 2019 16:20:20 +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 v2 1/2] x86/perf/amd: Resolve race condition when disabling PMC Thread-Topic: [RFC PATCH v2 1/2] x86/perf/amd: Resolve race condition when disabling PMC Thread-Index: AQHU229hNGOz+xaASEKkiW7L8jN5IKYRJYSAgABwj4A= Date: Mon, 18 Mar 2019 16:20:20 +0000 Message-ID: <3d176556-2424-39d1-1923-f0964ebf4e2d@amd.com> References: <155268244291.14761.3432013617741218607.stgit@tlendack-t1.amdoffice.net> <155268245032.14761.7748666703519081877.stgit@tlendack-t1.amdoffice.net> <20190318093725.GJ6058@hirez.programming.kicks-ass.net> In-Reply-To: <20190318093725.GJ6058@hirez.programming.kicks-ass.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: SN2PR01CA0037.prod.exchangelabs.com (2603:10b6:804:2::47) 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.78.1] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 0c1160a0-fdd7-4520-0866-08d6abbd9d7c 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:DM6PR12MB2650; x-ms-traffictypediagnostic: DM6PR12MB2650: x-microsoft-antispam-prvs: x-forefront-prvs: 098076C36C x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(39860400002)(366004)(376002)(136003)(396003)(346002)(189003)(199004)(4326008)(25786009)(5660300002)(71200400001)(71190400001)(6116002)(3846002)(316002)(36756003)(229853002)(54906003)(6486002)(256004)(486006)(66066001)(2616005)(476003)(11346002)(446003)(6512007)(26005)(7416002)(99286004)(14454004)(2906002)(8676002)(52116002)(53546011)(53936002)(6246003)(6916009)(186003)(76176011)(6506007)(386003)(478600001)(102836004)(305945005)(81166006)(31686004)(81156014)(106356001)(7736002)(8936002)(72206003)(105586002)(6436002)(31696002)(68736007)(86362001)(97736004);DIR:OUT;SFP:1101;SCL:1;SRVR:DM6PR12MB2650;H:DM6PR12MB3163.namprd12.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A: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: SVm14FQZZC3NStY2w1lqP5P7UaniCY7x8BN79EcYbGZAMPpXhdLslhm/LJpb+vKLfTlsk9VSZh+IooIUOfwYB9076csPWgdu2pvbfVktxLpmAyQzjGLSqqliMcEh4XM7mqIKEabMzQ88l0O3bmUig5SAjJcwqR2Ltdq9POta8Os2RDCfS44c49wlyku8IXv87LpkCDBK83hRmy6k2V2Ah5gdfqL2kjXvyWVQNb9Hu4ylHe2qCP7l28boUryd+XFQkwbHj3nx+DDvzVHMdSAhTC3H5LyxYV6s1Z6g1pVjdYVqBFiP3J5HF1Dgn78Lb6s1cReHzghag/VUuHivWwW6TL6hSg5bMNrmQSt4+2YEfzmTV70xp6W9pbPxP3vW+6XpeNpLAHqNFQ/TLIN3QsBCXol6n2tRolZK1it7B5B5wBE= Content-Type: text/plain; charset="utf-8" Content-ID: <76AC3778F04E874696632EDED77BE337@namprd12.prod.outlook.com> Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0c1160a0-fdd7-4520-0866-08d6abbd9d7c X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Mar 2019 16:20:20.3637 (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: DM6PR12MB2650 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org T24gMy8xOC8xOSA0OjM3IEFNLCBQZXRlciBaaWpsc3RyYSB3cm90ZToNCj4gT24gRnJpLCBNYXIg MTUsIDIwMTkgYXQgMDg6NDA6NTNQTSArMDAwMCwgTGVuZGFja3ksIFRob21hcyB3cm90ZToNCj4+ ICt2b2lkIGFtZF9wbXVfZGlzYWJsZV9hbGwodm9pZCkNCj4+ICt7DQo+PiArCXVuc2lnbmVkIGxv bmcgb3ZlcmZsb3dfY2hlY2tbQklUU19UT19MT05HUyhYODZfUE1DX0lEWF9NQVgpXTsNCj4+ICsJ c3RydWN0IGNwdV9od19ldmVudHMgKmNwdWMgPSB0aGlzX2NwdV9wdHIoJmNwdV9od19ldmVudHMp Ow0KPj4gKwlpbnQgaWR4Ow0KPj4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