From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1DDEE1CDFCE for ; Wed, 9 Apr 2025 11:50:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744199441; cv=none; b=eOSpZ1rfI5v3TZSMNkYwQ1oB6ZVgVzX8eSzvfJotXCE+4zkVzX7fAg2eWAY6w9eF6N0vnGsZW5VgNpCiY4WUhCQbSBjJrTq1gt0lm+xaNuriUvEgiVpEnOOG8cHTO7Y5PL1py9cugBWw7NK9ohpvI/jdvKjf7u18vGUBlJlWxYs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744199441; c=relaxed/simple; bh=iz7hGUeThO2pOoFkEYLyC60rVxruxbslzIpusyrw9nU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=eNeA1Vube+elejSkqLNINEQym/wDLHZ2BMlit1SqKRcorTOsY3q9Vl/fnBXjK+o9+Fl+5VgsuJWZXzj+XZFvdJ1qDmnFvYGVEI36OEe/Ugm2BCV1Tf9YzbtBJfM2wELskJqOV4lMVVFeQqMng+1lu976Dp/XaXMCSx9qbjD2APY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=gUQ0NhGh; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="gUQ0NhGh" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1744199438; 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=SMmVG5+2jOdZ04N8c2MqDN4J62ryFfX+ENG76OzBjCU=; b=gUQ0NhGhr02L3zt2Hhi33SgYjFVp/WC3CzsBNTQIWyw39PrW0Y1zC7UxbwjlBlHdEX6G9X wOz9olAWd1OAaMgzYcg/3pa5PAxe+9VW0ApdLa6GBExxobFwuN6crmhcFaTGYQFSq1M8qx uPN32MfDamPdbSB5S9Z/nFcgvK4Vqmo= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-655-mNAEURH2MSySMaaGVWqqiw-1; Wed, 09 Apr 2025 07:50:35 -0400 X-MC-Unique: mNAEURH2MSySMaaGVWqqiw-1 X-Mimecast-MFC-AGG-ID: mNAEURH2MSySMaaGVWqqiw_1744199433 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 20E791955DCC; Wed, 9 Apr 2025 11:50:33 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.44.34.54]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id 3028B180B488; Wed, 9 Apr 2025 11:50:27 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Wed, 9 Apr 2025 13:49:57 +0200 (CEST) Date: Wed, 9 Apr 2025 13:49:51 +0200 From: Oleg Nesterov To: Jiri Olsa Cc: Peter Zijlstra , Andrii Nakryiko , bpf@vger.kernel.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, x86@kernel.org, Song Liu , Yonghong Song , John Fastabend , Hao Luo , Steven Rostedt , Masami Hiramatsu , Alan Maguire Subject: Re: [PATCH 1/2] uprobes/x86: Add support to emulate nop5 instruction Message-ID: <20250409114950.GB32748@redhat.com> References: <20250408211310.51491-1-jolsa@kernel.org> <20250409112839.GA32748@redhat.com> Precedence: bulk X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250409112839.GA32748@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 On 04/09, Oleg Nesterov wrote: > > For the moment, lets forget about compat tasks on a 64-bit kernel, can't > we simply do something like below? ... > --- a/arch/x86/kernel/uprobes.c > +++ b/arch/x86/kernel/uprobes.c > @@ -840,12 +840,16 @@ static int branch_setup_xol_ops(struct arch_uprobe *auprobe, struct insn *insn) > insn_byte_t p; > int i; > > + /* prefix* + nop[i]; same as jmp with .offs = 0 */ > + for (i = 1; i <= ASM_NOP_MAX; ++i) { > + if (!memcmp(insn->kaddr, x86_nops[i], i)) > + goto setup; > + } > + > switch (opc1) { > case 0xeb: /* jmp 8 */ > case 0xe9: /* jmp 32 */ > break; > - case 0x90: /* prefix* + nop; same as jmp with .offs = 0 */ > - goto setup; OK, I guess we can't remove this "case 0x90" because of prefixes, please ignore this part. Oleg.