Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp154579rdg; Tue, 10 Oct 2023 06:55:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEqfkgf/sabLhrOCz70kGA/iNh3JWUEgy2ylNPnqRagWerkyzu+288lzc0rSaZ7DIOfzmA7 X-Received: by 2002:a17:902:cf46:b0:1c9:b338:8073 with SMTP id e6-20020a170902cf4600b001c9b3388073mr1566146plg.15.1696946148748; Tue, 10 Oct 2023 06:55:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696946148; cv=none; d=google.com; s=arc-20160816; b=cyL2D9h68KZXnKknB4kgoVclibZ19qTgL7rkuShWOVl3TVk3LA58psbpx0106ck5Jl 3LL0E3UAcJuYcM81dNxhYYgJscHXxM7KEN2guMH11gLYkgP0KcvpIZskQ8HTe5DsFaOp onzhWCEJwBBbBKYeIot4mIRmEf4Ljsfrqn7meuK4IOm98iDLLubyJtJ6wxowPsWDAwoD vUUIjUi8fzrMxTZYhw8xfpG61V+wdFvR97OLZPXXcQrrnT9lFLGy8eY3IfSsV+OgE0CL Wp+ZZZquNtDHrc5lMq1nCz4CFFDhYP64L1PhFGoNuXY/GuMSv4Lj9qKaw55P1Ds30ra1 /icg== 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=S2MeW9xBBP5ir4MyshyKYBTdw1uG9obgtaYQpOlwGak=; fh=mUf2ndWDL5c84ldV6DszTy3j42/aMLRyYOLwUcEDGhM=; b=gCFEP0mGMcZRHJBvLxgWLm9ZVyLdbZdXlRqvpJdnHePFzM7HZoNJcMYql6CNEATYfB /GQYtcFKujUVM2iKLocOjCU6AYv0I7unPLUWKKs9PtIVM8aSUM5EWdmlb1iETpP+M72b kFzxcNeXmzRsDyBkJXUJHWIvdPCrxZIXghnR+dmCgb+blXkzEeEWM7gE2qV8O4vSP/XW OroNl9e4pBZDcFevqZnch9rIJeYfXNoWwwZE5cfkRGa+LCQqFjrt68EiAaCEunfTPITd VxV5i1V0Iod7nC39oP/QXJt5A/aYCj2M0FPiLWx/Wg2VtngzyoYvMmYArc9B1R7U0UDI 6TQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=X22LW5WC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id j9-20020a170902da8900b001c613b5e778si12039435plx.557.2023.10.10.06.55.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 06:55:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=X22LW5WC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id BF41F80CF513; Tue, 10 Oct 2023 06:55:27 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232298AbjJJNzU (ORCPT + 99 others); Tue, 10 Oct 2023 09:55:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232109AbjJJNzT (ORCPT ); Tue, 10 Oct 2023 09:55:19 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A335E9E; Tue, 10 Oct 2023 06:55:17 -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=S2MeW9xBBP5ir4MyshyKYBTdw1uG9obgtaYQpOlwGak=; b=X22LW5WCmFCOs0EIQlxClY2wvI 8hEg5mMCJLwgn58uuFizRFpQMS58hRoUjXq62gWqtShVnZ8VbJAYcS/SbRoP5QWRU2k1ZWwT5cBSc 34bz+gbt84eT31L3BrNmjcamRNtclt2f+TA5zNVWpnmMaaMxK6G0cDEeYnP7i8Yu04Yku/+3lJrEi kASq2PzPKtHuzVLC1HW0MnJlTLgB8hTorast+sqQdXVqAt79xhJvQJiKXZ+U2WZtxDQdnNtvAlFoC wSUYANUEkDMeNgQOuFC/sfDX+9IMeYAuSIrNoWPzunNXL8b+dmoGN9pZI2adiznG6PIrdoORzUy93 hUqhqeyw==; 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 1qqDCK-004xqT-W8; Tue, 10 Oct 2023 13:54:57 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id A6E4F300392; Tue, 10 Oct 2023 15:54:56 +0200 (CEST) Date: Tue, 10 Oct 2023 15:54:56 +0200 From: Peter Zijlstra To: Borislav Petkov Cc: "Kirill A. Shutemov" , Thomas Gleixner , Ingo Molnar , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Andrey Ryabinin , Alexander Potapenko , Andrey Konovalov , Dmitry Vyukov , Vincenzo Frascino , kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org, Fei Yang , stable@vger.kernel.org Subject: Re: [PATCH] x86/alternatives: Disable KASAN on text_poke_early() in apply_alternatives() Message-ID: <20231010135456.GL377@noisy.programming.kicks-ass.net> References: <20231010053716.2481-1-kirill.shutemov@linux.intel.com> <20231010081938.GBZSUJGlSvEkFIDnES@fat_crate.local> <20231010101056.GF377@noisy.programming.kicks-ass.net> <20231010131054.GHZSVNXhruJIx0iCzq@fat_crate.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231010131054.GHZSVNXhruJIx0iCzq@fat_crate.local> X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Tue, 10 Oct 2023 06:55:27 -0700 (PDT) X-Spam-Level: ** On Tue, Oct 10, 2023 at 03:10:54PM +0200, Borislav Petkov wrote: > On Tue, Oct 10, 2023 at 12:10:56PM +0200, Peter Zijlstra wrote: > > Now, obviously you really don't want boot_cpu_has() in > > __VIRTUAL_MASK_SHIFT, that would be really bad (Linus recently > > complained about how horrible the code-gen is around this already, must > > not make it far worse). > > You mean a MOV (%rip) and a TEST are so horrible there because it is > a mask? > > I'd experiment with it when I get a chance... That gets you a memory-reference and potential cachemiss what should have been an immediate :/