Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp2915045ybx; Fri, 8 Nov 2019 11:12:51 -0800 (PST) X-Google-Smtp-Source: APXvYqzUJ0+GxG8FQ4O/sS8+2YjKK7WWKssW2g1k6ZkV0pvvNR/MSzCABnM4FKX7k3iPxke06vSw X-Received: by 2002:a50:fc1a:: with SMTP id i26mr12554339edr.9.1573240371881; Fri, 08 Nov 2019 11:12:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573240371; cv=none; d=google.com; s=arc-20160816; b=FWzi7CBy14Y0TjXkxOwhn0CtnjpTZJevkCR2cw5q4Mr6DnD3olzPFKqQ8o1ZAmTjbn BUPyAbA9Oq3kkJXtYv+Sy4e7xSDF5PqO/pPwDfZMLKd4/XjSIdnfohDX9eU8MhoWknKP aWPoWRaB0RhxRjnULAE7ZXaC6eWSE7AMzKdOeKR/CWrfHLqNCakUhD4Rwn8p75kkfW+H +dqR+PYJY2eez9HK6NJfJOZjCdQB6td51mYYSJ5GO3+EeVvZjPE15uSKwHF+tmJbHWdU 4bN6+uH15zLwY19z4imSVlvj6ou3EgFYXWVKCfTVvPje/5pkqgFKVO3+eCVy5JPV6CaY h3YA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=dPpqaIh3yJjSk7ZnHyvi1tLu5Y9oZNbIjDbixGtuL48=; b=woPgyLGY+zaqOJ+GEqTBQ37hOw2iHLJjhPLYUd3itEG68tZfMmTpplMO0XNq942ldh THLLVcoYnOUJjU7hHsrsRfocyctotzqduBaJrO1hQ9t3acJCJ1Fd7xX4ZFJ1iCLgsbbS s1k5pM+UHfEN0aVv8o/8GQ3zRlQkLmEw2c6xud22ZKINPQCXCvVEcQy//8+YnCeOQ3Mu 9iYnt+O9GqFbar05ls6UPSgd4SerlDCPwbuTIAqouxa1QGERsUQEY41erQ5RQGCcWVz5 kcfaYJ4XgfZGr74kNvS++IdGcbwxVMhu3bCfri6fILOUZntgbeMPSttKoP80MJaPSpfK FTDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=knsE9B0v; 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 u4si4520517ejx.3.2019.11.08.11.12.28; Fri, 08 Nov 2019 11:12:51 -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; dkim=pass header.i=@kernel.org header.s=default header.b=knsE9B0v; 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 S2391822AbfKHTJ6 (ORCPT + 99 others); Fri, 8 Nov 2019 14:09:58 -0500 Received: from mail.kernel.org ([198.145.29.99]:41892 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391810AbfKHTJ4 (ORCPT ); Fri, 8 Nov 2019 14:09:56 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5DA1A20673; Fri, 8 Nov 2019 19:09:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573240194; bh=v6GzKwOgnX6TvW5mQt/tLwn7FJcpMVYO23TwKMLssdU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=knsE9B0vVYiujl01upMgA0KFpRzD8zU09+G9X22HlKOk2xb0r7PyLc69z0JUukA0H c5rCLPXB4euF6EQe7bfZyPceIOvRp+RCPzPgZ/mFFlFYzxCAMqLI8LBVdKfeicBS3U HkTtNdN5Ttjc6GsQJX37lmy6YQWcMRsHekTkkPQs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jonas Gorski , Florian Fainelli , Paul Burton , linux-mips@vger.kernel.org, Ralf Baechle , James Hogan , Sasha Levin Subject: [PATCH 5.3 069/140] MIPS: bmips: mark exception vectors as char arrays Date: Fri, 8 Nov 2019 19:49:57 +0100 Message-Id: <20191108174909.531987497@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191108174900.189064908@linuxfoundation.org> References: <20191108174900.189064908@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jonas Gorski [ Upstream commit e4f5cb1a9b27c0f94ef4f5a0178a3fde2d3d0e9e ] The vectors span more than one byte, so mark them as arrays. Fixes the following build error when building when using GCC 8.3: In file included from ./include/linux/string.h:19, from ./include/linux/bitmap.h:9, from ./include/linux/cpumask.h:12, from ./arch/mips/include/asm/processor.h:15, from ./arch/mips/include/asm/thread_info.h:16, from ./include/linux/thread_info.h:38, from ./include/asm-generic/preempt.h:5, from ./arch/mips/include/generated/asm/preempt.h:1, from ./include/linux/preempt.h:81, from ./include/linux/spinlock.h:51, from ./include/linux/mmzone.h:8, from ./include/linux/bootmem.h:8, from arch/mips/bcm63xx/prom.c:10: arch/mips/bcm63xx/prom.c: In function 'prom_init': ./arch/mips/include/asm/string.h:162:11: error: '__builtin_memcpy' forming offset [2, 32] is out of the bounds [0, 1] of object 'bmips_smp_movevec' with type 'char' [-Werror=array-bounds] __ret = __builtin_memcpy((dst), (src), __len); \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/mips/bcm63xx/prom.c:97:3: note: in expansion of macro 'memcpy' memcpy((void *)0xa0000200, &bmips_smp_movevec, 0x20); ^~~~~~ In file included from arch/mips/bcm63xx/prom.c:14: ./arch/mips/include/asm/bmips.h:80:13: note: 'bmips_smp_movevec' declared here extern char bmips_smp_movevec; Fixes: 18a1eef92dcd ("MIPS: BMIPS: Introduce bmips.h") Signed-off-by: Jonas Gorski Reviewed-by: Florian Fainelli Signed-off-by: Paul Burton Cc: linux-mips@vger.kernel.org Cc: Ralf Baechle Cc: James Hogan Signed-off-by: Sasha Levin --- arch/mips/bcm63xx/prom.c | 2 +- arch/mips/include/asm/bmips.h | 10 +++++----- arch/mips/kernel/smp-bmips.c | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/arch/mips/bcm63xx/prom.c b/arch/mips/bcm63xx/prom.c index 77a836e661c9e..df69eaa453a1c 100644 --- a/arch/mips/bcm63xx/prom.c +++ b/arch/mips/bcm63xx/prom.c @@ -84,7 +84,7 @@ void __init prom_init(void) * Here we will start up CPU1 in the background and ask it to * reconfigure itself then go back to sleep. */ - memcpy((void *)0xa0000200, &bmips_smp_movevec, 0x20); + memcpy((void *)0xa0000200, bmips_smp_movevec, 0x20); __sync(); set_c0_cause(C_SW0); cpumask_set_cpu(1, &bmips_booted_mask); diff --git a/arch/mips/include/asm/bmips.h b/arch/mips/include/asm/bmips.h index bf6a8afd7ad27..581a6a3c66e40 100644 --- a/arch/mips/include/asm/bmips.h +++ b/arch/mips/include/asm/bmips.h @@ -75,11 +75,11 @@ static inline int register_bmips_smp_ops(void) #endif } -extern char bmips_reset_nmi_vec; -extern char bmips_reset_nmi_vec_end; -extern char bmips_smp_movevec; -extern char bmips_smp_int_vec; -extern char bmips_smp_int_vec_end; +extern char bmips_reset_nmi_vec[]; +extern char bmips_reset_nmi_vec_end[]; +extern char bmips_smp_movevec[]; +extern char bmips_smp_int_vec[]; +extern char bmips_smp_int_vec_end[]; extern int bmips_smp_enabled; extern int bmips_cpu_offset; diff --git a/arch/mips/kernel/smp-bmips.c b/arch/mips/kernel/smp-bmips.c index 76fae9b79f131..712c15de6ab9f 100644 --- a/arch/mips/kernel/smp-bmips.c +++ b/arch/mips/kernel/smp-bmips.c @@ -464,10 +464,10 @@ static void bmips_wr_vec(unsigned long dst, char *start, char *end) static inline void bmips_nmi_handler_setup(void) { - bmips_wr_vec(BMIPS_NMI_RESET_VEC, &bmips_reset_nmi_vec, - &bmips_reset_nmi_vec_end); - bmips_wr_vec(BMIPS_WARM_RESTART_VEC, &bmips_smp_int_vec, - &bmips_smp_int_vec_end); + bmips_wr_vec(BMIPS_NMI_RESET_VEC, bmips_reset_nmi_vec, + bmips_reset_nmi_vec_end); + bmips_wr_vec(BMIPS_WARM_RESTART_VEC, bmips_smp_int_vec, + bmips_smp_int_vec_end); } struct reset_vec_info { -- 2.20.1