Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp1986373ybm; Thu, 23 May 2019 09:33:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqz58Kaa2mIsJoVlLPTrVSbyH3caD/BfhU6NGBUZ/iLT98j2Mo76yhpin+drMjRC9CO5j8KH X-Received: by 2002:a62:5a47:: with SMTP id o68mr79790815pfb.149.1558629217006; Thu, 23 May 2019 09:33:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558629216; cv=none; d=google.com; s=arc-20160816; b=cww772HjIpN+Vh5uqTPFDANp6298P+VtswbyIm/Yp8hA4n86Lsy1MTRHH5j4jcIvlW Y3cYJq5W87qdWU1MSAEwhsIuNag/W20m12jG7QvlBCFRvne5XMrRmAueQ6CjFjDlzv7U a+4a+M0PKSSByRIXFAOUSoJMNsvClOgTIf6OSf6FwVPNc8vLSBXjJwIo9a46gFGyE6Km T9LDxnhVviEc/JJ9TlgcfdaXsvUAP150hcjDBl3roGi2Xh/Jcn15/JjMZ+SBLfkkOYgs oooOKB1mJ3LoDG1oB+6/AvzEhb6fJ0uC7VH1NHfDkzDLo8XZw+Sf2w1VJI9ZomPAPcqO 1chw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:date:from:dkim-signature; bh=d4yxOBIwn0FSxMfzAT+WIvqWKOH8KRCi69z+n+22Kqs=; b=hgqjkG+s1WEYFSwKfwnyg7ByYalu9h/VQvhQ3KHjkGx1hHzGIHD7ZxrJa5mHnSV8+t VFAwUC9odqTO9xMmgOfBnSB+Owt9c7T0W+INb4nlCRspLG2ae4u7J2uxx96aI9IwU3pk jaW6n8JA7HOv6/8QJVoxbmSTb3q2buhcz2ZBTddmBzwp0uy3sV1qEXJM/VgQLBOwIGTm JKFlIwpyzA4xBi6lWI9y6Ro4X9/lF4c3BDBF0HHxAGFJhkpSqAD6b/64VChT2ytfRRto yPzyIqN1sdjAlT8mYww615CSmEG1GVEbwyCXfE+dkuZaD9s7OjpUWZkgHugtFa3JoKBG x/gQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@maine.edu header.s=google header.b=hjvolu2d; 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 ca10si4956037plb.172.2019.05.23.09.33.21; Thu, 23 May 2019 09:33:36 -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=@maine.edu header.s=google header.b=hjvolu2d; 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 S1731219AbfEWQbC (ORCPT + 99 others); Thu, 23 May 2019 12:31:02 -0400 Received: from mail-qt1-f195.google.com ([209.85.160.195]:33228 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730790AbfEWQbB (ORCPT ); Thu, 23 May 2019 12:31:01 -0400 Received: by mail-qt1-f195.google.com with SMTP id z5so1115596qtb.0 for ; Thu, 23 May 2019 09:31:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=maine.edu; s=google; h=from:date:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=d4yxOBIwn0FSxMfzAT+WIvqWKOH8KRCi69z+n+22Kqs=; b=hjvolu2dB+58iS4YDGxQnMR4xhkqWdh/4SMGHdkFeaPjNmvS3GHdeXkDzleWWT4stH b1YfpnshsrP0owpAdoWVcB4bq9xPwFMtSkE1n3fEDfZDIGYKGjRawVeoDjRz85/29JD0 a4Zx7LNqJN1XQxlr+ZDmOgFWUzAkX+yUTaXKk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=d4yxOBIwn0FSxMfzAT+WIvqWKOH8KRCi69z+n+22Kqs=; b=DelrcbCcn8R9WNxU92ZL3VU4QE2dcx4XUGBTrFsiwt0y5GmC3/VbT9tlg1pRXA52fa f3aEGqh/cRXxgqRfEf0n+MnkJPlvAjqYz6WuTVSNz1ig8MqRsxEk5QAuTHVOsljIpj7k qLMy0vGkBOWi84+s/l3RAxYyWjC8MlozXv1MQuYphUggceMPO+bKMLxUD5vvIk4oGUGB CppvR4IzWwVy0cvRML9ETOmWeiMqZ4rIMSQ/wXGrVbF792K2zS253XZ7ea551VxVbmdF /J6PheZB5jZ8+NLmZ4JACIn7C0uaGQudUOnB9XudXK9Y2uyFEyiSFC17MJv8uUGdxGo/ bnyg== X-Gm-Message-State: APjAAAV9on+oNUn7fynt7coUZC1Fx5Q4+vlhzhfE9jwUOr4+FIONyYsM OItlwkeXJBAtsePp8sQEbk73pQ== X-Received: by 2002:a0c:9679:: with SMTP id 54mr67918327qvy.168.1558629060865; Thu, 23 May 2019 09:31:00 -0700 (PDT) Received: from macbook-air (weaver.eece.maine.edu. [130.111.218.23]) by smtp.gmail.com with ESMTPSA id h17sm12968726qkk.13.2019.05.23.09.30.59 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 23 May 2019 09:31:00 -0700 (PDT) From: Vince Weaver X-Google-Original-From: Vince Weaver Date: Thu, 23 May 2019 12:30:56 -0400 (EDT) X-X-Sender: vince@macbook-air To: "Liang, Kan" cc: Andi Kleen , Peter Zijlstra , Alexander Shishkin , Arnaldo Carvalho de Melo , Jiri Olsa , Stephane Eranian , Ingo Molnar , linux-kernel@vger.kernel.org Subject: Re: perf: fuzzer causes crash in new XMM code In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 22 May 2019, Liang, Kan wrote: > XMM registers can only collected by hardware PEBS events. We should disable it > for all software/probe events. > > Could you please try the patch as below? I tested the patch (it was whitespace damaged for some reason, not sure if that was on my end though). Running a few hours here, it hasn't crashed, but it did produce this warning which appears to map to: if (WARN_ON_ONCE(idx >= ARRAY_SIZE(pt_regs_offset))) return 0; [ 5552.352046] WARNING: CPU: 1 PID: 11469 at arch/x86/kernel/perf_regs.c:76 perf_reg_value+0x45/0x50 [ 5552.352083] CPU: 1 PID: 11469 Comm: perf_fuzzer Tainted: G W 5.2.0-rc1+ #38 [ 5552.352084] Hardware name: LENOVO 10FY0017US/SKYBAY, BIOS FWKT53A 06/06/2016 [ 5552.352086] RIP: 0010:perf_reg_value+0x45/0x50 [ 5552.352089] Code: 48 63 f6 48 8b 84 f2 00 ff ff ff c3 31 c0 c3 83 fe 17 77 16 48 63 f6 8b 04 b5 60 a4 a0 8f 3d a0 00 00 00 77 e7 48 8b 04 07 c3 <0f> 0b 31 c0 c3 66 0f 1f 44 00 00 0f 1f 44 00 00 48 85 ff 74 12 81 [ 5552.352090] RSP: 0000:ffffa13005f23bd8 EFLAGS: 00010206 [ 5552.352092] RAX: 00000000fffffffd RBX: 000000000000001d RCX: 000000000000001d [ 5552.352093] RDX: 000000000000001d RSI: 000000000000001d RDI: ffffa13005f23f58 [ 5552.352094] RBP: ffffa13005f23c90 R08: 0000000000000000 R09: 0000000000029340 [ 5552.352096] R10: 0000114c8f85b92c R11: 0000000000000001 R12: ffffa13005f23f58 [ 5552.352097] R13: ffff8cc1aa3f4030 R14: 0000000000000030 R15: 0000000000000000 [ 5552.352098] FS: 00007f2154803540(0000) GS:ffff8cc1b5a40000(0000) knlGS:0000000000000000 [ 5552.352100] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 5552.352101] CR2: 00007ffe0cb894f8 CR3: 000000022d87e006 CR4: 00000000003607e0 [ 5552.352102] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 5552.352103] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000600 [ 5552.352104] Call Trace: [ 5552.352109] perf_output_sample_regs+0x43/0xa0 [ 5552.352115] perf_output_sample+0x3aa/0x7a0 [ 5552.352119] perf_event_output_forward+0x53/0x80 [ 5552.352123] __perf_event_overflow+0x52/0xf0 [ 5552.352126] perf_swevent_overflow+0x99/0xc0 [ 5552.352128] ___perf_sw_event+0xe7/0x120 [ 5552.352131] ? ptep_set_access_flags+0x23/0x30 [ 5552.352134] ? do_wp_page+0x2c5/0x5c0 [ 5552.352136] ? __handle_mm_fault+0xba8/0x1220 [ 5552.352140] ? _cond_resched+0x15/0x30 [ 5552.352143] ? handle_mm_fault+0xc2/0x1d0 [ 5552.352146] ? __do_page_fault+0x268/0x4f0 [ 5552.352149] ? page_fault+0x8/0x30 [ 5552.352151] __perf_sw_event+0x55/0xa0 [ 5552.352154] page_fault+0x1e/0x30 [ 5552.352157] RIP: 0033:0x55e5a5ec6494 [ 5552.352159] Code: b8 00 00 00 00 e8 bc 2c ff ff 48 8b 05 c5 a2 22 00 48 83 c0 01 48 89 05 ba a2 22 00 90 c9 c3 55 48 89 e5 48 81 ec 10 24 00 00 07 30 ff ff 89 c2 89 d0 c1 f8 1f c1 e8 19 01 c2 83 e2 7f 29 c2 [ 5552.352160] RSP: 002b:00007ffe0cb89500 EFLAGS: 00010206 [ 5552.352161] RAX: 0000000000000400 RBX: 000000000000000c RCX: 0000000000000008 [ 5552.352162] RDX: 000055e5a5ecd9c0 RSI: 00007ffe0cb8b8f4 RDI: 00007f21547fc740 [ 5552.352163] RBP: 00007ffe0cb8b910 R08: 00007f21547fc1c4 R09: 00007f21547fc240 [ 5552.352164] R10: 0000000000000001 R11: 0000000000000202 R12: 000055e5a5eb94c0 [ 5552.352165] R13: 00007ffe0cb8dd00 R14: 0000000000000000 R15: 0000000000000000 [ 5552.352168] ---[ end trace 199d9be3b0c594ae ]---