Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp7588259yba; Thu, 2 May 2019 12:31:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqywcz9bM/T1XZNcPq5AKLer2X1+Irauoo4exTfOLFEBeUDcEgSKfHwWZRlAdnRv6w4lpGzp X-Received: by 2002:a17:902:8306:: with SMTP id bd6mr5620094plb.134.1556825499000; Thu, 02 May 2019 12:31:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556825498; cv=none; d=google.com; s=arc-20160816; b=ez2ilpheN+fZxrArUo6jTAXmxUFnu5llvWG52gden1pj9ktstuZ56ksRsSMsxgYryi +/TgoY/ze3vYvQv+DdyujbCagDpKxIIyyeswY9B3D+ytkGpHXXirkJ6C4qyOG2TwmGUi LGraW/06vDswKLc197IMfrKq1xazRi2LgfizDPDOOHUCeXFKRBOns9G2SWoGhNnp1/DD YN/1ngdlLKtThU7LMqca80m6DdLtNiLN8QH+zlrqa8QKan9n6lOyNiLh4shSFkoEHAzP rLqj0T+N3zXMkvlmtdvs4W/VjGmJp4SQRUTa3anfa/JyZ1995tPatUfGAtIV+Ve+ELar //3w== 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:from:date:dkim-signature; bh=fL9T5enjtM2wfh/hXgsc5ljDlOnHyDe6QX25CPuZ2EE=; b=x5NBH8voqHt7820hCW2lUkjk/tp/V8J2MX7Gzi2SiQXcixHgdklrAh+6evJ8UVuYa8 +Yjt8jTmQltl7y2xQ4y3diKgGxDzyfYUMk4zZJydsvnI/U+z2IAcH67OrALz75YvOqH/ S1TES7coPOl2eaT823r+B3Vqk5uWWsQ3/+/YPPmNihEO9mW6KUHyloDVvwlUQtoYx4oX Fb3WKHQnqWbs5oqAQHGe9rRMWyloSPtTym2vBhRnnrJzYliLZdstQSY/vIPC5W4w/iLP XfMZ2qz/d5V8XplCtsWmOm8tLCrOCKBDGQw/X5fXKThd6XsM4yU/ia2dJ8D28gnLvfxk Pnng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=T3meCuhy; 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 n13si42884971pgl.348.2019.05.02.12.31.23; Thu, 02 May 2019 12:31:38 -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=T3meCuhy; 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 S1726338AbfEBT3B (ORCPT + 99 others); Thu, 2 May 2019 15:29:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:36028 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725962AbfEBT3B (ORCPT ); Thu, 2 May 2019 15:29:01 -0400 Received: from pobox.suse.cz (prg-ext-pat.suse.com [213.151.95.130]) (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 84A2F205F4; Thu, 2 May 2019 19:28:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556825340; bh=4+7iWLyZHdlkEaJ9YIk2Zw2gBNmiSwpxVpWt2kUQHoA=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=T3meCuhymsjbqBV1PJ4E8RF0HMtRR78xo9UtI/BzIqosyAJrJej4ouBZOQXFy38v9 Xqqac2c12ESnORGAB5k92HVdaVhMRyZdR4m6ewn1XoG1Vcdy9TxLdpkYy6/fs+4emz yrffJxf6fyRF0eI6jBQBaqBaNH9/JMsz7X8WC4x4= Date: Thu, 2 May 2019 21:28:53 +0200 (CEST) From: Jiri Kosina To: Linus Torvalds cc: Peter Zijlstra , Steven Rostedt , Linux List Kernel Mailing , Ingo Molnar , Andrew Morton , Andy Lutomirski , Nicolai Stange , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , the arch/x86 maintainers , Josh Poimboeuf , Miroslav Benes , Petr Mladek , Joe Lawrence , Shuah Khan , Konrad Rzeszutek Wilk , Tim Chen , Sebastian Andrzej Siewior , Mimi Zohar , Juergen Gross , Nick Desaulniers , Nayna Jain , Masahiro Yamada , Joerg Roedel , "open list:KERNEL SELFTEST FRAMEWORK" , stable Subject: Re: [RFC][PATCH 1/2] x86: Allow breakpoints to emulate call functions In-Reply-To: Message-ID: References: <20190501202830.347656894@goodmis.org> <20190501203152.397154664@goodmis.org> <20190501232412.1196ef18@oasis.local.home> <20190502162133.GX2623@hirez.programming.kicks-ass.net> <20190502181811.GY2623@hirez.programming.kicks-ass.net> User-Agent: Alpine 2.21 (LSU 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 Thu, 2 May 2019, Linus Torvalds wrote: > I forget: is #BP _only_ for the "int3" instruction? Hmm, according to 17.3.2 in vol 3 of SDM (and table 6-1 there), that indeed seems to be the case, so we should be fine. > But if "int3 from kernel space" _only_ happens on actual "int3" > instructions, then we really could just special-case that case. We'd > know that %cr3 has been switched, we'd know that we don't need to do > fsgs switching, we'd know we already have a good stack and percpu data > etc set up. That should indeed be doable, under the asumption that noone is doing any int3 games before we've switched away from entry trampoline. I've briefly looked, and seems like we have proper notrace anotations for stackleak_erase(), which seems to be the only C (ftrace-able) code that's running on a trampoline (off-topic: where does PTI code make sure that we actually map this symbol into user pagetables in case we're not doing global mapping?). -- Jiri Kosina SUSE Labs