Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1734689ybt; Mon, 15 Jun 2020 08:06:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwifl3k1dcZrJEM7ApvpeciYfD6T30YGeUsRPTfiNMoh2unOS3Ak0Ufd+Ofgtoh0z7eGyXV X-Received: by 2002:a17:906:af62:: with SMTP id os2mr25713051ejb.345.1592233601192; Mon, 15 Jun 2020 08:06:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592233601; cv=none; d=google.com; s=arc-20160816; b=wZ+oUTfkX4DLLSD+eMx8M9RqZvMoHsaY9mHDkcrMCJyiFjONxo2aqp4sqx3kBRrTAO 4GihA7bLeQWUrW26gjx/h8wA6E6HaLvnzhnvxzRrMNy88qgCzPRkB9/D/PVN/quLhjlw LlkPcpVaewB1UGaLIFznv0LE67AIWnk8z+AIPeEuYIDJ36BZFlNa8Ta3yW1vqvr0z7Np hEj+bruprCphV+ReQQSVwo9I9Ytc6bfXuJsTRYZltYCEWZIgWXEbU4BTKAqEEaSAYCgZ LkC8Fl6szR6E1CjrigS7nBO/coCmuDCrgWKvPROGIcLY7+36+uKqTu9JowsNfJ2Za2Dt nKKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=jNEVxB8K8qkb0jxDWu2/VVQDIry1tExCa9xuuvd1cs0=; b=lFeNJLwjTZzmyvfcdDEoXSWfDnK0pfAvpj8zBPEM8te+a/zh8lIEo6wZy9h8ySPBUm RYDIRT8rb0XY6CCyJZbX5of7P+q0nJQKEXfZ//LnQdXliih8T9vVl+9LndQM2Iq6fnP0 1Nz0YiCi+qQvIH/JWZhb2tKGtblXV1k8yKFCNap4LRdk73m8w5OlqTKnXXxRK7Wloyc4 g9AXv4wUAMZrxefAGNqkKkwOuGN/7pxsONulb0lxMdOOYShO+blDlxZ2JFlRx0DF5QEs eSuS0Y5SHrybR8yRZq3VGUikW1Mwe+YgoysrXLa2d/uET1GiLg1KtyCcN/q3AMHp+L7M FiiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b="SFsU/76c"; 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 hh5si8136479ejb.264.2020.06.15.08.06.18; Mon, 15 Jun 2020 08:06:41 -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; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b="SFsU/76c"; 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 S1730838AbgFOPEJ (ORCPT + 99 others); Mon, 15 Jun 2020 11:04:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43376 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730213AbgFOPEI (ORCPT ); Mon, 15 Jun 2020 11:04:08 -0400 Received: from merlin.infradead.org (unknown [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 656E8C061A0E for ; Mon, 15 Jun 2020 08:04:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=jNEVxB8K8qkb0jxDWu2/VVQDIry1tExCa9xuuvd1cs0=; b=SFsU/76cAf/cYf4hUgNJOHfJ0j 17FLfyK9bUDLjXvy8yoEhllceLlOwr5/xLuPtgYVvX8et5ZvjBknrKLgWQYlpWwJbQHnziNy95SkH Eda6lq/FS29jNdz2WwNMn7T1xN6qaodxPcHwMsMbrahnZ4+j3kWGSNEalil6t5+HMFgaeunDXA+gm pxY22UgG/Id/MONFk3WJIm6TNH7hkCp6KsEto04/zJSefFe18iO0flvl0vQAN//ibFOH+gxVtIsbf 8AmoCohlPKw67hKDBq0kdY/8CAOctuvOU3MmYeQf29nE0sWm1kPJmyW8S8CoCiHgh3ybrZX6KCrKy eajqibMg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jkqe1-0007MO-Lu; Mon, 15 Jun 2020 15:03:29 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id D85B83003E1; Mon, 15 Jun 2020 17:03:27 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id BDCF2203C3763; Mon, 15 Jun 2020 17:03:27 +0200 (CEST) Date: Mon, 15 Jun 2020 17:03:27 +0200 From: Peter Zijlstra To: Marco Elver Cc: Dmitry Vyukov , Andrey Konovalov , Mark Rutland , Borislav Petkov , Thomas Gleixner , Ingo Molnar , clang-built-linux , "Paul E. McKenney" , Alexander Potapenko , kasan-dev , LKML , the arch/x86 maintainers , Andrew Morton , Josh Poimboeuf Subject: Re: [PATCH -tip v3 1/2] kcov: Make runtime functions noinstr-compatible Message-ID: <20200615150327.GW2531@hirez.programming.kicks-ass.net> References: <20200608110108.GB2497@hirez.programming.kicks-ass.net> <20200611215538.GE4496@worktop.programming.kicks-ass.net> <20200612114900.GA187027@google.com> <20200615142949.GT2531@hirez.programming.kicks-ass.net> <20200615145336.GA220132@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200615145336.GA220132@google.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 15, 2020 at 04:53:36PM +0200, Marco Elver wrote: > On Mon, 15 Jun 2020, Peter Zijlstra wrote: > > > On Mon, Jun 15, 2020 at 09:53:06AM +0200, Marco Elver wrote: > > > > > > Disabling KCOV for smp_processor_id now moves the crash elsewhere. In > > > the case of KASAN into its 'memcpy' wrapper, called after > > > __this_cpu_read in fixup_bad_iret. This is making me suspicious, > > > because it shouldn't be called from the noinstr functions. > > > > With your .config, objtool complains about exactly that though: > > > > vmlinux.o: warning: objtool: fixup_bad_iret()+0x8e: call to memcpy() leaves .noinstr.text section > > > > The utterly gruesome thing below 'cures' that. > > Is __memcpy() generally available? I think that bypasses KASAN and > whatever else. Yes, I think so. x86_64 needs lib/memcpy_64.S in .noinstr.text then. For i386 it's an __always_inline inline-asm thing.