Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp5854713rwb; Tue, 9 Aug 2022 05:22:18 -0700 (PDT) X-Google-Smtp-Source: AA6agR78WvjPaIcX6thvR1lvYJIaL5ZbCWT1qGEHIlpvAPsIzwLurS20VLN3STe46ojax7192xcV X-Received: by 2002:a63:6586:0:b0:41c:a4cd:cb56 with SMTP id z128-20020a636586000000b0041ca4cdcb56mr18471648pgb.347.1660047738095; Tue, 09 Aug 2022 05:22:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660047738; cv=none; d=google.com; s=arc-20160816; b=qGUDzE6OOsDq+NoeEb/xJjk39yORL0C7N/dRd828YXBNLj0/JMKYsnGOPbtmsj/prm lGO6zaST3obDxMHItwdG1gnUgy5qxMd15p5b9wkNNcztjpKWt7wgH4jXIrlRzeIaa8uz jUU/MaTnLY1nT9DMAotE2Gwcdh8tULGPkn3bXW/KdFvgxBP47TGQti5AwPqmONimqK+t RvOs46EyS+u5fOEU+hafOFu2RKz2t4HeYn8TJn8hN+lyrK7gu1OLvjbvjNFBckrBrRwu 20x2xGQIyndpCiBVZ473kfv7Eqt89zivdBTney5ks91ReaZApZe6H1+ujtiXI2PkDzuc MoHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=TkrtFJfURyVbLfACCforeqlFlEPRCCTHzagQfiGpr34=; b=wV9+jymkQd4XsuzTVxpSXGNCWbOOWmFqUC569umzA1LBqxUb4eiHGJvXuVHTo5Kf95 zriyf+FXCepPMcckNyV7wNNjHujDAFLEGLV1luUDhEWVXwbTB1b+y2hKiuuwyGzf6qhp c3FY+pGrP83y3eo0Lh+1ABH672dwn1Dk0BU7+yQZCj/ESarkwUyQhk0WjSbu6gQHOav2 Zt9CXXBGmfxFCmsYbB2av4RTYUU72qfmRrxzNUQaiA4YlNV2rrfr6EMOOQGnAXLFwT37 BWBxnlmmWPnV4mqyYUv/tov2l4BZpyWSvsuu+bwD5Kxh+3Ifr4oyrNWXRJMIBPCpEugL E8tQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=DQW+acbH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o3-20020a170902d4c300b00168e8b8c884si6209357plg.56.2022.08.09.05.22.03; Tue, 09 Aug 2022 05:22:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=DQW+acbH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242946AbiHIMFa (ORCPT + 99 others); Tue, 9 Aug 2022 08:05:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236541AbiHIMF3 (ORCPT ); Tue, 9 Aug 2022 08:05:29 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2EC1B25 for ; Tue, 9 Aug 2022 05:05:26 -0700 (PDT) Received: from zn.tnic (p200300ea971b9800329c23fffea6a903.dip0.t-ipconnect.de [IPv6:2003:ea:971b:9800:329c:23ff:fea6:a903]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id E32821EC0426; Tue, 9 Aug 2022 14:05:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1660046721; 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: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=TkrtFJfURyVbLfACCforeqlFlEPRCCTHzagQfiGpr34=; b=DQW+acbHiI+DNWx8RxYLm1KMdzE1ftofn+nT8Wn9pfxe8ICYB90LU0QwnjRDuTzffn6J4I 0Ex019K2lajoxalLZ8bpwmEF2bbLZL4F5XTkghGeLrYPfsGNItaoW/y9PcmV09ND4v2tmy Et3kBFW1fMchXcFikdXoXy7owTAH3Eo= Date: Tue, 9 Aug 2022 14:05:15 +0200 From: Borislav Petkov To: ira.weiny@intel.com Cc: Rik van Riel , Dave Hansen , Dave Hansen , x86@kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: Re: [RFC PATCH 2/5] entry: Add calls for save/restore auxiliary pt_regs Message-ID: References: <20220805173009.3128098-1-ira.weiny@intel.com> <20220805173009.3128098-3-ira.weiny@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220805173009.3128098-3-ira.weiny@intel.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 05, 2022 at 10:30:06AM -0700, ira.weiny@intel.com wrote: > From: Ira Weiny > > Some architectures have auxiliary pt_regs space available to store > information on the stack during exceptions. This information is easier > to obtain and store within C code rather than in arch specific assembly. There are others? Because I would've done this whole thing in arch/x86/ only... > diff --git a/kernel/entry/common.c b/kernel/entry/common.c > index 8c0f334c4b75..a70a0f314aee 100644 > --- a/kernel/entry/common.c > +++ b/kernel/entry/common.c > @@ -317,7 +317,7 @@ noinstr irqentry_state_t irqentry_enter(struct pt_regs *regs) > > if (user_mode(regs)) { > irqentry_enter_from_user_mode(regs); > - return ret; > + goto aux_save; Why do you have to goto and do the instrumentation sandwitch around it at the goto label? Why not simply do if (user_mode(regs)) { irqentry_enter_from_user_mode(regs); arch_save_aux_pt_regs(regs); return ret; and so on? Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette