Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1228191imm; Wed, 17 Oct 2018 15:57:51 -0700 (PDT) X-Google-Smtp-Source: ACcGV631dln6OxMkXDP/zCJX3RbjY3bdSqNaJERzBLS7CCrEY7CBneTs2/GwZwm89j3eQlbqjXHi X-Received: by 2002:a63:26c1:: with SMTP id m184-v6mr3411226pgm.268.1539817071432; Wed, 17 Oct 2018 15:57:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539817071; cv=none; d=google.com; s=arc-20160816; b=r/RsnuZEOknTj7N8b4aZbREInLt6V8RHyS4NLwYRRRQvnM7dTwsza86G8iwuGeF9kY JJ5Q+hwoQ6+EK6q5dfs3noyahoWaGv/kiBUanZjeul+NjnFY2Y/5VlOoTpU2zwMk129b sQf/7YWU+KPuYjYqFQ8Gq+Fo2+DjN0FCs5NRJxyyW6/BPumsEec+4qHX4mnDZn8Je7aM qK8V9VRwj84su/yqDBHqJA6aJGAoAua8PoqyuXMYva+rY9IDLbuQrRKiB87kbkSsO8e5 dhSXY+ty5OZbDbod5ifC2uA3B1NQGmE5X8ZbRXoftoW2Z3uYDbtY0l+C4b9juhg5jyJq sHjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=Ch1V2IohOs6lj2CVzx+8GN8vMeJ2fOd7n2RDd8OlV68=; b=y/i6XfBYADG717NPGLfbIt9G/3xW12mzOoPhV8UGiDiIybesChriwT+MLHGLThIJLv VWsGzPkT3ckVXaqqNYE1AguuJxEGgGXEqbS4MbTY5MxPCS7ItEqMR/0912a+xfagBQTq 3QAZth2cvIj7vKMx6PFWm8gFfrz5/j+TGZW4L7SSnX4hLsJDURUKBXa8kceIMA9LCrqm 86brDNv0lakIB4shmYjpgnHNu5fmvT6G/UJ21XTfsJBa/S4YONZ90OR7DV439LuvYqjp SJNAJatCGlxA9dxTkeGVf4WQz321rGtElS0tR/eHe1AVLCspoPEXdStxSFKambb/I+O+ xkTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1afDyVsE; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g11-v6si18630318plq.5.2018.10.17.15.57.36; Wed, 17 Oct 2018 15:57:51 -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=@kernel.org header.s=default header.b=1afDyVsE; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727839AbeJRGxm (ORCPT + 99 others); Thu, 18 Oct 2018 02:53:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:42304 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726412AbeJRGxl (ORCPT ); Thu, 18 Oct 2018 02:53:41 -0400 Received: from jouet.infradead.org (unknown [179.97.41.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0474E21477; Wed, 17 Oct 2018 22:55:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539816948; bh=7kGPU12HmcqKw67EH33k0zhVsGscANjFI61IolNB2Oc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1afDyVsEsF3zKCYrtdUsJhO3y7Gwj0Dyi9m/EdfEcSUKV1SxdAgKRu5EmO8lbRBGY 9hij4wdvVlteWQMUZgeKVUW/lz6KSWXyT9pcM31/WHJTpNRNGLiGN7TjkaqkfXaVAm Srd6b4Y3OCHoPtqNtX6Uf3yqbMKFVHb31Xm1Kua4= From: Arnaldo Carvalho de Melo To: Ingo Molnar Cc: Clark Williams , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, David Miller , Jiri Olsa , Kan Liang , Arnaldo Carvalho de Melo Subject: [PATCH 08/11] perf cpu_map: Align cpu map synthesized events properly. Date: Wed, 17 Oct 2018 19:54:58 -0300 Message-Id: <20181017225501.32150-9-acme@kernel.org> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20181017225501.32150-1-acme@kernel.org> References: <20181017225501.32150-1-acme@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: David Miller The size of the resulting cpu map can be smaller than a multiple of sizeof(u64), resulting in SIGBUS on cpus like Sparc as the next event will not be aligned properly. Signed-off-by: David S. Miller Cc: Jiri Olsa Cc: Kan Liang Fixes: 6c872901af07 ("perf cpu_map: Add cpu_map event synthesize function") Link: http://lkml.kernel.org/r/20181011.224655.716771175766946817.davem@davemloft.net Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/event.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c index 0cd42150f712..0988eb3b844b 100644 --- a/tools/perf/util/event.c +++ b/tools/perf/util/event.c @@ -1081,6 +1081,7 @@ void *cpu_map_data__alloc(struct cpu_map *map, size_t *size, u16 *type, int *max } *size += sizeof(struct cpu_map_data); + *size = PERF_ALIGN(*size, sizeof(u64)); return zalloc(*size); } -- 2.14.4