From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08DB7C43333 for ; Tue, 2 Mar 2021 22:37:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D96B164F2D for ; Tue, 2 Mar 2021 22:37:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2360160AbhCBWRQ (ORCPT ); Tue, 2 Mar 2021 17:17:16 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:48032 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232227AbhCBUdX (ORCPT ); Tue, 2 Mar 2021 15:33:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614717104; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=LoXsMIh8kxioX7DB8CWUSz1tO5CDutkuFkB3ayoWzcQ=; b=F5zdcuhqn5Vj+h+B3vNQdtWH/JAhLPKjPhfBUm9qwutYZQRIjIvMU/ojPdwmsJ6Yv3uwpm A0pesZMtnXOjEXv5zALVQrLCWuVfyWtNGXkWfdZX0WeyZEKDukAExBZTkYKfx5sm99y0LZ t+eeY41psqBMX4IZt8R6KWmADPy+rFc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-165-OE0YojrQPy2CBngDxBhEcA-1; Tue, 02 Mar 2021 15:31:39 -0500 X-MC-Unique: OE0YojrQPy2CBngDxBhEcA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DA72518B9ECA; Tue, 2 Mar 2021 20:31:37 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.40.192.160]) by smtp.corp.redhat.com (Postfix) with SMTP id C973A60BFA; Tue, 2 Mar 2021 20:31:35 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Tue, 2 Mar 2021 21:31:37 +0100 (CET) Date: Tue, 2 Mar 2021 21:31:34 +0100 From: Oleg Nesterov To: Masami Hiramatsu Cc: Andy Lutomirski , Peter Zijlstra , LKML , Anil S Keshavamurthy , "David S. Miller" , X86 ML , Andrew Cooper Subject: Re: Why do kprobes and uprobes singlestep? Message-ID: <20210302203134.GC21871@redhat.com> References: <20210301165130.GA5351@redhat.com> <20210302112224.6b3568434be490fbfbdec790@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210302112224.6b3568434be490fbfbdec790@kernel.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/02, Masami Hiramatsu wrote: > > > Not sure I understand you correctly, I know almost nothing about low-level > > x86 magic. > > x86 has normal interrupt and NMI. When an NMI occurs the CPU masks NMI > (the mask itself is hidden status) and IRET releases the mask. The problem > is that if an INT3 is hit in the NMI handler and does a single-stepping, > it has to use IRET for atomically setting TF and return. Ah, thanks a lot, Oleg.