Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1606908ybi; Thu, 20 Jun 2019 00:22:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqyIRJTKbjwTAvkM9xsd9m9OV7+iAbbNhqgw5p7PxPEvCwFipQa9IsLNz9741GD+ZCjMDcwk X-Received: by 2002:a62:6083:: with SMTP id u125mr1662161pfb.208.1561015344965; Thu, 20 Jun 2019 00:22:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561015344; cv=none; d=google.com; s=arc-20160816; b=prVdiBn+gH+1pDV0hec2zifmdc5IEEn2wEV8++SoplRa0QHcBTz5LOwjW6rU+pC/ci yqGlNblJdcQzVdJcR/8aTZfmFNnQEq7x+vlXdwoFM9VA1n/fgqRzQKfg57lk0Q3zR62L 8UdhETtes/h1gUIESO2GKKihl0uXDni2k8Syy+567SvgJJyVsOd9mX0V5RoOcMgpNEht 1sG+Rprdl4EuVPu2faprjALZsnPuyUPg4/+iO+Nha1rGQ+gKoS8zz2syAL04Jg2Rxsqk jweDXgppIxMzB7SfnD3umZLkWxecfCBPKq0s8QA0U3pVsJuBWePuCBhTtHXAumDFm0cc rNBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=flv0ZjAK0TpjANrHI4sAx0FN5zH4ci8KQMG+jBdIYOU=; b=A6aUykj7hr9RpVEXJnjqUy1DuQ+x+H/lyb5F1h90tFxejQWw4aduuvKq9IvWdO5G6P 1vpK8BTZG90KFEfSAc9ziDJkxjFjbwxawT+GO/zrrZwb62eyYiS5Alim+/MbZy6e/WdW VLo9MOCg+3Q+j+5Ck+jeJ3Hrdur+1iSYKc4fTXg3XtPHyyLmJkiNnsxK6BE2OvIrCNSo FGXOE4fse0eicn4Om2bhnY4G9xfhBK3UmlE/R+IHb4y1RQyqCEFsaSCzcYr7yhvBJHai hc21aYp1J8cmLQGPXGabpB1cB0r8A+ryj2nOWUAq1sv4RhrvDEAFP4Zc4eUm31hlA6j8 p/ZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=PxDF4z1f; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w21si19069142pff.263.2019.06.20.00.22.08; Thu, 20 Jun 2019 00:22:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=PxDF4z1f; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726480AbfFTHVv (ORCPT + 99 others); Thu, 20 Jun 2019 03:21:51 -0400 Received: from merlin.infradead.org ([205.233.59.134]:39530 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726126AbfFTHVv (ORCPT ); Thu, 20 Jun 2019 03:21:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.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:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=flv0ZjAK0TpjANrHI4sAx0FN5zH4ci8KQMG+jBdIYOU=; b=PxDF4z1f0ZvO6hgDdo4Rd03Al tyx+x2reUwA9mioDpNaCR2sX77t0seV4VwXFyUjVHa8eQPaHA75HsaWrXlPCl0MgIoUUvrnIauZob pG9lKFb/acLF37vWz4zmYwzuh2Uyf5RMeKJB+foQ6mG/Wm+ym7cSRNMKnvYQp7PxkraKwm6gGbt+N H3Lre1tfXfl1GJQeMBKdaQ+fUesg4+2eUUmUKUhGQeKE0oC2mgt76DlmCuyTWxvApWK0ASFdee7X4 Jo9Ka3CjmW9wzMd2oLh+8LJYTBj1jbeQ3fZkaxbmngMXGv74Nfkei0pxlNoX1S7abhP5Dx9ubhnYC 5m0sCWTIQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1hdrOE-0004G4-0J; Thu, 20 Jun 2019 07:21:46 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id BEEED200B4CB3; Thu, 20 Jun 2019 09:21:44 +0200 (CEST) Date: Thu, 20 Jun 2019 09:21:44 +0200 From: Peter Zijlstra To: Vineet Gupta Cc: Eugeniy Paltsev , "linux-snps-arc@lists.infradead.org" , "linux-kernel@vger.kernel.org" , Alexey Brodkin , Jason Baron , Paolo Bonzini , Ard Biesheuvel , "linux-arch@vger.kernel.org" Subject: Re: [PATCH] ARC: ARCv2: jump label: implement jump label patching Message-ID: <20190620072144.GS3419@hirez.programming.kicks-ass.net> References: <20190614164049.31626-1-Eugeniy.Paltsev@synopsys.com> <20190619081227.GL3419@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 19, 2019 at 11:55:41PM +0000, Vineet Gupta wrote: > So we ensure a patched instruction never crosses a > cache line - using .balign 4. This causes a slight mis-optimization that all > patched instruction locations are forced to be 4 bytes aligned while ISA allows > code to be 2 byte aligned. The cost is an extra NOP_S (2 bytes) - no big deal in > grand scheme of things in IMO. Right, so the scheme x86 uses (which I outlined in an earlier email) allows you to get rid of those extra NOPs. Given jump labels are typically used on fast paths, and NOPs still take up cycles to, at the very least, fetch and decode, some people might care. But if you're OK with having them, then sure, your scheme certainly should work.