Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1280620pxu; Mon, 23 Nov 2020 16:56:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJz0tfcNwauug3qvXWSENlBXhx+a7tdOob1/dwT9JpcGvQShGI5dMtZiBlmc63xPlH7Hdrt9 X-Received: by 2002:a17:906:5c43:: with SMTP id c3mr2212800ejr.390.1606179398920; Mon, 23 Nov 2020 16:56:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606179398; cv=none; d=google.com; s=arc-20160816; b=wp0QkXLuu7VHK0K+IfZLVKqWeGolCLkkfUSYz9HluOx3hKwnRiUZmIC6VUFGJubLXT ks6t1FWARQUv72sUJrkiWqze2IClDlJIXbFjRnjyxcW5fM/6P6wfpgqBjJNSM9/BYCOQ m6sxvuvlGSh3DwtHWMsI/GcKRGup/Wns1efl6ZNGvYQVSsvPGNG0dSbVQUYUr0uQrtRJ 7jsS1IAsV5vs/mprfEGBKbBwHgEvPNwasW6fxG/Va7yeTIM1+Ias6iK9nZ6TPmvEUxKS fD1QChERJQ4u76lFoxjqcMK/HOm/EpTBEMSrm+QtlgeivJpT9ecea/xGVcvb8Nk0Jj20 dGkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=e60A243UCkxYeM188YBnB8QxSXcfB/wz3OBZge5IG1I=; b=ApIW4gPcCTNj8IiPQAyYx6JA1cQ1DLXIiouu+uSivVIpHcNIQRmCiHMrKMXD1z6qr2 b96MzEIEz49Q6NlviMvG1hBMh0X/+iJjLSnHd6UXhR/MdosK1n1agE44Gg+w94uvjOVL AOyFEisf9kfgCA8FjdAkJ0seyy4aIhrF9ooqBtZvjgJp6Lt2ACUSPF2Wr9XXygNaa90h MSWdgmCasEsPLVaV8tzIXVTvUA1pwph5L0TnN72N+A1a6eEepm9MFeXFA6tPPkLBS0Zg pHUjorniKWNNtgJ+GeFD2A65qMeOIC34A05/9Od4UsyaWoVmZhJFWmFwat2/R2ouIzqy I1nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=n18IzvBW; 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 c7si7524741ejp.437.2020.11.23.16.56.15; Mon, 23 Nov 2020 16:56:38 -0800 (PST) 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=pass header.i=@ellerman.id.au header.s=201909 header.b=n18IzvBW; 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 S1726746AbgKXAxO (ORCPT + 99 others); Mon, 23 Nov 2020 19:53:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725970AbgKXAxN (ORCPT ); Mon, 23 Nov 2020 19:53:13 -0500 Received: from ozlabs.org (bilbo.ozlabs.org [IPv6:2401:3900:2:1::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A0C8C0613CF for ; Mon, 23 Nov 2020 16:53:13 -0800 (PST) Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4Cg59H3239z9s1l; Tue, 24 Nov 2020 11:53:07 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ellerman.id.au; s=201909; t=1606179188; bh=lyVOjIkSY5dqLzPZNvbMZ38Ji4ioww1+hvQxiSUQm3Q=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=n18IzvBWw2TV142EFQEjejJW7/FqYCmtDMxgjeVIyiVy1SevKBgYP5TmkR63a64hK LRWMxRUBR2ZOQRXhBYqjzuN2PFrl6VigEQ6gnJH0UT0Of8Ujkb4w5eNs07U1B1dEfp DrHLTr5A6SglsJ+b5Js3pIWtN0Om0clhQJm/tvrTd/YRpsDNavh9V9NV/WSW7nuSwn Ngoa5rpHPiutfEVtD/GSEqwWvdv3GILXN5Ca4/7eb1fscPfRRc1zCyCmvN0aKdxJzH VHzfXi8nikZ4SZkVGyksLHcAy/v3klnQvWX4uCEJUHpnwA1HFVCnyEx9vzhGG6YZcY kWzUeSbjru6ng== From: Michael Ellerman To: Oleg Nesterov , Christophe Leroy Cc: Benjamin Herrenschmidt , Madhavan Srinivasan , Paul Mackerras , Al Viro , "Aneesh Kumar K.V" , Christophe Leroy , Jan Kratochvil , Nicholas Piggin , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 2/2] powerpc/ptrace: Hard wire PT_SOFTE value to 1 in gpr_get() too In-Reply-To: <20201123180142.GB20279@redhat.com> References: <20201119160154.GA5183@redhat.com> <20201119160247.GB5188@redhat.com> <20201119221033.Horde.be-msjDTeIW4XeXARjUu7g1@messagerie.c-s.fr> <20201119224347.GC5138@redhat.com> <20201123180142.GB20279@redhat.com> Date: Tue, 24 Nov 2020 11:53:03 +1100 Message-ID: <87360z1spc.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Oleg Nesterov writes: > Christophe, et al, > > So what? > > Are you going to push your change or should I re-send 1-2 without > whitespace cleanups? I'll take your 1 & 2 and fixup the whitespace issues when applying. cheers > On 11/19, Oleg Nesterov wrote: >> >> On 11/19, Christophe Leroy wrote: >> > >> > I think the following should work, and not require the first patch (compile >> > tested only). >> > >> > --- a/arch/powerpc/kernel/ptrace/ptrace-view.c >> > +++ b/arch/powerpc/kernel/ptrace/ptrace-view.c >> > @@ -234,9 +234,21 @@ static int gpr_get(struct task_struct *target, const >> > struct user_regset *regset, >> > BUILD_BUG_ON(offsetof(struct pt_regs, orig_gpr3) != >> > offsetof(struct pt_regs, msr) + sizeof(long)); >> > >> > +#ifdef CONFIG_PPC64 >> > + membuf_write(&to, &target->thread.regs->orig_gpr3, >> > + offsetof(struct pt_regs, softe) - offsetof(struct pt_regs, >> > orig_gpr3)); >> > + membuf_store(&to, 1UL); >> > + >> > + BUILD_BUG_ON(offsetof(struct pt_regs, trap) != >> > + offsetof(struct pt_regs, softe) + sizeof(long)); >> > + >> > + membuf_write(&to, &target->thread.regs->trap, >> > + sizeof(struct user_pt_regs) - offsetof(struct pt_regs, trap)); >> > +#else >> > membuf_write(&to, &target->thread.regs->orig_gpr3, >> > sizeof(struct user_pt_regs) - >> > offsetof(struct pt_regs, orig_gpr3)); >> > +#endif >> > return membuf_zero(&to, ELF_NGREG * sizeof(unsigned long) - >> > sizeof(struct user_pt_regs)); >> > } >> >> Probably yes. >> >> This mirrors the previous patch I sent (https://lore.kernel.org/lkml/20190917143753.GA12300@redhat.com/) >> and this is exactly what I tried to avoid, we can make a simpler fix now. >> >> But let me repeat, I agree with any fix even if imp my version simplifies the code, just >> commit this change and lets forget this problem. >> >> Oleg.