Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1183371imm; Tue, 5 Jun 2018 10:17:58 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKs6Qcrdi42INuWJp/JEceRKyuO/ZcyWDLBqvl4GO920tyPBo0a+4EW2xb6zraD4eKS7LmJ X-Received: by 2002:a63:91c8:: with SMTP id l191-v6mr21795545pge.53.1528219078279; Tue, 05 Jun 2018 10:17:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528219078; cv=none; d=google.com; s=arc-20160816; b=Lr+V5QQcIYaDRwTr33itfhkpbTXrRc27mdfJ/lzMmyeumOD9vPqZyzx8wZQ/9Qt7Jy 9C6CBwow4Qwm2ugMgQs85E4TLcTg+AsgbzLLhTqHVd39wWe8yKld6rm47lDrBbb57Gtf RCtvGPzb24q4qNJiNYkvNk7BZp9tnE7WgbxSc8fhKxfS/539pj9WV+MjDrC8y6vVDXON UAOq+PejjzlUvMyyB+MgABLsC8ON5EYHFbz524cHXNrSpJsknIl+UOppN1A2TpeAXZUl c8OPYmRy4+O6u365fcCLk5i3wSE6NkEHLO6CxCVMo2IaG3ia56ofmyaeLzJ7km/kTxpy tnVw== 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=rf1Oid8YKJHqjaX13FLKB93cxYdLYIiyfR/DcuXQPjw=; b=XUtWYF4N2rYuIb4A7I61nZpEXNxcZF4JShtOelVcr4lJIorZpz9DqY8lVuGIkEgl5c GQ0/z/8QehZ8tSverD/h8hbMXnK4hadRVDIskNFMGEoYZMYebIOhCstaokLDqMnZitVe rSBXqSCQjX/D4CxFQeZp6U+wXTBXoviCwEeUoNe4zSOGFe+hk+BlqgyAhsk8vBPQCsaL Am2/FM6yjjgJ5lPJNi+YAmZegse/1iPnH3wr6fPFizYH2FmAAP6FQtHjxMRxDKz8yOAy 1lbyDjwIFL9t5TvUVD91s0MlqLPkfPkLV4o+yfNIk8ekhL47SHT0MnPcVRyxdqLDL7j1 4jbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=T9pBQzla; 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 h16-v6si8758759pfk.156.2018.06.05.10.17.44; Tue, 05 Jun 2018 10:17:58 -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=T9pBQzla; 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 S1753336AbeFERRT (ORCPT + 99 others); Tue, 5 Jun 2018 13:17:19 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:42715 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751879AbeFERFj (ORCPT ); Tue, 5 Jun 2018 13:05:39 -0400 Received: by mail-pg0-f67.google.com with SMTP id p9-v6so1512524pgc.9 for ; Tue, 05 Jun 2018 10:05:39 -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=rf1Oid8YKJHqjaX13FLKB93cxYdLYIiyfR/DcuXQPjw=; b=T9pBQzla/oYX2jqYB8AMyqOSPbezQjRJ18ibKBOk0NncftM2ZFsI+HxlXuoVrX8tGn OMXhsao3Tw39Y+kNAz2Y6YaGHN4kMojfIMF3tBcQimeEAxb+UfWUU7w3fP/NXbIcxiRv wqu6v00p8ZMm/F2+/PHLXW3KxUm7AoDs2t94k2sVfb0r1bk+TBUDvNEjWZN7bk3b2PyF aYzH9/0syhO/ye3//neS6UadaS23eqjEPlRmDe+acNgx+EUS9Xx1s+IsCicKqhyXht4b kXrVIsJ16Sbe3PEKrO2GOvlD1rBOJdDWHVi79MuIEj7gJ0vU2Rde6vu7puB89lPb+zxh PW1w== 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=rf1Oid8YKJHqjaX13FLKB93cxYdLYIiyfR/DcuXQPjw=; b=Ft20pe6HfFfV5j5Smd0wcFt7JIPmSn9mlFnwKhNrrDUGsABW7NgXvCOHbClNf33qb1 u2u2MKtqg+DPkHSoSHncWR/KKMhyuQ5ey0fYDfuwZyrqnx3T7WvyYG+3rgCa7TtePKFd RuRDyTu6RbmnJRLG/9BYDo5v+TrxoRcJWm2vfPDgbR7RlNJgAfVAocaJwm1WG/jK3wCa 5VOZHDYN2rsCxyc464yltJ/xd6EhNYV1LpGstYWhEoWxVauHCQo7JmIlABaJGM3EHFGo 7F3BwB4mamsaq4G4K6MI8Xp0ZVqQPmUAAMwpjKBV0kVTq41FIf3HIeOJEvxw/qbl1m9q 2Dtw== X-Gm-Message-State: APt69E3N8LVfjjrUCIppJnZ6fS3ZxZRsVzbvXHwOTK9DsRAQsPuR+aXf /J4sGKf0lKtETdeNfESQCnzhlA== X-Received: by 2002:a63:9d81:: with SMTP id i123-v6mr9791502pgd.162.1528218338584; Tue, 05 Jun 2018 10:05:38 -0700 (PDT) Received: from ndesaulniers0.svl.corp.google.com ([2620:15c:2a3:1:d33:166f:5b79:14b3]) by smtp.gmail.com with ESMTPSA id r27-v6sm27280090pfg.94.2018.06.05.10.05.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Jun 2018 10:05:37 -0700 (PDT) From: Nick Desaulniers To: akpm@linux-foundation.org, ard.biesheuvel@linaro.org, aryabinin@virtuozzo.com, akataria@vmware.com, boris.ostrovsky@oracle.com, brijesh.singh@amd.com, caoj.fnst@cn.fujitsu.com, gregkh@linuxfoundation.org, hpa@zytor.com, jan.kiszka@siemens.com, jarkko.sakkinen@linux.intel.com, jgross@suse.com, jpoimboe@redhat.com, kirill.shutemov@linux.intel.com, mingo@redhat.com, mjg59@google.com, mka@chromium.org, ndesaulniers@google.com, pombredanne@nexb.com, rostedt@goodmis.org, tglx@linutronix.de, thomas.lendacky@amd.com, tweek@google.com 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 Subject: [PATCH v2 0/2] extern inline native_save_fl for paravirt Date: Tue, 5 Jun 2018 10:05:30 -0700 Message-Id: <20180605170532.170361-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: 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. 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/irqflags.h | 2 +- arch/x86/kernel/Makefile | 1 + arch/x86/kernel/irqflags.S | 26 ++++++++++++++++++++++++++ include/linux/compiler-gcc.h | 19 +++++++++++++------ 4 files changed, 41 insertions(+), 7 deletions(-) create mode 100644 arch/x86/kernel/irqflags.S -- 2.17.1.1185.g55be947832-goog