Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6592262ybi; Mon, 8 Jul 2019 05:34:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqwJ3uuZNzr/0+R9KcOrb0UtvLeEtDFqXc7Rf7ndm5v/Gmh8HaX/JTNV5RdsoO721Xz/zvEI X-Received: by 2002:a17:902:b688:: with SMTP id c8mr24218468pls.243.1562589288088; Mon, 08 Jul 2019 05:34:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562589288; cv=none; d=google.com; s=arc-20160816; b=AOwOQPMnuY6feih0HUFXLyYdnFIcD0VCW0DyyfkyEhpEoR8rRz5L1L0VvYXZpzcmV/ 9+xxkv1iRPiEORKUV+c7WldEnd4XgqZZimbjky7slw8BqxGjbPuYXHZOuG7DkR2bBDY9 CwA29q5koKlGOspXg7bw2mOakcEV4Sc9ZcvQZI1KPzjLrnIyz2Z0zCkU1eka2pfA3iyd IvW7cuoKdOes/F1ALJQQka9unXKD+eNP77UnO4YY7pafVwKs7vDRXoHHPgGd8idoJbAU H/pszEt7PsaQS8W1Zxh0kZEayKW2mmy+vvhX2qHhp8rSB2W1X4dOHdbRPiobs0TYLP6e lEPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:cc:to:subject :dkim-signature; bh=HGL8gFLqqUGw26sgh16OPJKq0qs1x4eHHY+Blnf6EkY=; b=CcmTInxgDAtdpgFaEAKK9d3jhxAI1MZvTYaIzbzWbzkd/ZJWa6akcBlh4HuLoV0Ic5 bM8yOpnlxEnmEJsNNf/giKXlyHomwhHAq7AuGUFsHSLtxlhiE7WLWGTjbWTyrgIFbOV5 nuCicd6F+REg2nXvWfcoP9Pb0ad6CEA2h21pQ0xyNOUBEnkgpk49RiWYrwt/8OeHJ6vM shccYsYYuk7H+HkewTDtdoJ/4c+A5oD5c/rCXvKBzZiVpsvm2HakaSpF72AMboUTy1Sz 5lFu3LcaeO5PODXt4FCwmiN+tEOeDFVbEFgVpRDcaKpSQclKzLQ5tOC4I/EgoL0lEO9I kQGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@etsukata-com.20150623.gappssmtp.com header.s=20150623 header.b=QsT3qIZh; 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 x13si360781pgo.182.2019.07.08.05.34.33; Mon, 08 Jul 2019 05:34:48 -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=@etsukata-com.20150623.gappssmtp.com header.s=20150623 header.b=QsT3qIZh; 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 S1729590AbfGHI64 (ORCPT + 99 others); Mon, 8 Jul 2019 04:58:56 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:45595 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727352AbfGHI6z (ORCPT ); Mon, 8 Jul 2019 04:58:55 -0400 Received: by mail-pf1-f195.google.com with SMTP id r1so7238565pfq.12 for ; Mon, 08 Jul 2019 01:58:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=etsukata-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:openpgp:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=HGL8gFLqqUGw26sgh16OPJKq0qs1x4eHHY+Blnf6EkY=; b=QsT3qIZhYbzOwPmMAQa3V8+8LFcV3DntFB73Fq82cmu/Yk22aVgYdNgjDUWhRI8Nyb KyaSvzV40pqdAXS7WpJjmPCYXzULabRrE7lV9cXawGHpPGkkhylXEEVR5yi8ymV/7cto 92ItFqXD+bFbplXRUqd3R42zocSXK1Oige4r/1XqMyvVjLxMK1krSMfB60qTL/JAthw0 X1VklavW/+okkJlvNDG3wTydrpVxHaOgumzbrBQ1STy3z8dGSh4Mp5JPYGZZjVKmEmfb r5tvj11qvuWB4wvoON7DEMenVgiUGcGH17wf20ousfB8hnc4D5fzQFkcRWAptFg/jWWV XMfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=HGL8gFLqqUGw26sgh16OPJKq0qs1x4eHHY+Blnf6EkY=; b=lntGncERPxH9dfnAzsuq6OyKEmA54lxtY9mGwJIXOQKZKm6lV+5NYhGW2Kk/p2RxTP aZC2ciVReY/5o6ccOhKdz6lDQ0GTI0bB20mZMYYZjCEXjDUchwTXnI272m2qSNW/8rc8 ZGHMaWugWht7pPoQ7dJcc9KxIhTqx3KcZWNNm6YvLTzn6GuMpdz4DmJEQ8NatYchDd0m xYEQck51jGioQOvIngyV4XmbFQGI+ogE4YZ8wvTh3gIzz3Q1/ijkJ8CCwTcoLncJh/Jh WzWnHx1I9pW25cL3BAkXkVikCNhU9xC/9qQuzQc1yGv5wUnqphnhYFjeLyKpiRLhTwuX dMoA== X-Gm-Message-State: APjAAAWM7BeKIbsrznPCaYaxEunsHJiLzGKA2gz06PHPqA2PaEoq2jsi NY1xtvZFga+j7UL4zurZhtfMVFxsmDs= X-Received: by 2002:a17:90b:8cd:: with SMTP id ds13mr22511988pjb.141.1562576334613; Mon, 08 Jul 2019 01:58:54 -0700 (PDT) Received: from etsukata.local (fs76eecbcd.tkyc008.ap.nuro.jp. [118.238.203.205]) by smtp.gmail.com with ESMTPSA id b16sm16679098pfo.54.2019.07.08.01.58.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Jul 2019 01:58:53 -0700 (PDT) Subject: Re: [PATCH v2 5/7] x86/mm, tracing: Fix CR2 corruption To: Peter Zijlstra Cc: Linus Torvalds , Thomas Gleixner , Borislav Petkov , Ingo Molnar , Steven Rostedt , Andrew Lutomirski , Peter Anvin , Dave Hansen , Juergen Gross , Linux List Kernel Mailing , He Zhe , Joel Fernandes References: <20190704195555.580363209@infradead.org> <20190704200050.534802824@infradead.org> <20190708074823.GV3402@hirez.programming.kicks-ass.net> From: Eiichi Tsukata Openpgp: preference=signencrypt Autocrypt: addr=devel@etsukata.com; keydata= mQINBFydxe0BEAC2IUPqvxwzh0TS8DvqmjU+pycCq4xToLnCTy9gfmHd/mJWGykQJ7SXXFg2 bTAp8XcITVEDvhMUc0G4l+RBYkArwkaMHO5iM4a7+Gnn6beV1CL/dk9Wu5gkThgL11bhyKmQ Ub1duuVkX3fN2cRW2DrHsTp+Bxd/pq5rrKAbA/LIFmF4Oipapgr69I5wUeYywpzPFuaVkoZc oLdAscwEvPImSOAAJN0sesBW9sBAH34P+xaW2/Mug5aNUm/K6whApeFV/qz2UuOGjzY4fbYw AjK1ALIK8rdeAPxvp2e1dXrj29YrIZ2DkzdR0Y9O8Lfz1Pp5aQ+pwUQzn2vWA3R45IItVtV5 8v04N/F7rc/1OHFpgFtzgAO2M51XiIPdbSmF/WuWPsdEHWgpVW3H/I8amstfH519Xb/AOKYQ 7a14/3EESVuqXyyfCdTVnBNRRY0qXJ7mA0oParMD8XKMOVLj6Nlvs2Zh2LjNJhUDsssKNBg+ sMKiaeSV8dtcbH2XCc2GDKsYbrIKG3cu5nZl8xjlM3WdtdvqWpuHj6KTYBQgsXngBA7TDZWT /ccYyEQpUdtCqPwV0BPho6pr8Ug6J99b1KyZKd/z3i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4UhDNXd/ZGZi5fRI2lo8Cp+oTS0Q m6FIxqnoPWVCsi1XJdSSQtTMxU0qesAjRXTPE76lMdUQkYZ/Ux1rbzYAgWFatvx4aUntR+1N 2aCDuAIID8CNIhx40fGfdxVa4Rf7vfZ1e7/mK5lDZVnWwTOJFNouvlILKLcDPNO51R5XKsc1 zxZwI+P1sTpSBI/KtFfphfaN93H3dLiy26D1P8ShFz6IEfTgK4OVWhqCaOe9oTXTwwNzBQ4= Message-ID: <48e29640-fedc-3e72-535c-27ef07b73938@etsukata.com> Date: Mon, 8 Jul 2019 17:58:49 +0900 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <20190708074823.GV3402@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/07/08 16:48, Peter Zijlstra wrote: ... > > Or are we going to put the CR2 save/restore on every single tracepoint? > But then we also need it on the mcount/fentry stubs and we again have > multiple places. > > Whereas if we stick it in the entry path, like I proposed, we fix it in > one location and we're done. > Thanks to your detailed comments and the discussion, I've come to realize that your solution "save CR2 early in the entry" is the simplest and reasonable. By the way, is there possibility that the WARNING(#GP in execve(2)) which Steven previously hit? : https://lore.kernel.org/lkml/20190321095502.47b51356@gandalf.local.home/ Even if there were, it will *Not* be the bug introduced by this patch series, but the bug revealed by this series. Thanks, Eiichi