Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp97006img; Thu, 21 Mar 2019 15:03:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqx/rFXmSaEwaXtz/UkqBHZr9Cqp4rq5Fbs2uQ4cM+lLgr9tjfQM/IjZTHs9NnZy4EVSOahg X-Received: by 2002:aa7:90c1:: with SMTP id k1mr5589895pfk.202.1553205796746; Thu, 21 Mar 2019 15:03:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553205796; cv=none; d=google.com; s=arc-20160816; b=L0x3S6XXCBGrdoXezU7Wq8ojaXXOf4PZ/orGRoJfcTVyDDA/ULfnhkn9e9/Zqsa2dt D9NtVEBR4OXWRt0RYUIMD7jZrqsIVpcW9clv/umJnPwxj9e9cMJdJ9Cnnt4pGK9FyP40 XmjkUL/lmLU1tOcqp4o8C2oZKZ4rQu9VI7ZOqfht+qlnCa7Su07deYE7j6h7HFHHIv2z vDSs2BFTwXwAlbnGu2x4BUitzIXEPCMoidvRK5c9Okuy+iuvQ99Uu1vBhbkCqIYFSetY fVVLjg/VqCO8pAUeFoMRaG4JxzyfNeakFtPOkqvZGi9A84kQAeWu1zsZy0rvZP/VpVgg phjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=oLxKbL9zQbfEEG6jvXgSRgboVRoaa2FQSH3iZ79uE8I=; b=CZHd2EAA6sOSqYbdaxaEgzc/W3tLbeXVKgAYcsIVJjvKGtuDRWiwLz54Mxt/ggqOK2 OGwQfGm2uXoXYIVXh8Tb6FegJ5LLAaCiY+kLZEpsQ96rHCAWi9qo2WcC2vHw/CmOAD0s Tek0lgs7mcDOzI85zjFT2TgJNC4AqVHT35fPWc3p0/RTjiNc/36cUxwg1qUSpAz+K8BW OdCnM16UrWorQvU8JXiw/4RHAEOGi0+p/nmFl3eOaS66BcY8eDBOhqkcZa1rCVmpdBUY lu6/ejrhMHAfyMC7awy6NmjPLBlt3LZ1TOSjOEr3LDdHaiepDZzy4p1lvkmUYl5LoC5S PBAw== ARC-Authentication-Results: i=1; mx.google.com; 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 q137si2234954pgq.58.2019.03.21.15.03.02; Thu, 21 Mar 2019 15:03:16 -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; 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 S1727471AbfCUWAw (ORCPT + 99 others); Thu, 21 Mar 2019 18:00:52 -0400 Received: from mga06.intel.com ([134.134.136.31]:53197 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727257AbfCUWA1 (ORCPT ); Thu, 21 Mar 2019 18:00:27 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Mar 2019 15:00:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,254,1549958400"; d="scan'208";a="216357235" Received: from tassilo.jf.intel.com (HELO tassilo.localdomain) ([10.7.201.137]) by orsmga001.jf.intel.com with ESMTP; 21 Mar 2019 15:00:23 -0700 Received: by tassilo.localdomain (Postfix, from userid 1000) id 293D030214C; Thu, 21 Mar 2019 15:00:23 -0700 (PDT) From: Andi Kleen To: x86@kernel.org Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org, Andi Kleen Subject: [PATCH 05/17] Use C version for SYSCALL_ALIAS Date: Thu, 21 Mar 2019 14:59:57 -0700 Message-Id: <20190321220009.29334-6-andi@firstfloor.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190321220009.29334-1-andi@firstfloor.org> References: <20190321220009.29334-1-andi@firstfloor.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andi Kleen LTO doesn't like the assembler aliasing used for SYSCALL_ALIAS. Replace it with C aliasing. Also mark the only users visible. This gives cleaner and nicer code, so is useful even without LTO. Signed-off-by: Andi Kleen --- arch/x86/include/asm/syscall_wrapper.h | 1 + include/linux/linkage.h | 6 ++---- kernel/time/posix-stubs.c | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/arch/x86/include/asm/syscall_wrapper.h b/arch/x86/include/asm/syscall_wrapper.h index e046a405743d..6f7a73da8437 100644 --- a/arch/x86/include/asm/syscall_wrapper.h +++ b/arch/x86/include/asm/syscall_wrapper.h @@ -52,6 +52,7 @@ SYSCALL_METADATA(_##sname, 0); \ asmlinkage long __x64_sys_##sname(void); \ ALLOW_ERROR_INJECTION(__x64_sys_##sname, ERRNO); \ + asmlinkage long __ia32_sys_##sname(void); \ SYSCALL_ALIAS(__ia32_sys_##sname, __x64_sys_##sname); \ asmlinkage long __x64_sys_##sname(void) diff --git a/include/linux/linkage.h b/include/linux/linkage.h index 7e020782ade2..5fc9ecd55bda 100644 --- a/include/linux/linkage.h +++ b/include/linux/linkage.h @@ -30,10 +30,8 @@ #endif #ifndef SYSCALL_ALIAS -#define SYSCALL_ALIAS(alias, name) asm( \ - ".globl " __stringify(alias) "\n\t" \ - ".set " __stringify(alias) "," \ - __stringify(name)) +#define SYSCALL_ALIAS(a, name) \ + __visible typeof(a) a __attribute__((alias(__stringify(name)))) #endif #define __page_aligned_data __section(.data..page_aligned) __aligned(PAGE_SIZE) diff --git a/kernel/time/posix-stubs.c b/kernel/time/posix-stubs.c index 67df65f887ac..4777892bee82 100644 --- a/kernel/time/posix-stubs.c +++ b/kernel/time/posix-stubs.c @@ -21,7 +21,7 @@ #include #endif -asmlinkage long sys_ni_posix_timers(void) +__visible asmlinkage long sys_ni_posix_timers(void) { pr_err_once("process %d (%s) attempted a POSIX timer syscall " "while CONFIG_POSIX_TIMERS is not set\n", -- 2.20.1