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=-2.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,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 BE2D3C433E1 for ; Mon, 1 Jun 2020 09:52:30 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 94398206E2 for ; Mon, 1 Jun 2020 09:52:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="R/yuJbqG" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 94398206E2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=FArTOilqy/G/YOD5iyQci4EinwNet6lBqOxH1Nx1Z1Q=; b=R/yuJbqGP0SHgk Fs43NEFrmfd78f2ga8yG2snF7kI2UchsXHRFjQ3a50x2YcHShlxgXu7eHw3Xnw5myAVUrqnhYfOMX Micvaax4dX6JZEGxIy7T0rRcXGibgqgiQE6JAjOKn0FCilAk/j07YhP3dpvN59knXkctUl9gsEbzc j2o+LawrEyAVOHai2UELI0kc8Gma/zmTcxHxacpYv5SUw2jEmXy0tT1eFtJgLkrIEIzuQcIopDvi3 qjjR6pfSvefgCKtCdhtiy7LE6rBQZG2NlM2V0BuHH7IJ/FqSQ5xl6iwyRv7nmKnJgbf8kuPpI3EJu VCVKff0y/6jkw9yv4xwQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jfh7O-0006vt-0z; Mon, 01 Jun 2020 09:52:30 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jfh7L-0006vP-8G for linux-arm-kernel@lists.infradead.org; Mon, 01 Jun 2020 09:52:28 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6CD871FB; Mon, 1 Jun 2020 02:52:26 -0700 (PDT) Received: from arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 512B33F305; Mon, 1 Jun 2020 02:52:25 -0700 (PDT) Date: Mon, 1 Jun 2020 10:52:23 +0100 From: Dave Martin To: Keno Fischer Subject: Re: arm64: Register modification during syscall entry/exit stop Message-ID: <20200601095222.GY5031@arm.com> References: <20200520174149.GB27629@willie-the-truck> <20200527095528.GC11111@willie-the-truck> <20200527101929.GT5031@arm.com> <20200531093320.GA30204@willie-the-truck> <20200601091441.GW5031@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200601_025227_339217_0B8043D7 X-CRM114-Status: GOOD ( 17.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kyle Huey , Catalin Marinas , Linux Kernel Mailing List , Oleg Nesterov , Will Deacon , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Jun 01, 2020 at 05:23:01AM -0400, Keno Fischer wrote: > On Mon, Jun 1, 2020 at 5:14 AM Dave Martin wrote: > > Can you explain why userspace would write a changed value for x7 > > but at the same time need that new to be thrown away? > > The discarding behavior is the primary reason things aren't completely > broken at the moment. If it read the wrong x7 value and didn't know about > the Aarch64 quirk, it's often just trying to write that same wrong > value back during the next stop, so if that's just ignored, > that's probably fine in 99% of cases, since the value in the > tracee will be undisturbed. I guess that's my question: when is x7 "disturbed". Other than sigreturn, I can't think of a case. I'm likely missing some aspect of what you're trying to do. > I don't think there's a sane way to change the aarch64 NT_PRSTATUS > semantics without just completely removing the x7 behavior, but of course > people may be relying on that (I think somebody said upthread that strace does?) Since rt_sigreturn emulation was always broken, can we just say that the effect of updating any reg other than x0 is unspecified in this case? Even fixing the x7 issue won't magically teach your tracer how to deal with unrecognised data in the signal frame, so new hardware or a new kernel could cause your tracer to become subtly broken. Would you be better off tweaking the real signal frame as desired and doing a real rt_sigreturn for example, instead of attempting to emulate it? I'm somewhat playing devil's advocate here... Cheers ---Dave _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel