From patchwork Thu Feb 22 11:28:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 129217 Delivered-To: patch@linaro.org Received: by 10.80.172.228 with SMTP id x91csp1889852edc; Thu, 22 Feb 2018 03:29:44 -0800 (PST) X-Google-Smtp-Source: AH8x224NJQl7LyKJsOEYxQb1RxQ/hWC4LKHebvu4lo8SCWRmfaQcUGAKfL1HFOufDTppIgz/TtZX X-Received: by 2002:a17:902:5914:: with SMTP id o20-v6mr6218857pli.60.1519298984374; Thu, 22 Feb 2018 03:29:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519298984; cv=none; d=google.com; s=arc-20160816; b=UtL8bMtmoR6sQft7xvGkhGVl1F6afSotC18Hdss7SaQM+z80T7QWU/zv+3BNrxvXoB SjMPiU8zZATNLtmOqKnWKdCSsAJSRLefzWdMfk5c5DvgGimxCdGMN6xWE7KOhAgtTODm wxmKX10SeDsvd92LvtyRIzcjam6TQxgOVIabk68afhYmvMbergbyprfmtweoeIwfgtvZ aNzv8enC8FuFW8IQpCHmabEUE9MHXrG2OL91+1xckaEEWpZBFbXuNUh18ESmOd0Uwekf sFrDikbzDKrWZUb8I7xVV0CIVBP4rHBwDSeyDV3ysuAWARxCVoBnIxDTF7FBFsg3Ufai je7w== 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 :arc-authentication-results; bh=V1unsWoXWHDPKwP0REZQRISiHX7SmLd0C+5+1uswQZ8=; b=0y00o7MHsoknrbv4XhNDgwC4vb6iVDXQtPMCpHnH+ZA36GhbIHLpcophv9sOoxSd8G 0H5dO+ruzIpUzSQkDgkEuWzMYACnpc7OEsLJP8Gtdb23l7LzwFCo/K5di5AyJT6JzFgO fUZqI5blmrizaD2ZygsTc5Yw1aS3p1Cjwbq3eS8uOx4H/H4Oz8A8RqspUySrgQFNU2XE ordUFVNfNxppjgScgmhHQ9M3gmWPsB720Ot7H+K6burhgj+HSpnzK025gAuYQ4jVMdvF AtDuk/mC3cjG5RcJfq1S6OTcmYCQH/W4FKbZ0ZvZFhv2NL2VAloK1k/u2K8RVGGtYBE9 HLNQ== 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 s22si3223021pfh.340.2018.02.22.03.29.43; Thu, 22 Feb 2018 03:29:44 -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; 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 S1753608AbeBVL3j (ORCPT + 28 others); Thu, 22 Feb 2018 06:29:39 -0500 Received: from mout.kundenserver.de ([212.227.126.134]:52455 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753503AbeBVL3h (ORCPT ); Thu, 22 Feb 2018 06:29:37 -0500 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue005 [212.227.15.129]) with ESMTPA (Nemesis) id 0Mex5B-1f8yKB0cRt-00OUa0; Thu, 22 Feb 2018 12:28:26 +0100 From: Arnd Bergmann To: Thomas Gleixner , Ingo Molnar , x86@kernel.org, "Kirill A. Shutemov" Cc: Arnd Bergmann , Martin Sebor , "H. Peter Anvin" , linux-kernel@vger.kernel.org Subject: [PATCH] [v2] x86/boot/compressed/64: fix warning for 32-bit trampoline copy Date: Thu, 22 Feb 2018 12:28:05 +0100 Message-Id: <20180222112817.456380-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:0miO+JvCYxmnU7ays95Uyu+Zb2G384BClw1fW11r8Cz5KS0ekuj X4b73iu4bwA//ItCSyfbd+PWdTythF5oyMDku4jHJMH7tsLHllHOQrFKY5l9sLJs/LEQK1o q5YyvBWGFeTaLoM8kN/uv2tFvtpwZwut4eNI1dS9jG5JYqdG2Br8ghRXdd/PktoIXeD8QhF i6SSSRxJAt9LydcmcuhFg== X-UI-Out-Filterresults: notjunk:1; V01:K0:eAhfE1u7TiU=:yQ61loQUjLKNXmQl1+J1Kj tmZZY8Z+h62jzHDhZFFmAHr9jIZ5vupjuZs4XM5Rz+CLv0D1fqY7XS/+FnlZB1Yn5SV9YP5P3 4aFm3hmXaCeaB76Y1U+ulVyf5pWvTN8KhX5oxVhadO7RbTYEOvaxK48n7LGZKpoBtlJu5oiFD WftWt5wOVNYDHQRX66OqH355iW4WLrcemGAISDzEVSjeKdBU7LM6VUfbILkk65SLGTQSZJtaT lxWEf+OFXWZm6KGnY8/bd7ajQHPsOBs0umE+j8slIqxe+P75PXtbt5dnDwjlNEAkCRUV3YbUf aE18gWtP5/Y1OeeHBlwB46CMW/LXEmRbiZ1oaxc1HWMTSsmGuxTYKXFLrwvQngGG1kWoMkMG4 4XLmi99L7uNj/PwK4KPEhJWneHEqfA41vf+QxT4rmm8cMlkd3jAJ4x5IOuiRG82CECu+2Futb +2xRZOXQE0P5BeTXkJldrHz+bV/nW0pJPwtoj6F7ciJSujq9dKFg6izY9g4gZ2xvmkWNSEkFQ btCS4+uDEihlFlZoIfyR9C+5H9rNac5ngfK/2plcYQOUEhKoZOa2B0019DjwY53aeA0RqhNp3 wInESRAwviFRcEMhMXfTiWUMmKv7yJbTrlI2WDJsLaEj7LbcE8Jof9DuKFXXtbrhG5+zWaK5C 3Q++QlKB98E9lJTl1BL7DzviUVJHMvZYiPZLNzyJ5gqITvKBg9iOTrhQ3l3/bTC3V3hNUC3iP svzyIHfW1jFFbDtraONvsIu+/89w8mKsgZorBA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org gcc-8 warns that we copy TRAMPOLINE_32BIT_CODE_SIZE bytes from the pointer to the function into actual trampoline, when that pointer is only 8 bytes: In file included from arch/x86/boot/compressed/pgtable_64.c:3: arch/x86/boot/compressed/pgtable_64.c: In function 'paging_prepare': arch/x86/boot/compressed/../string.h:18:23: error: '__builtin_memcpy' reading 96 bytes from a region of size 8 [-Werror=stringop-overflow=] #define memcpy(d,s,l) __builtin_memcpy(d,s,l) ^~~~~~~~~~~~~~~~~~~~~~~ arch/x86/boot/compressed/pgtable_64.c:62:2: note: in expansion of macro 'memcpy' memcpy(trampoline + TRAMPOLINE_32BIT_CODE_OFFSET / sizeof(unsigned long), ^~~~~~ It turns out that the declaration is incorrect here: trampoline_32bit_src is defined as a function in arch/x86/boot/compressed/head_64.S, not a pointer to a function. Fixing the prototype to match addresses the warning. Cc: Martin Sebor Suggested-by: "Kirill A. Shutemov" Fixes: b91993a87aff ("x86/boot/compressed/64: Prepare trampoline memory") Signed-off-by: Arnd Bergmann --- v2: fix prototype rather than (incorrectly) change the user --- arch/x86/boot/compressed/pgtable.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.9.0 diff --git a/arch/x86/boot/compressed/pgtable.h b/arch/x86/boot/compressed/pgtable.h index 6e0db2260147..5e0b1c4abef4 100644 --- a/arch/x86/boot/compressed/pgtable.h +++ b/arch/x86/boot/compressed/pgtable.h @@ -12,7 +12,7 @@ #ifndef __ASSEMBLER__ -extern void (*trampoline_32bit_src)(void *return_ptr); +extern void trampoline_32bit_src(void *return_ptr); #endif /* __ASSEMBLER__ */ #endif /* BOOT_COMPRESSED_PAGETABLE_H */