From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756946AbcHWCyg (ORCPT ); Mon, 22 Aug 2016 22:54:36 -0400 Received: from mail-it0-f49.google.com ([209.85.214.49]:37757 "EHLO mail-it0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751168AbcHWCyf (ORCPT ); Mon, 22 Aug 2016 22:54:35 -0400 From: Vince Weaver X-Google-Original-From: Vince Weaver Date: Mon, 22 Aug 2016 22:54:32 -0400 (EDT) X-X-Sender: vince@macbook-air To: Vince Weaver cc: Huang Rui , Peter Zijlstra , linux-kernel@vger.kernel.org, Borislav Petkov , Ingo Molnar , Arnaldo Carvalho de Melo Subject: Re: perf: fuzzer crashes immediately on AMD system In-Reply-To: Message-ID: References: <20160819100130.GD10121@twins.programming.kicks-ass.net> <20160822111631.GA25844@hr-amur2> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > > > > > > > perf stat -a -e amd_nb/config=0x37,config1=0x20/ /bin/ls > amd_uncore_find_online_sibling() > function is broken. and that's the problem. uncore_find_online_sibling() does all kinds of wrong things including sticking active uncore structures in uncore->free_when_cpu_online Then uncore_online() comes along and frees those structures. Then some other part of the kernel comes and re-uses the free'd data. Then when we try to start an event, all of the fields are invalid because the uncore pointer is pointing to re-used data. I don't have a patch because I am not 100% clear on what uncore_find_online_sibling() is doing in the first place. Vince