Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2180304imu; Thu, 10 Jan 2019 09:33:40 -0800 (PST) X-Google-Smtp-Source: ALg8bN4v/bctwqGtOBIxpovPVuG+vt5WvwdvQ7if5QA0ucfdEAPPqUrCETvJURr/EP43FsiCcPnz X-Received: by 2002:aa7:8354:: with SMTP id z20mr10919383pfm.81.1547141619957; Thu, 10 Jan 2019 09:33:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547141619; cv=none; d=google.com; s=arc-20160816; b=wt/RfLXRX8CaOmRRr3xiHzsfFneJn4gAtmpOvSHFIspZP6VhzpU5a2Tcb7vn1hmO51 3ExVTryswOZojVlZ3hfQgvYvzqnUVgsF4qFIgllJ5ypgxqGRmgpuEayI3wC4+iuycq/X N3NYix26Iz5GAL+QFquzH8uoFxL9Wnf1zjEXpmQ97HuJPuS0zfqRLSrDHSI/2cxsjpMf Xn5meHjSyQIPPaWVeGUSn+/r/fTaAHPTCWtCJb4ljWA+mteKzRsME66h9iakKEgD1z/g o7S170n8N7z/z0ExPN6phz4hJHbFA6tmBauOUh/7W5VmCVr/Y6+xNw+Zu4jfZzxPIzWK RXjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=nH5aONxUScUHVmaCDAij2sf2edxD9ysnfGrexA2u1PM=; b=yaDqvZR9DPy9Ktdx7N5AIAsvWV+i+a7GE30e79NejjXsPUEroI0ekkZfLCxNIRnhRS G42FKEJCZOz57vwTjpoNtjYZkZDc/1sUzs1T2vBn4VLL+mfM5UY4o0BHLtpAuJ8locAJ 4jz8hyxZR+/2BS2akH3BhH6/LWoODGT2Tfcw0Pwak70A+NV3v3eZwIBSS9HlhD87mUTJ yWkRTAp4g5NBJBlx/GbsQeBJGHIbqfHaQgNFYGTcY6QGU6xJeHcdPE8QbMQGnkdJI6b4 0iG0prXfGs4kSQn6uNuIeE3TT4AldHgzw94793ipxcaDQrLewzYtZhZ7eCdr6TQqrTos 7Aqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=ON8SiR4N; 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 d7si70882500pfo.108.2019.01.10.09.33.23; Thu, 10 Jan 2019 09:33:39 -0800 (PST) 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=pass header.i=@linux-foundation.org header.s=google header.b=ON8SiR4N; 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 S1730264AbfAJRbw (ORCPT + 99 others); Thu, 10 Jan 2019 12:31:52 -0500 Received: from mail-lj1-f195.google.com ([209.85.208.195]:36711 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729799AbfAJRbv (ORCPT ); Thu, 10 Jan 2019 12:31:51 -0500 Received: by mail-lj1-f195.google.com with SMTP id g11-v6so10458179ljk.3 for ; Thu, 10 Jan 2019 09:31:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=nH5aONxUScUHVmaCDAij2sf2edxD9ysnfGrexA2u1PM=; b=ON8SiR4NMMp+UeHHVT31z0qsBGUFss7huwy/1N+NYGJwWNQ7eNJBxrDPMe7WNWOqD/ QAFfDMnXzEf8CW0/rWlmTzaUD82u4BAlHIE8KRGEkkHoIkIRH26am8FbOPNq2IUmS2oT Q4zH7D2kNvrVnxEF3rKj1LrCoJcOKxAkax5rI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nH5aONxUScUHVmaCDAij2sf2edxD9ysnfGrexA2u1PM=; b=g0awKF0PYIaf9qzSwCRso/z6pL64/wFjKTgxww2J2/74Wx7xsXzCBmpYfPFsuplsNu SItAN2Z9f5XyIdZonljFXsMpyWm+VNfpd0HMnDTOFOUqxas6nS1tahzRhMlHOqM7etPa v8O4Hj8iVnOYVKakVakV7xwEE/IGj+rfF1tgEBY6s6llXWSt6+fX+6trIysuBXw1eLlT vsUoRD2hXgLyFDn8Rg992fMc/bZ/qPoDC4YxE+dJdRNoCVpvc3MPIOmvidKZedkz2jPf M/NkMIj9rXSmvgqpqH6BOQWFij85FYhRUS6dr7YIFRVU/q21Bv3LFtfSbDLeZ041X3B+ mS8A== X-Gm-Message-State: AJcUukdCmW8A+oTJsyRJRFxZ4hG3N8PwVSM1Nr6hncj449yr8sEPQcVs 0GZ/ttSNmzo9mX/GVbciMKuOpVzKBUzJvg== X-Received: by 2002:a2e:9017:: with SMTP id h23-v6mr5638774ljg.71.1547141509230; Thu, 10 Jan 2019 09:31:49 -0800 (PST) Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com. [209.85.208.176]) by smtp.gmail.com with ESMTPSA id c22sm14257514lfd.88.2019.01.10.09.31.46 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Jan 2019 09:31:46 -0800 (PST) Received: by mail-lj1-f176.google.com with SMTP id k19-v6so10416802lji.11 for ; Thu, 10 Jan 2019 09:31:46 -0800 (PST) X-Received: by 2002:a2e:9c7:: with SMTP id 190-v6mr5757495ljj.120.1547141505693; Thu, 10 Jan 2019 09:31:45 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Linus Torvalds Date: Thu, 10 Jan 2019 09:31:29 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 0/6] Static calls To: Josh Poimboeuf Cc: "the arch/x86 maintainers" , Linux List Kernel Mailing , Ard Biesheuvel , Andy Lutomirski , Steven Rostedt , Peter Zijlstra , Ingo Molnar , Thomas Gleixner , Masami Hiramatsu , Jason Baron , Jiri Kosina , David Laight , Borislav Petkov , Julia Cartwright , Jessica Yu , "H. Peter Anvin" , Nadav Amit , Rasmus Villemoes , Edward Cree , Daniel Bristot de Oliveira Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 9, 2019 at 2:59 PM Josh Poimboeuf wrote: > > NOTE: At least experimentally, the call destination writes seem to be > atomic with respect to instruction fetching. On Nehalem I can easily > trigger crashes when writing a call destination across cachelines while > reading the instruction on other CPU; but I get no such crashes when > respecting cacheline boundaries. I still doubt ifetch is atomic on a cacheline boundary for the simple reason that the bus between the IU and the L1 I$ is narrower in older CPU's. Also, the fill of the L1 I$ from the (cache coherent L2) may not be a cacheline at a time either. That said, the fetch may be sufficiently ordered that it works in practice. It _would_ be absolutely lovely to be able to do things like this. I do agree with Nadav that if there's some way to avoid this, it would be good. I'm not in general a huge fan of compiler plugins (compiler instability is just about my worst fear, and I feel plugins tend to open up that area a lot), but it does feel like this might be something where compiler tweaking would possibly be the cleanest approach. Linus