Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1915978iob; Thu, 19 May 2022 19:01:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxuql1iLgcFLrZNcUM7oQB0RNPLRDmMLkwCQ4LBvlH5swmMj7GcN04ZzN4BbZCMA+3/jBC4 X-Received: by 2002:a17:907:6d8b:b0:6fe:874:25bf with SMTP id sb11-20020a1709076d8b00b006fe087425bfmr7093299ejc.734.1653012076153; Thu, 19 May 2022 19:01:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653012076; cv=none; d=google.com; s=arc-20160816; b=EItCP6BqmsAVoIVfh0mhs9n/9HRMx+P0XsSlimkortiyU1aV9SFh3bcyAJ1B+3aJMG +gNP0vq0TrJUqvCUu96FkxZMtemlBT0xuXHC1eEPmpsEZmqtBwQSZymw/mulDzd8hwBC oHFmI2iIay8HWiyp+zfWwdlgFQ8gUE1qmlstYPmw3nnHaPO+JTCCue8kTFq4xm4gUNQy 5W3aiARWWEM0MkwMF5GEfzj6T1J9cQ9RwxqqEwDz1a8Wv9XLrn/X12Ibd0JS0StDiY3S nzD546P1jE/kyv70U1EWj5K/rb/npF5pecAce8V4Xl9v7KeoayZ4subQYYegYhoIi7Og GC6w== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=2WGn3U5iWYbqhAEYerCkhKo3tyszE5fO2isMfocp72s=; b=u0C/fKXKxL6J7RBmD/iv7N8taJ9vSrttYxKJAFO4GsV65Eok0hJwp2xehLm08WTgLI LguHmBSAysSAMJ5L6yHHvIhvET9C9Z87y/ObipOkFy29wwayjGFba7vLNCSizS4Tmk+s dFG/tIQirin6vSNrjTB+Tr2pKKgk0T4Vy7rzDqOt1Sow4NySsz/XciJVnFAjD96v0Azm HzJ5D+WD7T+NfTaBkAnoH9Hxi90juP8gqxiibuOuygo5xdUc0Sha6PiisJoSMrWoVelH j+9YcsN+lsoKwRsaGkN5tfAqF63lQtYf8RwWa2dSSV5UBPrGy2aIwD+zPrHv4gg6VhSm h/XA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=MqRC9ZtB; 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 hv8-20020a17090760c800b006fe7c87ac4dsi7639186ejc.163.2022.05.19.19.00.50; Thu, 19 May 2022 19:01:16 -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=desiato.20200630 header.b=MqRC9ZtB; 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 S234854AbiESHjA (ORCPT + 99 others); Thu, 19 May 2022 03:39:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232733AbiESHi6 (ORCPT ); Thu, 19 May 2022 03:38:58 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1398A7E29; Thu, 19 May 2022 00:38:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=2WGn3U5iWYbqhAEYerCkhKo3tyszE5fO2isMfocp72s=; b=MqRC9ZtBC0maLPeCbKteZ8lGuo /1I+a4DLnSkHaU6Ku3WgpUTD0sh0NOBM2nHYNQ/MoIen0wmdivi/AGROJYerl0XSwwmK0FTC9jtpM uR8G03NFam87OKw8l2TL+1ynj4ud3YZUQkq4rAfC5UHTYasK1fyuupcqB+c33dmSSc+/uWMeq21Mh mWboozwGQ5XQJvvsmomxwlk40EHk/NujNUwBefWCvBe9V9WvbMMUNJuA+Nit6VJu3yS3/wCfp1qNf 7PzSvwWJfyYutYO/d5sAc9iYvMN6DM9WbdNd7PBRTeBnNAjB+5JLcNJbPeJ68dbQY7poPQEYLXIlv ypjazLKA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nrajr-001leT-8U; Thu, 19 May 2022 07:38:27 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 084EC980BF7; Thu, 19 May 2022 09:38:25 +0200 (CEST) Date: Thu, 19 May 2022 09:38:24 +0200 From: Peter Zijlstra To: Song Liu Cc: Song Liu , Linux Kernel Mailing List , bpf , Alexei Starovoitov , Daniel Borkmann , Luis Chamberlain , "Torvalds, Linus" , "Edgecombe, Rick P" , Kernel Team Subject: Re: [PATCH bpf-next 2/5] x86/alternative: introduce text_poke_set Message-ID: <20220519073824.GA2578@worktop.programming.kicks-ass.net> References: <20220516054051.114490-1-song@kernel.org> <20220516054051.114490-3-song@kernel.org> <20220518170934.GG10117@worktop.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit 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,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 Wed, May 18, 2022 at 06:34:18PM +0000, Song Liu wrote: > > > > On May 18, 2022, at 10:09 AM, Peter Zijlstra wrote: > > > > On Sun, May 15, 2022 at 10:40:48PM -0700, Song Liu wrote: > >> Introduce a memset like API for text_poke. This will be used to fill the > >> unused RX memory with illegal instructions. > > > > FWIW, you're going to use it to set INT3 (0xCC), that's not an illegal > > instruction. INTO (0xCE) would be an illegal instruction (in 64bit > > mode). > > Hmm… we have been using INT3 as illegal/invalid/special instructions in > the JIT. I guess they are equally good for this job? INT3 is right, it's just not illegal. Terminology is everything :-) INT3 is the breakpoint instruction, it raises #BP, an illegal instruction would raise #UD. Different exception vectors and such.