Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp6395617rwb; Tue, 9 Aug 2022 14:42:01 -0700 (PDT) X-Google-Smtp-Source: AA6agR6R+u3kAJNzdjV/8TYkMHKwzfgV9C5sfEaXhdv/R7IyuXd2MY/ti0IbXEQxZBLwBDdpzY/I X-Received: by 2002:a17:903:110e:b0:171:3114:7112 with SMTP id n14-20020a170903110e00b0017131147112mr1681352plh.114.1660081321288; Tue, 09 Aug 2022 14:42:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660081321; cv=none; d=google.com; s=arc-20160816; b=WbvyPpiLvszr0ESzP1aRPh6uKbUz8P/Nu4wAqga5dPKLDVZB5SZrUxd4AXcc2EJfHQ S20DuTZ+6csI0zGeM5GX7S4tIb2yT5u3CgVxJm02i84u9cjLWhW5zwpDQNpRGwCbeydG KYaPpzyVsOkLlW8veb+Xu9N5GxKdnmYcJT10NTxqwa8/4aNvYCCPPbmvs3vFpSqiOQIu 1NpCQc9W5/4OnVdOJ0Zn5eXLSUnTJ1UFsANuztgi8a4jUpTI20ot/mUekZ/iuvfCKljy EBRvskHOComVfKNNUBrBkyN8dC30Xbc5Bgy6qpnw2fSQaHuOQpzyPvrWYjHyuPVbWDur oaxQ== 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:dkim-signature:dkim-signature:from; bh=iHxEgVmEh6JR00sxeNhAi+8y/A6SXxBI7puVDuB6aJ8=; b=camaKZjvLXxlxC8wdhp5BYtRyeN6Lqt8yUsoyEpevJvNQkt7PGs3SHgngn5S3LGV8p NkdQpOH0j4k6ifdI9LSK394OV05tCYmVics7CiEcvW0LxKSPD0m1Knk1ICqNR3pNFDHl MIDDT2Ivz9MbCyz5F2CDYmXeqjEvoWysviFOSrGxJjlpx5UlbTx6HFC4ZHImCSVR7RIa 3q5LAEYEa6LeptgBoUL/UH2IBLutNUd97hqMvAapaQH3fnQ2eZtVh7mF6KFmizs3N+tv beT4O7uVQeYDZgbT9gvN9QY8hIJR7YdFjX/1XYa41uS4b0IAadPiPlyGAjYC2hkdVoOa HRTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ak0yiCbd; dkim=neutral (no key) header.i=@linutronix.de header.b=9aFCsYAt; 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=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n13-20020a170902d2cd00b001637dbe1bc4si16663909plc.44.2022.08.09.14.41.46; Tue, 09 Aug 2022 14:42:01 -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=@linutronix.de header.s=2020 header.b=ak0yiCbd; dkim=neutral (no key) header.i=@linutronix.de header.b=9aFCsYAt; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229604AbiHIVOy (ORCPT + 99 others); Tue, 9 Aug 2022 17:14:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229584AbiHIVOY (ORCPT ); Tue, 9 Aug 2022 17:14:24 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2DCE961B12 for ; Tue, 9 Aug 2022 14:14:22 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1660079660; 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=iHxEgVmEh6JR00sxeNhAi+8y/A6SXxBI7puVDuB6aJ8=; b=ak0yiCbdsTBynHZdeYORQKegIa2UyIGI6OUCB3TgNQKPV9Ho42GSJLH3vuzu6/4dAW9cMd s6bVFeZZ+y33hTAGFv9Lvp4aAVf1uC88Ykrj99TP40bppD3C9Ip8gfWdxrz+299BacacYl pQti81UurRaXYUnnvKs4Rf+FQDyq0mc/Ip9v901xTjokpF0jrX+6wSm8IdNyaYyHgWOB9k nFOsnhHy+lK3rWIGhzmGAgopj6g+/E80fGnDBO68iMVESezy5PW5u/xftqfRq8dTV3iqSq Esxk1vuJf2IC39v/hvkRmU25L9c4OBhqVxkyk+VvwknrM/pd+Fx9x1UySMnDmw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1660079660; 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=iHxEgVmEh6JR00sxeNhAi+8y/A6SXxBI7puVDuB6aJ8=; b=9aFCsYAtz0ZZLUdgN4XFNZQaNXmv6L6JEYVFHkP49xTswpUXVQvtba2CAkxREXoq2+rPy2 VDS8ujDJOTlS1/AQ== To: Borislav Petkov , Ira Weiny 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 In-Reply-To: References: <20220805173009.3128098-1-ira.weiny@intel.com> <20220805173009.3128098-3-ira.weiny@intel.com> Date: Tue, 09 Aug 2022 23:14:19 +0200 Message-ID: <87lerxqfv8.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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 Tue, Aug 09 2022 at 20:49, Borislav Petkov wrote: > On Tue, Aug 09, 2022 at 11:38:03AM -0700, Ira Weiny wrote: >> Thomas did a lot of work to make the entry code generic. So I was >> keeping that work consistent. This also helps to ensure I did not miss >> any places. > > How about you worry about the other arches when you actually cross that > bridge? Ira is right. If we want it for everything, then the generic code is the right place. >> I don't believe this is correct because instrumentation is not enabled >> here. > > Why do you have to run > > arch_save_aux_pt_regs() > > with instrumentation enabled? > > Patch 5 does > > + struct pt_regs_auxiliary *aux_pt_regs = &to_extended_pt_regs(regs)->aux; > + > + aux_pt_regs->cpu = raw_smp_processor_id(); > > only? > > Why does that need to run with instrumentation enabled? There is no reason and actually _if_ we go there then this _has_ to happen _before_ instrumentation comes into play as instrumentation might want to have access to extended pt_regs. Not necessarily the cpu number, but the other things which need to go there for a real reason. Thanks, tglx