Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp48690pxu; Mon, 5 Oct 2020 23:43:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxMsqZ7pn+abxq35Sn0+rgibHtQ8rNJbKFyOn7wK4OVyJQIdxWEMSL54dgUD6i2hQo1inPq X-Received: by 2002:a17:906:d8a3:: with SMTP id qc3mr3657222ejb.183.1601966590377; Mon, 05 Oct 2020 23:43:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601966590; cv=none; d=google.com; s=arc-20160816; b=lZqYLJrsc6XZ+84Fupg8adJGd/G0+0rvl7FLzrZtixgmPZyY8YGRyzu7vNIvfuR+Kl tCC3zAxpjxNjCQ5S+HdI9VNFhfzBW2Uo6+Zx8qjRYwE4U7NXGm/QC8NWiH+jdGvpI5w7 qFAP1PdxE2qIjta+Ho8lPdQu9OZBS8U7lhUN9MmqM2y/Ti8k3PhcJcTH5ut+u27hdBRj h8B1MYzO5YMpMVmhtRGOhWZ2/i1+Y5cKIQ6lr14iwM1UWgrMOcm7Ln81HzsHyQnEoE1J VgxzvQRhNK5YbmrVqB1OWG+QH1a/ui1KLRQjpocsTGQLW1LH4cCEGR/l/TPgyOIT+WCl SudA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=+LzSlqIy7vP4lM9uZ2549paum8eV4A8ImoKrN1ZxSWA=; b=Rrrj3Q812D+xBPghsgxJFd/u7zjhtvG6jNNENUzKn+/SByQV0cdqDuouTpPG3Mq2Gv BwafTCnHM4r+Nae8LfOCvMOwnl/GHIJa3gIDRSO8TbYoZu/4PtP5GdL4JBOLfW4/ew5u Is7ytcTZjG6R0YGTIM24Y/hTjpCW4Hol4Inr9arvDVuRVs00rgIgOVlCmOCauhL8rfp5 +EXGmiwIhowFWDTKF2gh0TGiYnDc78ed20TPF2FSH/J15xkIn3BgDwslD6rIPm65Tawv Gnr8FH3lyluaUw/UmQ6sDhW5H5iBo8LfAedSekdtn7ySAEWSjSflqiHfEywSJZBFC+sU s43w== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c23si1831421edy.388.2020.10.05.23.42.47; Mon, 05 Oct 2020 23:43:10 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726979AbgJFGjr (ORCPT + 99 others); Tue, 6 Oct 2020 02:39:47 -0400 Received: from szxga03-in.huawei.com ([45.249.212.189]:3971 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725962AbgJFGjr (ORCPT ); Tue, 6 Oct 2020 02:39:47 -0400 Received: from DGGEMM401-HUB.china.huawei.com (unknown [172.30.72.56]) by Forcepoint Email with ESMTP id 807F7E12B1E4C3F9D4FF; Tue, 6 Oct 2020 14:39:45 +0800 (CST) Received: from dggemi712-chm.china.huawei.com (10.3.20.111) by DGGEMM401-HUB.china.huawei.com (10.3.20.209) with Microsoft SMTP Server (TLS) id 14.3.487.0; Tue, 6 Oct 2020 14:39:45 +0800 Received: from dggemi761-chm.china.huawei.com (10.1.198.147) by dggemi712-chm.china.huawei.com (10.3.20.111) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1913.5; Tue, 6 Oct 2020 14:39:44 +0800 Received: from dggemi761-chm.china.huawei.com ([10.9.49.202]) by dggemi761-chm.china.huawei.com ([10.9.49.202]) with mapi id 15.01.1913.007; Tue, 6 Oct 2020 14:39:44 +0800 From: "Song Bao Hua (Barry Song)" To: Namhyung Kim CC: Andi Kleen , "linux-kernel@vger.kernel.org" , Linuxarm , "Peter Zijlstra" , Ingo Molnar , "Arnaldo Carvalho de Melo" , Mark Rutland , Alexander Shishkin , Jiri Olsa , Adrian Hunter , Alexey Budankov Subject: RE: [PATCH] perf evlist: fix memory corruption for Kernel PMU event Thread-Topic: [PATCH] perf evlist: fix memory corruption for Kernel PMU event Thread-Index: AQHWl+qFe9svqgT9AUqxYD+FeGRiAamC2SiAgADF+DCABao2gIAA25Pg Date: Tue, 6 Oct 2020 06:39:44 +0000 Message-ID: <41a3e45d558242f79f9e10a8d9ca92f1@hisilicon.com> References: <20201001115729.27116-1-song.bao.hua@hisilicon.com> <20201001230653.GM50079@tassilo.jf.intel.com> In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.126.200.32] Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org DQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTogTmFtaHl1bmcgS2ltIFtt YWlsdG86bmFtaHl1bmdAa2VybmVsLm9yZ10NCj4gU2VudDogVHVlc2RheSwgT2N0b2JlciA2LCAy MDIwIDI6MjYgUE0NCj4gVG86IFNvbmcgQmFvIEh1YSAoQmFycnkgU29uZykgPHNvbmcuYmFvLmh1 YUBoaXNpbGljb24uY29tPg0KPiBDYzogQW5kaSBLbGVlbiA8YWtAbGludXguaW50ZWwuY29tPjsg bGludXgta2VybmVsQHZnZXIua2VybmVsLm9yZzsgTGludXhhcm0NCj4gPGxpbnV4YXJt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