Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2529341imm; Thu, 7 Jun 2018 12:11:14 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKjDxPulEG8RptDj3d3ALYIveBf1pMi0ezVeE7TzVf2XBaFJyEl/ki6LbaFgOo/PqJExk20 X-Received: by 2002:a17:902:74cc:: with SMTP id f12-v6mr3293089plt.7.1528398674431; Thu, 07 Jun 2018 12:11:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528398674; cv=none; d=google.com; s=arc-20160816; b=SYJICeTCRbRsogogBT8WLKLDr/BLqzaFoj//Ci9VVqu1pG25GSmGIoyndPx5eLKARX lx9GJwS4I065wYXoxhaewAtlhs1WCTVERZb26LNZFeYdl8ZkhfeBbrsgifyP6kk+7TiX 5jflHzopc6tMcX6jFhVXGWTndh3CYHhEuMO2cQarFUgQBCHNkfoI63gwUUPV5M/V5qYI v7O27HfkaHS219YsQsjFVHg8iQZ1SkjDwx4YyzedOpPP9r8ji487VJIp++wUPxpXFBb3 eYN1Bmk+k8QykCdskDzGYbom+Gu3sEyUVuM6D3p8t54LGT5GArQvr48uT5xFcI4oJfCQ tU0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=FcfgBErQhhqUdwC7MmxzqpQdpQ49HzcC5H0Q4cAOYV4=; b=xSuBRVCY6hlf5N5V6uHqWXxZkxAM0dml327E5rspONbv2YpOut+DbkCwEqasuXrYet se1AAq1Psoe/ShR/aBoce4ZDgQ1+HGc0eNkUl5smWKiRSPMHDpULa2PmwKpZ3YUTxdbo 0zF07cGkBOF6VSyotrULnToaUi+DXlUNXsQg9Jqm2RRdnYJosrlwVUxlv5yX/xlNHQ90 wjriUYUdVTU2oAJXLzDmNN7dMkFIC5SSNGFiglFG19FphbzeRHWiGhZ8y3vgg79GDfRT p+qKwx7ZHa8vTAZHb8LX45cHdEckhBuAkvKxtgMip7oh7vyuFZ24BzYTq3ikh6HHmgM3 E/eA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=hy84fegm; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v16-v6si38198981plo.186.2018.06.07.12.11.00; Thu, 07 Jun 2018 12:11:14 -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=pass header.i=@google.com header.s=20161025 header.b=hy84fegm; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936295AbeFGSc2 (ORCPT + 99 others); Thu, 7 Jun 2018 14:32:28 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:36183 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934029AbeFGSc0 (ORCPT ); Thu, 7 Jun 2018 14:32:26 -0400 Received: by mail-pg0-f66.google.com with SMTP id m5-v6so5154233pgd.3 for ; Thu, 07 Jun 2018 11:32:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=FcfgBErQhhqUdwC7MmxzqpQdpQ49HzcC5H0Q4cAOYV4=; b=hy84fegmspnEyTkhv9UqP2o7jqyEuLYywYsVJVFv7sj8ZD7xx8d5bjiRGwg4aXyI3w h4Ic0if2Wf/dYg7EDzQIBli+rr0HZFDSBA7KP6MeXcQCcXEIqqPB60trHRrQigKjPLU2 bOKlWtkdzPLSVt009d/DksPDXyS2XZax0beyorF2SFNL8/e8JZr35/RFwj/CiYE6v+vV hKu8Y6g0Q1CyC/7N+hI89JFh9SO4CXBu3kBzKTfAdaNPssS74opYC09jtu5dR4+h5BDJ dDBLDvhTONVOTfioChXt5c1wPttOafHxrV9P8CQsSJIrnQxQ99+aXst8WwEfQ87w2Oya vR1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=FcfgBErQhhqUdwC7MmxzqpQdpQ49HzcC5H0Q4cAOYV4=; b=BkUSJlRxTP9RbLYxI5agKo15J1tksqOkchrd8obayWKECzv8N2u/1zROf5VnYJMW6h e29A0i5Cd0nIRKSDboSBJuYNy3D4zFxcYwhAkEQ1dRRZ6Jvq76q9aXJHoQFHji7RBVnM gr+BC05BKzC6LvbfJoGgTbY3Xh2Cr1ZexZwXXFLzAKPlAV+h65iEYL8surGcgZvVdl+Z 6ZIKO+XdpLPP6cKuRn1m+STU1bjiwkQrb1esgFiW1tTc5bEtip8McKdg2gpLCR7qdeNi 9g2Eace9qrhe5s/U85fusw8KE9t4nJBw1LoLdIFRABcPnKO644CD79QnU5J2ln672f57 da+A== X-Gm-Message-State: APt69E0FK/3K60OLy8wPFBmCrh1+1clrSvY6wZDxYbp/ugYzEQaZ2fxF ownAtMvrKNAq8VTRJNIqHNmgMA== X-Received: by 2002:a62:d2c3:: with SMTP id c186-v6mr2768276pfg.44.1528396345695; Thu, 07 Jun 2018 11:32:25 -0700 (PDT) Received: from ndesaulniers0.svl.corp.google.com ([2620:15c:2a3:1:d33:166f:5b79:14b3]) by smtp.gmail.com with ESMTPSA id n76-v6sm6932739pfg.98.2018.06.07.11.32.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Jun 2018 11:32:24 -0700 (PDT) From: Nick Desaulniers To: akpm@linux-foundation.org, hpa@zytor.com, mingo@redhat.com, tglx@linutronix.de Cc: linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org, virtualization@lists.linux-foundation.org, astrachan@google.com, manojgupta@google.com, ghackmann@google.com, sedat.dilek@gmail.com, tstellar@redhat.com, keescook@google.com, yamada.masahiro@socionext.com, michal.lkml@markovi.net, linux-kbuild@vger.kernel.org, geert@linux-m68k.org, will.deacon@arm.com, mawilcox@microsoft.com, arnd@arndb.de, rientjes@google.com, acme@redhat.com, pombredanne@nexb.com, aryabinin@virtuozzo.com, kstewart@linuxfoundation.org, boris.ostrovsky@oracle.com, jan.kiszka@siemens.com, rostedt@goodmis.org, kirill.shutemov@linux.intel.com, ard.biesheuvel@linaro.org, akataria@vmware.com, brijesh.singh@amd.com, caoj.fnst@cn.fujitsu.com, gregkh@linuxfoundation.org, jarkko.sakkinen@linux.intel.com, jgross@suse.com, jpoimboe@redhat.com, mka@chromium.org, ndesaulniers@google.com, thomas.lendacky@amd.com, tweek@google.com, mjg59@google.com, joe@perches.com Subject: [PATCH v3 0/3] extern inline native_save_fl for paravirt Date: Thu, 7 Jun 2018 11:32:16 -0700 Message-Id: <20180607183219.192973-1-ndesaulniers@google.com> X-Mailer: git-send-email 2.17.1.1185.g55be947832-goog Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org paravirt depends on a custom calling convention (callee saved), but expects this from a static inline function that it then forces to be outlined. This is problematic because different compilers or flags can then add a stack guard that violates the calling conventions. Uses extern inline with the out-of-line definition in assembly to prevent compilers from adding stack guards to the outlined version. Other parts of the codebase overwrite KBUILD_CFLAGS, which is *extremely problematic* for extern inline, as the sematics are completely the opposite depending on what C standard is used. http://blahg.josefsipek.net/?p=529 Changes since v2: Take hpa's _ASM_ARG patch into the set in order to simplify cross 32b/64b x86 assembly. Apply Sedat's typo fix to commit message and sign off on it. Take Joe's sugguestion to simplify __inline__ and __inline. Add Arnd to list of folks who made helpful suggestions. Changes since v1: Prefer gnu_inline function attribute instead of explicitly setting C standard compiler flag in problematic Makefiles. We should instead carefully evaluate if those Makefiles should be overwriting KBUILD_CFLAGS at all. Dropped the previous first two patches and added a new first patch. H. Peter Anvin (1): x86/asm: add _ASM_ARG* constants for argument registers to Nick Desaulniers (2): compiler-gcc.h: add gnu_inline to all inline declarations x86: paravirt: make native_save_fl extern inline arch/x86/include/asm/asm.h | 59 +++++++++++++++++++++++++++++++++ arch/x86/include/asm/irqflags.h | 2 +- arch/x86/kernel/Makefile | 1 + arch/x86/kernel/irqflags.S | 26 +++++++++++++++ include/linux/compiler-gcc.h | 17 ++++++---- 5 files changed, 98 insertions(+), 7 deletions(-) create mode 100644 arch/x86/kernel/irqflags.S -- 2.17.1.1185.g55be947832-goog