Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp235509rwi; Wed, 26 Oct 2022 23:59:55 -0700 (PDT) X-Google-Smtp-Source: AMsMyM63yApxCf/8dy8pdYqYdBAaq7zQtVeUpKb3sVeWmCnSHa4zrNBOX3cYiHbDat65+EoL5CoD X-Received: by 2002:a17:90b:3892:b0:20d:4bb5:91fe with SMTP id mu18-20020a17090b389200b0020d4bb591femr8713218pjb.31.1666853995674; Wed, 26 Oct 2022 23:59:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666853995; cv=none; d=google.com; s=arc-20160816; b=buiS7KQC/AOf+q7RpprxbPMhfzn/CPQj7W3ci2SgPh02MnZ7xhiiuKzlt9Y6ZoKoJm vPEnfvWqhY5M/173x0Z3KSC8bb2sRoHO2BHVatI7oRPQ0UYnN1XJy5fJ32MKIma/TVdJ 5Fqb6AAMOIxMlj7l4NYqBMSlLf+Lh7szSi/GEm3DJNNYoF0RMA6w1Jtuff/2yLMZ9G8G Y0/NAoMZ0w43etBTt2F0Cz0tbyWecINND3KSWLZnOwOW+BKDOdl6gFaRvDalZleGRNQ3 Q4ASYlujX5fSLFAnKdBtbJ/AJlf2nOvZ6mhhQyxCk82I+TlS06Pi1+nuKXJjzbBCvIpk CfMg== 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=bmGOTRQNqXiAnfYXVViubqg9EMcrf2AS5/y7ywnYk5g=; b=yQ1zRsaqsp+BuQH4rUhTlLYKOYQrR71CH65n4jabBYsf3TD3oForQXnfqAmOYUJOsI uIvAUgmD26FRiBbbCGvkzSih74zHcuLBRv6KDf2mVcHXYHYEMU+8EZSeIy9Un4EBa+sP Vt/9SIwkFS59lab+5UyvvMOMtNPYUViZwjWhLQkjMljWpyiijvNt/6T/e1WBTqUhWxWq Hd+A9i53CNsdFj+unkOd+gnes+izO6naQEeyJimWS6y/xEEkb0xC2EWZrOO1Coxz+ImV gWM5DX/DgLiZc9bkH+KD1of8tl2Ik9PtsKJU/ilu0kWeMw7AU/r80D8IX73vvlufhJDU sjRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=hX+Mya3P; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mi5-20020a17090b4b4500b001f335a72172si6324826pjb.62.2022.10.26.23.59.42; Wed, 26 Oct 2022 23:59:55 -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=@infradead.org header.s=casper.20170209 header.b=hX+Mya3P; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234755AbiJ0G5i (ORCPT + 99 others); Thu, 27 Oct 2022 02:57:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233865AbiJ0G5H (ORCPT ); Thu, 27 Oct 2022 02:57:07 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 445855F7F7 for ; Wed, 26 Oct 2022 23:55:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=bmGOTRQNqXiAnfYXVViubqg9EMcrf2AS5/y7ywnYk5g=; b=hX+Mya3PW77AK07QPItzJOONTQ eYl0D4zV8UzohuM5l1b3d+CjQNi6AbxRRBmeAcx0275MGoiRjCIxPYdvq8IQAycNX4fESpy78/7kJ ZNx0tPXAhe6eSwFtd2jQt5UVTnAL2MIHDYbwBhWPf59/rrfVk7YC6P/SWXpEuRhDz6x8dxgVlHvGi ZCez/E4myt0QX45d9uNfWOL+0uB1v5TsciADfFOZ8GYsLRvOxUdNwheLOubiN8qScVjltIW0gSh1D QnGN/WJzrdogFKNlj4hqtc1kgnT731YU3UVOLc7SmrYyZwa87rROOEVwOdX5lGfUQiEPHudYlJVcd IzYDY0qg==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1onwnY-00Haur-2U; Thu, 27 Oct 2022 06:55:28 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 4922930010B; Thu, 27 Oct 2022 08:55:22 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 2325929D8226C; Thu, 27 Oct 2022 08:55:22 +0200 (CEST) Date: Thu, 27 Oct 2022 08:55:22 +0200 From: Peter Zijlstra To: Julian Pidancet Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , linux-kernel@vger.kernel.org, x86@kernel.org Subject: Re: [PATCH] x86/alternative: Consistently patch SMP locks in vmlinux and modules Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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_NONE 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 30, 2022 at 09:42:37AM +0200, Julian Pidancet wrote: > The alternatives_smp_module_add() function restricts patching of SMP > lock prefixes to the text address range passed as an argument. > > For vmlinux, patching all the instructions located between the _text and > _etext symbols is allowed. That includes the .text section but also > other sections such as .text.hot and .text.unlikely. > > As per the comment inside the 'struct smp_alt_module' definition, the > original purpose of this restriction is to avoid patching the init code > which may have been deallocated when the alternatives code run. It is not; init code is still around when we run alternatives.