Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp61268imm; Thu, 7 Jun 2018 13:50:29 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKM0WJFYDIthPisxQh61F6cd/r4bsCKIohxyiU+9FunmpDyPTE4aTcsUX+wI7HjLeqr7o8x X-Received: by 2002:a17:902:7442:: with SMTP id e2-v6mr3472932plt.28.1528404629380; Thu, 07 Jun 2018 13:50:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528404629; cv=none; d=google.com; s=arc-20160816; b=vOr+r45jA2UqaodsUB+UUqGDa3eV8Wi5+3n0EIiGUqFHYyY4V8EizPZ3qp6Cyx9n2U R5ybiKcBNXEx4J2zYhpEKu/7jHf+i+2pZjQ1xIUGHPzxDu3q8QH/Cjg9ZpguTFoMbXEe /tkIipfZAE2KZPJsi0/YsBd6yHfm4RlzGeI3q7UDtbypO4/6f4kHKsNLVXfNNFlR/hJI k6ulf10syE66xiRuTi+mkbzFoRuGltz/io9v4YKf/0vOs03wvcBBMwyHr3cSski1emvh b7TpBUVmhQ/dQjdxjx5IBcPic2hlcaiu0GiUT6DMrQLlM2K2VCm3AlT5yDLSMWxsAswk xQGA== 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=1mzbwQWjqDOTCo5dN3Uk9vpaDn6rpIdjVL4+gGWXNM0=; b=ktxzWnH69ohuZbDiHmTIaLCcoKqYPTHPQIzA/UVd4TDZqy0rYYpEwhIt3Rx2Z3nZJZ Y0TCVtT9X8ExnN73AribJu7uHaSS+p6/fFODe7ABjl7uSuD8kcKwtWuL4ysuLcMXxEyE 3a93regd5e1i9JLV5yNEVLq9fCe1FtR6HyFhIdG1j3PQ/lSaSmnjean8dwrPPtp/Uzni heiUJOGAjJBKkcYXpRsg6lzbbTmDbOFw/7LzNB2qWu1+Wn1diO9o+hOQ3QAlpytLPseZ cgL65V19Dzhx+/JCWjYIKLgbkazYxE9/1T5374OJYUxmjptk8xG3C2iLm/ipbOSSEhkx kDzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=gnkqtkUL; 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 m2-v6si3351577pgn.178.2018.06.07.13.50.14; Thu, 07 Jun 2018 13:50:29 -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=gnkqtkUL; 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 S932440AbeFGUtn (ORCPT + 99 others); Thu, 7 Jun 2018 16:49:43 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:40819 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932251AbeFGUtk (ORCPT ); Thu, 7 Jun 2018 16:49:40 -0400 Received: by mail-pl0-f67.google.com with SMTP id t12-v6so6863446plo.7 for ; Thu, 07 Jun 2018 13:49:40 -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=1mzbwQWjqDOTCo5dN3Uk9vpaDn6rpIdjVL4+gGWXNM0=; b=gnkqtkULTZcm/hxul1tIfrTjkdBKMHn8P/YS9eIzWvtwzyky3IZMlhPXpt386FT8jV uuCRSJnn3VO0EsgwfCGJC/pvORkBn0YI0GT/d5+uReZjsGytdbgUCcyLKTDCTLgc+WDz HIuZkGTONZEFboosS5KtEtG4/3sErCLAfuisZQgGG6pnVOJbJsvaruhJFQ3hVZPuYKAy ft9zcifTICB+ebXHYse1e8RKkkddWLPpgBVwQ4AntmKE6s2eUynnrNeX3PxD4yCF6JWS faxMGluWAXYkkPfPRCcB6ZC3PVqVLw6CIQ7n493VehYsM0A7DBiRrRsRMLt14oW1405f /xIw== 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=1mzbwQWjqDOTCo5dN3Uk9vpaDn6rpIdjVL4+gGWXNM0=; b=sL5lPYICxHUJOsdjC/DJo0m+oEJuDTWumaBKbxxo/uvEnw+bSS8GAwceFi/LjV3uYP dUQb8yU3kye1HdXO9d8U+nOqUkPp23MVaHKGcGJY8yVQb6YSX1Ala8YTZYpnCVc61Yg3 RkiwlQBifwbsaU+JM/B9cFtW73uwXNZ/z1Oo0HYyFtENkgXEAZFTBQS8aXJpcYYo3nxF STCNs+aXhrhyuHiovfgkRVyOSGV7tSDcgOhzuiqcPI08P1NtH79O+tDxz40cPiGGFUiv 8CvzSuqBnNQv4Z+XuRYS/uaj0VaWELFXeekFby7Ftr1oiuZqrf7pPPRDtc8bC0FDhkgI rc/A== X-Gm-Message-State: APt69E0F/VMiyGc6QoKUAIjMm3zpYZyUNAhtz3m8Q9q3eQbxFSICkL/I Xi2Y6qDti+u0dWOcDhZN6ufN/Q== X-Received: by 2002:a17:902:2983:: with SMTP id h3-v6mr3567145plb.232.1528404579831; Thu, 07 Jun 2018 13:49:39 -0700 (PDT) Received: from ndesaulniers0.svl.corp.google.com ([2620:15c:2a3:1:d33:166f:5b79:14b3]) by smtp.gmail.com with ESMTPSA id w18-v6sm3780460pgq.1.2018.06.07.13.49.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Jun 2018 13:49:38 -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 v4 0/3] extern inline native_save_fl for paravirt Date: Thu, 7 Jun 2018 13:49:24 -0700 Message-Id: <20180607204927.219329-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 v3: Take Joe's suggestion to hoist __inline__ and __inline out of conditional block. Changes since v2: Take hpa's _ASM_ARG patch into the set in order to simplify cross 32b/64b x86 assembly and rebase my final patch to use it. Apply Sedat's typo fix to commit message and sign off on it. Take Joe's suggestion 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, 97 insertions(+), 8 deletions(-) create mode 100644 arch/x86/kernel/irqflags.S -- 2.17.1.1185.g55be947832-goog