From patchwork Fri Oct 18 00:49:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Walmsley X-Patchwork-Id: 11197411 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6BA0913BD for ; Fri, 18 Oct 2019 00:49:53 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 489A721D7C for ; Fri, 18 Oct 2019 00:49:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="fplISfye"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=sifive.com header.i=@sifive.com header.b="gvQqT9Yo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 489A721D7C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ZeO8iX2CbvHVN8nanfd3UNPttHA8wIXLciWp5yrGDGg=; b=fplISfyetw15kO AhlZ7zyriEaFwKv0UwWHsbdiwwsaQzHxHNCLYcwtYwOQHGL87A3PhzGL7kPJkfXWeoaaOcYDplu4j AeShFtTZ4xxJKy85DXi4YMohxVFYBYNgB3n0SRbUslaELrKMmXXVzVOWntrRFNfeZXB5oCZsp7W3f C8YDQtE30Hp8zNYt/CuMnid9b4ZP7p/kzbSC1r405Mn/YwWodrYjocIGST06BliD4a3tu3Ukds8mN tUIUOC5ih4kcEHusLrq14w9ERVvGPSSe1Ge+QOhKeH7qBAvHOlh/fnFOKYOabC9W9WhCHM7GN/t64 ftGv7wTJ4aCVQGBLCUDQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iLGSm-0002wa-T6; Fri, 18 Oct 2019 00:49:52 +0000 Received: from mail-il1-x141.google.com ([2607:f8b0:4864:20::141]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iLGSj-0002uB-Nj for linux-riscv@lists.infradead.org; Fri, 18 Oct 2019 00:49:51 +0000 Received: by mail-il1-x141.google.com with SMTP id v2so3960288ilm.0 for ; Thu, 17 Oct 2019 17:49:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gALXE7phMSnF5XNrDSEyjkXd1DZJtTY9PSTVrsQZe00=; b=gvQqT9Yodma6TKFJX8psyNTmo8wcv+MIYwgBZSs5+OnIb53melvh14TUW8Krr6e/pw b6Ruf9EUI3WPSSX1ll6odbzEAr8QBztNIPKo1dkw8sS8CjOqCmsvFqh8w9HRTDfVL10u dfVhQB9K9qqxNQtwpR3pvEcBSS4/n5xuiikXqL2eEVkfg/01+BpwoDOBI4prTXD6oW3e lrjiGH5iOhv5B8FXh6YoMwYcIjogRCbX+Mgy5eD07LOR37kbJRm41HyV6Ts/nIartkj2 XFOfE4nXsSWa8hclFAY99o218sf8Q1RtxuVD/azxc03ekDAP9KSGLh3v8KbC6gylyYA8 lTug== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=gALXE7phMSnF5XNrDSEyjkXd1DZJtTY9PSTVrsQZe00=; b=cmJDQZxfLUI5fe+mBwQGolM/9Kk4ZgXuJZ4swX1KYi3+BbDtdoDAIDx1Xq4pGlZDTT CZkwBxewRDe5NOGlQPC/D7wm60bLjXpq1j0IB2ju5neIYxftjDLHfIIetPFZFxHYUkUR sZkz5X4VNTfD4kIPqWgo+KmviWi6mIZaphyAiOhHWeCy2R1wk6mfVfnljVQ3NPa0ZQuo B+fncE1QNYrHFpH6FoXrcSfjhWwatfgwBs5jg0Thrkdo9LeYxWaXqVk+Qy/EHaFc+fVy 33Vu0kpVTvsnBNIutCEK+imrZ+evvoinaRIwAN4jXnQIMKBvtuu6IPSnjyVXGaLSw8sS PmOA== X-Gm-Message-State: APjAAAVYC3iIsCdAQVMBxSWW2LaKDEJXJTKri8w/upwtaE3ICGr0T3M6 1XogJ6FiZs7mGXjM5oTF2EWUYyDMvOA= X-Google-Smtp-Source: APXvYqxPLKQvtgbLgFlVRB2Ikn/U3owBmflwcq8p9d/U6XcwlVA5Drwp1LB7Ar0kv3oX22JbaPb7Lw== X-Received: by 2002:a92:4144:: with SMTP id o65mr7004075ila.172.1571359788541; Thu, 17 Oct 2019 17:49:48 -0700 (PDT) Received: from viisi.Home ([64.62.168.194]) by smtp.gmail.com with ESMTPSA id z20sm1493891iof.38.2019.10.17.17.49.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Oct 2019 17:49:48 -0700 (PDT) From: Paul Walmsley To: linux-riscv@lists.infradead.org Subject: [PATCH 1/8] riscv: add prototypes for assembly language functions from entry.S Date: Thu, 17 Oct 2019 17:49:22 -0700 Message-Id: <20191018004929.3445-2-paul.walmsley@sifive.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191018004929.3445-1-paul.walmsley@sifive.com> References: <20191018004929.3445-1-paul.walmsley@sifive.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191017_174949_771032_2A120B94 X-CRM114-Status: GOOD ( 12.44 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:141 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org Sender: "linux-riscv" Errors-To: linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org Add prototypes for assembly language functions defined in entry.S, and include these prototypes into C source files that call those functions. This patch resolves the following warnings from sparse: arch/riscv/kernel/signal.c:32:53: warning: incorrect type in initializer (different address spaces) arch/riscv/kernel/signal.c:45:23: warning: incorrect type in initializer (different address spaces) arch/riscv/kernel/signal.c:59:53: warning: incorrect type in initializer (different address spaces) arch/riscv/kernel/signal.c:69:23: warning: incorrect type in initializer (different address spaces) arch/riscv/kernel/signal.c:89:48: warning: incorrect type in argument 2 (different address spaces) arch/riscv/kernel/signal.c:142:45: warning: incorrect type in argument 2 (different address spaces) arch/riscv/kernel/signal.c:295:17: warning: symbol 'do_notify_resume' was not declared. Should it be static? arch/riscv/kernel/traps.c:91:1: warning: symbol 'do_trap_unknown' was not declared. Should it be static? arch/riscv/kernel/traps.c:93:1: warning: symbol 'do_trap_insn_misaligned' was not declared. Should it be static? arch/riscv/kernel/traps.c:95:1: warning: symbol 'do_trap_insn_fault' was not declared. Should it be static? arch/riscv/kernel/traps.c:97:1: warning: symbol 'do_trap_insn_illegal' was not declared. Should it be static? arch/riscv/kernel/traps.c:99:1: warning: symbol 'do_trap_load_misaligned' was not declared. Should it be static? arch/riscv/kernel/traps.c:101:1: warning: symbol 'do_trap_load_fault' was not declared. Should it be static? arch/riscv/kernel/traps.c:103:1: warning: symbol 'do_trap_store_misaligned' was not declared. Should it be static? arch/riscv/kernel/traps.c:105:1: warning: symbol 'do_trap_store_fault' was not declared. Should it be static? arch/riscv/kernel/traps.c:107:1: warning: symbol 'do_trap_ecall_u' was not declared. Should it be static? arch/riscv/kernel/traps.c:109:1: warning: symbol 'do_trap_ecall_s' was not declared. Should it be static? arch/riscv/kernel/traps.c:111:1: warning: symbol 'do_trap_ecall_m' was not declared. Should it be static? arch/riscv/kernel/traps.c:125:17: warning: symbol 'do_trap_break' was not declared. Should it be static? arch/riscv/kernel/traps.c:163:13: warning: symbol 'trap_init' was not declared. Should it be static? This change should have no functional impact. Signed-off-by: Paul Walmsley --- arch/riscv/kernel/entry.h | 29 +++++++++++++++++++++++++++++ arch/riscv/kernel/signal.c | 2 ++ arch/riscv/kernel/traps.c | 2 ++ 3 files changed, 33 insertions(+) create mode 100644 arch/riscv/kernel/entry.h diff --git a/arch/riscv/kernel/entry.h b/arch/riscv/kernel/entry.h new file mode 100644 index 000000000000..73bfcda993d0 --- /dev/null +++ b/arch/riscv/kernel/entry.h @@ -0,0 +1,29 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (C) 2019 SiFive, Inc. + */ +#ifndef __ASM_ENTRY_H +#define __ASM_ENTRY_H + +#include +#include + +asmlinkage void do_trap_unknown(struct pt_regs *regs); +asmlinkage void do_trap_insn_misaligned(struct pt_regs *regs); +asmlinkage void do_trap_insn_fault(struct pt_regs *regs); +asmlinkage void do_trap_insn_illegal(struct pt_regs *regs); +asmlinkage void do_trap_load_misaligned(struct pt_regs *regs); +asmlinkage void do_trap_load_fault(struct pt_regs *regs); +asmlinkage void do_trap_store_misaligned(struct pt_regs *regs); +asmlinkage void do_trap_store_fault(struct pt_regs *regs); +asmlinkage void do_trap_ecall_u(struct pt_regs *regs); +asmlinkage void do_trap_ecall_s(struct pt_regs *regs); +asmlinkage void do_trap_ecall_m(struct pt_regs *regs); +asmlinkage void do_trap_break(struct pt_regs *regs); + +asmlinkage void do_notify_resume(struct pt_regs *regs, + unsigned long thread_info_flags); + +void __init trap_init(void); + +#endif /* __ASM__H */ diff --git a/arch/riscv/kernel/signal.c b/arch/riscv/kernel/signal.c index b14d7647d800..85c700ad47e9 100644 --- a/arch/riscv/kernel/signal.c +++ b/arch/riscv/kernel/signal.c @@ -17,6 +17,8 @@ #include #include +#include "entry.h" + #define DEBUG_SIG 0 struct rt_sigframe { diff --git a/arch/riscv/kernel/traps.c b/arch/riscv/kernel/traps.c index 1ac75f7d0bff..eff679c3b618 100644 --- a/arch/riscv/kernel/traps.c +++ b/arch/riscv/kernel/traps.c @@ -19,6 +19,8 @@ #include #include +#include "entry.h" + int show_unhandled_signals = 1; extern asmlinkage void handle_exception(void); From patchwork Fri Oct 18 00:49:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Walmsley X-Patchwork-Id: 11197413 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C75DA13BD for ; Fri, 18 Oct 2019 00:49:55 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A52E0222C1 for ; Fri, 18 Oct 2019 00:49:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="RtM1QGC6"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=sifive.com header.i=@sifive.com header.b="ehkIOPdn" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A52E0222C1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/seW2zwd2RWuBPh9duq/r2b65xUlPZbBMcRAfvZZsio=; b=RtM1QGC6tj/FUg LCHOe0o7+R94FDPjINLmylgV9u4oHt6MJsDYGMfMnKZG68EIHvEHNE91K5Y3AfHm8Umvnz8aOeTo0 l+8vqDHcmx7StQ5u6DojVFqGa8KCOgWgcS3IbR01iOmsGAPmDLUm1gLFUEKQh1iC8GH46ukIDsVOA 8lU9ZuIGe1NYoIv7FZ0oaWrb7H0LrNEs4Kx6WYhI3hVt2HB//meAnaKNYVfN3kt7J7/7zBPdtmW1Y z6ttL7ImsoVQRlTaaBzV/8FlF+aJPDi8NtzZL3nwAHLiv/WBlKd29A8eekXgKt5Xi1J/OYpAuM68s w/SH1daDUrUeDD2PsaLA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iLGSp-00030C-A6; Fri, 18 Oct 2019 00:49:55 +0000 Received: from mail-il1-x144.google.com ([2607:f8b0:4864:20::144]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iLGSm-0002v8-6w for linux-riscv@lists.infradead.org; Fri, 18 Oct 2019 00:49:53 +0000 Received: by mail-il1-x144.google.com with SMTP id o16so3948011ilq.7 for ; Thu, 17 Oct 2019 17:49:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BhNZJ/+01P0kEF6Kf+e/ysZ/4G6fTDDw4/sqJjXlOAY=; b=ehkIOPdn3CRMG5PytE7+4nIxgQAUmtNUHg9RLR/0iq3ceQ+LLyOya4r2zB9ZQv3rLT EOV6baW5GLOj4xjTpQTUcNeZg2Do0rH9/rM2eoFeq95ROtZugTPXYljg086q218p37XU PupD2xZ3y/8wUtdn4md7XSrO2J63hei4Qi49d6JEvzx6AV0EgK3LhO2WASmsnw6jks4K 43ERMMOjyJISfX4oh0rL3ExTo+az5GNY6b/fiYN+fP0D1JLHXmaYglSRH1YYAI7kUt3V sOalfJpAWI/cKyGM6KDmaSVXDFCGebnbMVU+PT+3wE2TKqj48f/dVcUvKXtS2Qas/QBh 9Vrg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=BhNZJ/+01P0kEF6Kf+e/ysZ/4G6fTDDw4/sqJjXlOAY=; b=bWDazpmxqrD2zRjPmg77T+3rFpQDTY1XB/8Z+1J50P8JZ3yg4+pjsqlZIrOL+PHSO0 3JJXbTddIeMhbm/ThmjcW5g0D1bVPtzGW5K1E1psnakiyehtiiDBMRAptNe3biVOE2FE vt+IqUMKMzhdQSl9EWhYatulLLxKL0cGOugsdCpOSUwwyMraMQsVyRc8adR4d6CQ9J8K 55XXUjuQfPvZgoXbPzsvN8ipk04uzL5PW1xEtkAV5pCLtcbNcP1CNcGoaBcVnrOb0j/m yP6hCjWf/fhSrY3TynvpuzW/jLLgS1yqV4G4V2HTSzwjukP+FfJq8hGyd//jplIq+v5R h4bw== X-Gm-Message-State: APjAAAVz4GhnGE9v8jqftSmMPHWocWBuJpggVFN+t17ejywSBgLJiiyv y/AZme9ek+ZsmsXfx/5xYXhxa+kfp68= X-Google-Smtp-Source: APXvYqya70OHf3T73kG/NYr+Aj+62vc/dsfk6f+RNF4DoKCCuzt8IZZ4Up75ZCR68rBdX/tViOE9ew== X-Received: by 2002:a92:c88b:: with SMTP id w11mr6675702ilo.154.1571359790821; Thu, 17 Oct 2019 17:49:50 -0700 (PDT) Received: from viisi.Home ([64.62.168.194]) by smtp.gmail.com with ESMTPSA id z20sm1493891iof.38.2019.10.17.17.49.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Oct 2019 17:49:50 -0700 (PDT) From: Paul Walmsley To: linux-riscv@lists.infradead.org Subject: [PATCH 2/8] riscv: add prototypes for assembly language functions from head.S Date: Thu, 17 Oct 2019 17:49:23 -0700 Message-Id: <20191018004929.3445-3-paul.walmsley@sifive.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191018004929.3445-1-paul.walmsley@sifive.com> References: <20191018004929.3445-1-paul.walmsley@sifive.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191017_174952_253405_B7AF0823 X-CRM114-Status: GOOD ( 13.22 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:144 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org Sender: "linux-riscv" Errors-To: linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org Add prototypes for assembly language functions defined in head.S, and include these prototypes into C source files that call those functions. This patch resolves the following warnings from sparse: arch/riscv/kernel/setup.c:39:10: warning: symbol 'hart_lottery' was not declared. Should it be static? arch/riscv/kernel/setup.c:42:13: warning: symbol 'parse_dtb' was not declared. Should it be static? arch/riscv/kernel/smpboot.c:33:6: warning: symbol '__cpu_up_stack_pointer' was not declared. Should it be static? arch/riscv/kernel/smpboot.c:34:6: warning: symbol '__cpu_up_task_pointer' was not declared. Should it be static? arch/riscv/kernel/smpboot.c:133:24: warning: symbol 'smp_callin' was not declared. Should it be static? arch/riscv/mm/fault.c:25:17: warning: symbol 'do_page_fault' was not declared. Should it be static? This change should have no functional impact. Signed-off-by: Paul Walmsley --- arch/riscv/kernel/head.h | 21 +++++++++++++++++++++ arch/riscv/kernel/setup.c | 2 ++ arch/riscv/kernel/smpboot.c | 2 ++ arch/riscv/mm/fault.c | 2 ++ arch/riscv/mm/init.c | 2 ++ 5 files changed, 29 insertions(+) create mode 100644 arch/riscv/kernel/head.h diff --git a/arch/riscv/kernel/head.h b/arch/riscv/kernel/head.h new file mode 100644 index 000000000000..105fb0496b24 --- /dev/null +++ b/arch/riscv/kernel/head.h @@ -0,0 +1,21 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (C) 2019 SiFive, Inc. + */ +#ifndef __ASM_HEAD_H +#define __ASM_HEAD_H + +#include +#include + +extern atomic_t hart_lottery; + +asmlinkage void do_page_fault(struct pt_regs *regs); +asmlinkage void __init setup_vm(uintptr_t dtb_pa); + +extern void *__cpu_up_stack_pointer[]; +extern void *__cpu_up_task_pointer[]; + +void __init parse_dtb(void); + +#endif /* __ASM_HEAD_H */ diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c index a990a6cb184f..845ae0e12115 100644 --- a/arch/riscv/kernel/setup.c +++ b/arch/riscv/kernel/setup.c @@ -24,6 +24,8 @@ #include #include +#include "head.h" + #ifdef CONFIG_DUMMY_CONSOLE struct screen_info screen_info = { .orig_video_lines = 30, diff --git a/arch/riscv/kernel/smpboot.c b/arch/riscv/kernel/smpboot.c index 18ae6da5115e..59fa59e013d4 100644 --- a/arch/riscv/kernel/smpboot.c +++ b/arch/riscv/kernel/smpboot.c @@ -30,6 +30,8 @@ #include #include +#include "head.h" + void *__cpu_up_stack_pointer[NR_CPUS]; void *__cpu_up_task_pointer[NR_CPUS]; static DECLARE_COMPLETION(cpu_running); diff --git a/arch/riscv/mm/fault.c b/arch/riscv/mm/fault.c index 96add1427a75..ec15a9b15448 100644 --- a/arch/riscv/mm/fault.c +++ b/arch/riscv/mm/fault.c @@ -18,6 +18,8 @@ #include #include +#include "../head.h" + /* * This routine handles page faults. It determines the address and the * problem, and then passes it off to one of the appropriate routines. diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c index 83f7d12042fb..fa8748a74414 100644 --- a/arch/riscv/mm/init.c +++ b/arch/riscv/mm/init.c @@ -19,6 +19,8 @@ #include #include +#include "../kernel/head.h" + unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)] __page_aligned_bss; EXPORT_SYMBOL(empty_zero_page); From patchwork Fri Oct 18 00:49:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Walmsley X-Patchwork-Id: 11197415 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EE60D13BD for ; Fri, 18 Oct 2019 00:49:58 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A8C69222C1 for ; Fri, 18 Oct 2019 00:49:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="KN9ygLup"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=sifive.com header.i=@sifive.com header.b="cEtvxQFb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A8C69222C1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3G793/eSgBZ6BC6j++9eaFZnQD1JmoyBMSYmq1v5tZk=; b=KN9ygLuph6HkUv 8wxG978hP8y9tLXVN+zfKp6IwG3uOukET4dQ3ImzXxcNjUE21s/IlX3P5a2ZB7BVfWeKTp3DiEzyE OyxjSVhE7898hfN7NbDts3BgMZ4GSZHv6okloqe6CM0z3Kp1W8OEA82dOEfC1fM8Mu+0MUO8VKCQw 5Bbgxll85qtMvUzYeetAS/9Dkfy02r5pfwiimaVMWBinXeW8AsimkCUtZ3IE4RCytFWBiic7pMReM RGVTcm1yXRmFRzDXTmGaZLDySj8LxxyvnwcWuir+OOybbYGyPGVTyl4vAB3XMvfw/Q9q4S4S7t2nb vlSCRWkrFp7MzPygp5qA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iLGSr-00033r-Sd; Fri, 18 Oct 2019 00:49:57 +0000 Received: from mail-il1-x143.google.com ([2607:f8b0:4864:20::143]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iLGSo-0002x6-LW for linux-riscv@lists.infradead.org; Fri, 18 Oct 2019 00:49:56 +0000 Received: by mail-il1-x143.google.com with SMTP id z10so3931964ilo.8 for ; Thu, 17 Oct 2019 17:49:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Fja9Gt2B2/DBj4SCSTf44z+mXpP45MXj3+t8BNYs+ic=; b=cEtvxQFb6Wq310iPciXVgojndV2bclFUO+ObVlogs2+0qitTmU0a1m3cCj+69z9HYQ c1cKLE0d4qBkVBQTVu9uL+fbRXh70eiIyrt4lI8EHOdpssngWDrt5lVpRPhCwWz3vdCO FHVKdKL4eNBtCX2R6sAo5oq8f+fNAICzCjSa2W1fPVbgehN6xvcXIEt/14F9rOtMnxxF eG6jNz37+PJ9sn2ZO9G1T/B///TzwQvmYzqKJEyHjmziNymtMfVY5ueDdR31rq387Hu5 rP2XAc2+icZEuyKdnWiPyYdUScxT4YuTQmjTfuBoW+9rPseXZ2Nh4wPf1yuhTnZYPPZU UV+w== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=Fja9Gt2B2/DBj4SCSTf44z+mXpP45MXj3+t8BNYs+ic=; b=e2Dd8BXM0UBpAZkbKBvi7DXADS5iBq1S8lt3EhasBlv8hQq/2AlFKmkwF67fVTMeoR tkVA2WlEUZzcneGfgv7b6NrhQ3DEL5Q8VdmYHwIcXBgAJ3mlUYuhJcbg92+KgBuTsANl qb33hYxStTZpcHiyWFWapXvD9UVeUOPnlvYfzunNsGB7PZxdcnqHc1kMbjVX4TNDCTcb +5jwBFqQCd6nc0TwJMzorTN6QbfyKP44z1Zqpa7nk7Ez7Ea0z5IA9n8wQE1rdldVqa5o rdHQfSNbB9N6hhSHFcoNUV4wWkXLQJtBW3ycz4xI5w8azyKAaLRn4/Re+4Fup7IxlJlk mg4A== X-Gm-Message-State: APjAAAWX01WVPB76fi8hOjFdDsMkSWVc1HyjSW08dea2CTa6+3ajspM/ aIRywOSEFmOpijtQQRUNY/9EVjAB+hI= X-Google-Smtp-Source: APXvYqz1+jP5/P6UwcpWfctwKEvC91RjkSu+uplBMR8C/0xEP1mUNR9mhUV1bfxIW/s/E0pjZ9Asew== X-Received: by 2002:a92:dd88:: with SMTP id g8mr7007262iln.221.1571359792718; Thu, 17 Oct 2019 17:49:52 -0700 (PDT) Received: from viisi.Home ([64.62.168.194]) by smtp.gmail.com with ESMTPSA id z20sm1493891iof.38.2019.10.17.17.49.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Oct 2019 17:49:52 -0700 (PDT) From: Paul Walmsley To: linux-riscv@lists.infradead.org Subject: [PATCH 3/8] riscv: init: merge split string literals in preprocessor directive Date: Thu, 17 Oct 2019 17:49:24 -0700 Message-Id: <20191018004929.3445-4-paul.walmsley@sifive.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191018004929.3445-1-paul.walmsley@sifive.com> References: <20191018004929.3445-1-paul.walmsley@sifive.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191017_174954_718560_A131DB62 X-CRM114-Status: GOOD ( 11.80 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:143 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org Sender: "linux-riscv" Errors-To: linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org sparse complains loudly when string literals associated with preprocessor directives are split into multiple, separately quoted strings across different lines: arch/riscv/mm/init.c:341:9: error: Expected ; at the end of type declaration arch/riscv/mm/init.c:341:9: error: got "not use absolute addressing." arch/riscv/mm/init.c:358:9: error: Trying to use reserved word 'do' as identifier arch/riscv/mm/init.c:358:9: error: Expected ; at end of declaration [ ... ] The compiler doesn't seem to mind the split string literal, but it's pretty ugly to my eyes - enough to outweigh the value of the 80-column warning from checkpatch. Fix by concatenating the strings. This patch should have no functional impact. Signed-off-by: Paul Walmsley Reviewed-by: Luc Van Oostenryck --- arch/riscv/mm/init.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c index fa8748a74414..fe68e94ea946 100644 --- a/arch/riscv/mm/init.c +++ b/arch/riscv/mm/init.c @@ -339,8 +339,7 @@ static uintptr_t __init best_map_size(phys_addr_t base, phys_addr_t size) */ #ifndef __riscv_cmodel_medany -#error "setup_vm() is called from head.S before relocate so it should " - "not use absolute addressing." +#error "setup_vm() is called from head.S before relocate so it should not use absolute addressing." #endif asmlinkage void __init setup_vm(uintptr_t dtb_pa) From patchwork Fri Oct 18 00:49:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Walmsley X-Patchwork-Id: 11197417 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9CB5013BD for ; Fri, 18 Oct 2019 00:50:03 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 79EA821D7C for ; Fri, 18 Oct 2019 00:50:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="lAjhy7iM"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=sifive.com header.i=@sifive.com header.b="ZvTWtpJ+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 79EA821D7C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=gCMQHEosBwQejWlYWflYt72uNcBflhyJybYLD93EBVQ=; b=lAjhy7iMS8anoS 92jvikYZuV0pvTsd7nfut6Juo+COrja7HgGO0ZiWza6lLudz4HaIPYVzBdlbD04YxPlQolBD7Zgtq qj2j9jkNGYjFcsX24LRFwzfTkwIWZHrA78AwAmsC2QGGIpWcpiun675FxEuRx5ch62WCzGkgTVLnp hj2zWcwNNlFuHi+Yqn8NaQx1Eqdjvs1FauhTq8SKYiO89vg5tSyLl3B7RlSaFyVLUq/Qypn+GezWN 51Kx7CAUzHmnCwkyER4M+kb6u4ukjFeAi6mUKzJ02jD+I5GdkOQAn9aszTHH6iP4B9JfLJCSWlksU yW18ylt6hwiruTCxngCg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iLGSv-00038G-8G; Fri, 18 Oct 2019 00:50:01 +0000 Received: from mail-il1-x142.google.com ([2607:f8b0:4864:20::142]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iLGSp-0002zE-19 for linux-riscv@lists.infradead.org; Fri, 18 Oct 2019 00:49:56 +0000 Received: by mail-il1-x142.google.com with SMTP id l12so3947009ilq.4 for ; Thu, 17 Oct 2019 17:49:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4tqK11FCKTtpeNb/kdkdcZSh26BkLSHk7+0eLJudgpA=; b=ZvTWtpJ+nGkxprJPx8rmfN7XS5Qq2GtsH0AcO7eQ4AA+DVUuYgTUYKgLOfBC58zTdg MkX46qmHUxwbyjT5I+b4s5zYTfoA8wAdQi8yudp0VZQBtBDzIYvChI0fsvsHNsvl1Vjy K106IKyMVkt4xyN7MeQb5BXp3SKlNKfNnfGgi1WHub9iOlUnq9inCvPNvdvLrXp0+QdX SLc+d4YyumaMZ8yio9VNa4Eoe208BDnbf6RCi7UvBFdFUg300TbvbefHgxVTXLH75uSW i9I65+Y2vS28kr5uacQqvIrsyjCv8nmfdKdSY4aJOBRzFTGTGR/2K3BInGi+5HNHl5Ps /qww== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=4tqK11FCKTtpeNb/kdkdcZSh26BkLSHk7+0eLJudgpA=; b=gSunwSofrBX8K1AgxOOIHBP4qm+M0ZHyQ0zUX9Knpgowhs1U0GUaHzshlnfhrqGVxI 6HaYhtrwUqjUg57JcWT8FKWqHQl5hYIN0fLLBsrWtO1pDbooXGHovYVbVAKzxWLRZcFT VkZDpvLm6z3m4p1Vh7Udo/LGhHLYH2E0fPJTNDWX0HmxiR8m2WG+BvP64zzmF2R053Sq rSV1v+oB8NMor53aZxpMKCmcawMy3etHhoZxgX62JuqVqyWkO350YF+wJJBOqzFwCW0k od96IKj8DsrGL/D0KUb1guDm9m8CeUtH640ObHmVHrHIyw9Z/SP+C3PhcyuDUxvxdven 5CFw== X-Gm-Message-State: APjAAAWRBlTxoyOC54arWyCRkuVCr9Vw4U9+e1fw7tjTXoxOtAhETAKZ TmNfYJH0/ZwwmFNRcETBElb0GUGYzDw= X-Google-Smtp-Source: APXvYqx61FSX1Z9aRADptVioZHqTaHtzqSS3y6mMidOa+MlccNOkjPJf8zqFwN5wT354dI1p5zD0wA== X-Received: by 2002:a92:c6ca:: with SMTP id v10mr7634877ilm.133.1571359794270; Thu, 17 Oct 2019 17:49:54 -0700 (PDT) Received: from viisi.Home ([64.62.168.194]) by smtp.gmail.com with ESMTPSA id z20sm1493891iof.38.2019.10.17.17.49.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Oct 2019 17:49:53 -0700 (PDT) From: Paul Walmsley To: linux-riscv@lists.infradead.org Subject: [PATCH 4/8] riscv: ensure RISC-V C model definitions are passed to static analyzers Date: Thu, 17 Oct 2019 17:49:25 -0700 Message-Id: <20191018004929.3445-5-paul.walmsley@sifive.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191018004929.3445-1-paul.walmsley@sifive.com> References: <20191018004929.3445-1-paul.walmsley@sifive.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191017_174955_107828_A6FE1238 X-CRM114-Status: UNSURE ( 7.89 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:142 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org Sender: "linux-riscv" Errors-To: linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org Static analysis tools such as sparse don't set the RISC-V C model preprocessor directives such as "__riscv_cmodel_medany", set by the C compilers. This causes the static analyzers to evaluate different preprocessor paths than C compilers would. Fix this by defining the appropriate C model macros in the static analyzer command lines. Signed-off-by: Paul Walmsley --- arch/riscv/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile index f5e914210245..0247a90bd4d8 100644 --- a/arch/riscv/Makefile +++ b/arch/riscv/Makefile @@ -47,9 +47,11 @@ KBUILD_CFLAGS += -DCONFIG_PAGE_OFFSET=$(CONFIG_PAGE_OFFSET) ifeq ($(CONFIG_CMODEL_MEDLOW),y) KBUILD_CFLAGS += -mcmodel=medlow + CHECKFLAGS += -D__riscv_cmodel_medlow endif ifeq ($(CONFIG_CMODEL_MEDANY),y) KBUILD_CFLAGS += -mcmodel=medany + CHECKFLAGS += -D__riscv_cmodel_medany endif ifeq ($(CONFIG_MODULE_SECTIONS),y) KBUILD_LDS_MODULE += $(srctree)/arch/riscv/kernel/module.lds From patchwork Fri Oct 18 00:49:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Walmsley X-Patchwork-Id: 11197419 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7612E13BD for ; Fri, 18 Oct 2019 00:50:05 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 404CD21D7C for ; Fri, 18 Oct 2019 00:50:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="WW9rXZXO"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=sifive.com header.i=@sifive.com header.b="VrmTrkRv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 404CD21D7C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ARgO6zY1xeDtmGUt4Q34i1yiwBoiDSfoemx3WXMEgZo=; b=WW9rXZXOLDScjB 4yNhROU6lY/F2t2F6Gr7JaolY8Ty1gNYWDq6C1glzFEiJRnx9nQiiGPhW3pAihske1/sBL656gwp2 K1ArT7cKc6gYF1Um9oV49n/vmfnaOY2M6cfY32oeV30Dpki8bb0YQMl0mnhNzG5Xm9vvBECVRYVF4 suk5PkPOFy7HRxx53VMEwPNop6nxYX8JumM34TyqcHzGX0NdfrIhqXBVr3b3i0QEdPdLbdJFGdvdd jB1rHUCtGupmyMM/xxV8sHhbqNxk3/FLnZZL5TH/pQX59XR8K2iLAiXoL2hAQxy4UpE06dO83dCrX vDexCgs3LG6K1cKkJ8rw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iLGSy-0003D4-Lr; Fri, 18 Oct 2019 00:50:04 +0000 Received: from mail-io1-xd41.google.com ([2607:f8b0:4864:20::d41]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iLGSr-000322-Va for linux-riscv@lists.infradead.org; Fri, 18 Oct 2019 00:49:59 +0000 Received: by mail-io1-xd41.google.com with SMTP id h144so5374995iof.7 for ; Thu, 17 Oct 2019 17:49:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=sw5Ks5zpf1Nuh8wRuxwVGtvcKmJb0kK5d8WuX5BG9jw=; b=VrmTrkRvVTEn84dhRBdS11oAkVzg6uonjQBBnhJOw6SMZ8UivLCf1eojFdqM5R6EfK jeZ4yawEZ6j5ZHz7DMqCSdCdYmrsbxTI3Wt6PWwiADCAsIGlcuPMMk8j1of31LTtV9uG 1ljVOqZza+kEuaqYKPhQpKppLLPrEh8l4v2QIKbACUoK5UAlPFZDVp0gEVri0PiA6HFG XANw+6qppe+f/LKH+WvV2nIhM7TKOzG7VChTMIlED9Tx79WHAr7lEWWI1S/EGL5X+6Nn H7j9RQ2svFXzPRkGkYBtp8JVDBjMBF7Sd/XpIyVlbeMAVq36Z7bUqNtjTXm+2h0oLTQq NMCw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=sw5Ks5zpf1Nuh8wRuxwVGtvcKmJb0kK5d8WuX5BG9jw=; b=tJhQJmuAvLq4x9vArSDzsj+u66HvO7uClB+7+lXl+7zyY55BLi3F36lxMoVkesmTP8 LcJQQvEaKJYz1Rk9d5JyuFNZdJ1P48cj/lqoVG5mNZeJ6dzUAzdJS1A77o5PvpvU+bEe qcKB1gv3GXLuQCLFRPf61wnh6GQ5RVsykAb7rtgPCTVC3usc//FCXfe89uHUeaqlVE8v QVgH4HDk7nEV+1+tbLQI3i7GClqO3XbC3FzMYU+m/PKAHr7JsVKZLEkaHcKD17jJ1531 Fx4gA1OqSzz4oadhQXMdaPkwnL1nb4suX5XZQo4sd7Pi+JWYUwQ5LmYZVDfgKsEczmQY 3Q1g== X-Gm-Message-State: APjAAAVHOhf5/1oh8RYxP+PE/8BlA2mLAKGozX7eUbvGG5RSPEGTYM6r OQvh+JxdOyLMKx5RQZMLHApWWJyWr84= X-Google-Smtp-Source: APXvYqymE5ZR4YyA/tn085AGhj69LfIIF6ea+V9gGTis9QH4ixI2j7nXOaoAqmTbg7Qdf1ShSPZm1Q== X-Received: by 2002:a5d:8b12:: with SMTP id k18mr6270154ion.133.1571359795802; Thu, 17 Oct 2019 17:49:55 -0700 (PDT) Received: from viisi.Home ([64.62.168.194]) by smtp.gmail.com with ESMTPSA id z20sm1493891iof.38.2019.10.17.17.49.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Oct 2019 17:49:55 -0700 (PDT) From: Paul Walmsley To: linux-riscv@lists.infradead.org Subject: [PATCH 5/8] riscv: add missing prototypes Date: Thu, 17 Oct 2019 17:49:26 -0700 Message-Id: <20191018004929.3445-6-paul.walmsley@sifive.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191018004929.3445-1-paul.walmsley@sifive.com> References: <20191018004929.3445-1-paul.walmsley@sifive.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191017_174958_050657_A979ED19 X-CRM114-Status: GOOD ( 10.06 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:d41 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org Sender: "linux-riscv" Errors-To: linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org sparse identifies these missing prototypes when building arch/riscv: arch/riscv/kernel/cpu.c:149:29: warning: symbol 'cpuinfo_op' was not declared. Should it be static? arch/riscv/kernel/irq.c:27:29: warning: symbol 'do_IRQ' was not declared. Should it be static? arch/riscv/kernel/irq.c:57:13: warning: symbol 'init_IRQ' was not declared. Should it be static? arch/riscv/kernel/syscall_table.c:15:6: warning: symbol 'sys_call_table' was not declared. Should it be static? arch/riscv/kernel/time.c:15:13: warning: symbol 'time_init' was not declared. Should it be static? arch/riscv/kernel/smpboot.c:135:24: warning: symbol 'smp_callin' was not declared. Should it be static? arch/riscv/kernel/smp.c:72:5: warning: symbol 'setup_profiling_timer' was not declared. Should it be static? arch/riscv/mm/init.c:151:7: warning: symbol 'trampoline_pg_dir' was not declared. Should it be static? arch/riscv/mm/init.c:157:7: warning: symbol 'early_pg_dir' was not declared. Should it be static? arch/riscv/kernel/process.c:32:6: warning: symbol 'show_regs' was not declared. Should it be static? arch/riscv/kernel/ptrace.c:151:6: warning: symbol 'do_syscall_trace_enter' was not declared. Should it be static? arch/riscv/kernel/ptrace.c:165:6: warning: symbol 'do_syscall_trace_exit' was not declared. Should it be static? Fix by adding the missing prototypes to the appropriate header files. This change should have no functional impact. Signed-off-by: Paul Walmsley --- arch/riscv/include/asm/irq.h | 3 +++ arch/riscv/include/asm/pgtable.h | 2 ++ arch/riscv/include/asm/processor.h | 4 ++++ arch/riscv/include/asm/ptrace.h | 4 ++++ arch/riscv/include/asm/smp.h | 2 ++ 5 files changed, 15 insertions(+) diff --git a/arch/riscv/include/asm/irq.h b/arch/riscv/include/asm/irq.h index 75576424c0f7..589e2d9fb2a6 100644 --- a/arch/riscv/include/asm/irq.h +++ b/arch/riscv/include/asm/irq.h @@ -12,6 +12,9 @@ void riscv_timer_interrupt(void); void riscv_software_interrupt(void); +asmlinkage void do_IRQ(struct pt_regs *regs); +void __init init_IRQ(void); + #include #endif /* _ASM_RISCV_IRQ_H */ diff --git a/arch/riscv/include/asm/pgtable.h b/arch/riscv/include/asm/pgtable.h index 42292d99cc74..7fc5e4a56715 100644 --- a/arch/riscv/include/asm/pgtable.h +++ b/arch/riscv/include/asm/pgtable.h @@ -61,6 +61,8 @@ #define PAGE_TABLE __pgprot(_PAGE_TABLE) +extern pgd_t trampoline_pg_dir[]; +extern pgd_t early_pg_dir[]; extern pgd_t swapper_pg_dir[]; /* MAP_PRIVATE permissions: xwr (copy-on-write) */ diff --git a/arch/riscv/include/asm/processor.h b/arch/riscv/include/asm/processor.h index f539149d04c2..ab56435de629 100644 --- a/arch/riscv/include/asm/processor.h +++ b/arch/riscv/include/asm/processor.h @@ -78,6 +78,10 @@ int riscv_of_processor_hartid(struct device_node *node); extern void riscv_fill_hwcap(void); +extern const struct seq_operations cpuinfo_op; + +void time_init(void); + #endif /* __ASSEMBLY__ */ #endif /* _ASM_RISCV_PROCESSOR_H */ diff --git a/arch/riscv/include/asm/ptrace.h b/arch/riscv/include/asm/ptrace.h index d48d1e13973c..78562f3317e6 100644 --- a/arch/riscv/include/asm/ptrace.h +++ b/arch/riscv/include/asm/ptrace.h @@ -101,6 +101,10 @@ static inline unsigned long regs_return_value(struct pt_regs *regs) return regs->a0; } +void do_syscall_trace_enter(struct pt_regs *regs); +void do_syscall_trace_exit(struct pt_regs *regs); +void show_regs(struct pt_regs *regs); + #endif /* __ASSEMBLY__ */ #endif /* _ASM_RISCV_PTRACE_H */ diff --git a/arch/riscv/include/asm/smp.h b/arch/riscv/include/asm/smp.h index a83451d73a4e..d19dd2e2e1da 100644 --- a/arch/riscv/include/asm/smp.h +++ b/arch/riscv/include/asm/smp.h @@ -15,6 +15,8 @@ struct seq_file; extern unsigned long boot_cpu_hartid; +asmlinkage void __init smp_callin(void); + #ifdef CONFIG_SMP /* * Mapping between linux logical cpu index and hartid. From patchwork Fri Oct 18 00:49:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Walmsley X-Patchwork-Id: 11197423 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EFF4215AB for ; Fri, 18 Oct 2019 00:50:11 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C38F2222C1 for ; Fri, 18 Oct 2019 00:50:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="VF6LeBKu"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=sifive.com header.i=@sifive.com header.b="e7FqzvY5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C38F2222C1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zv7eCgXWZ919Su3XQht3TZi6Ofu8dPC9nemp7skSEQA=; b=VF6LeBKusK74YO ApH/G9FEEltLyYMV0cmT0myQ+teH1T3YPeHeKAA3Brri3md4ALb7Z4N2jN7bXePtSqymLhJ4WZy4L mDp/PZrDSVGfT08Z3bABRLC6HE/7WReiLsJoYQ61Sj1rVuYJymGQdASwzsYhfIuyU6Hm+IioGoyCJ 8PqZXMDAkI1d0z/T4X5Gd2xypNOXcxhdcKpm8DdyjhKf5TDMl1rHHtcWL2rbH/iACltcQODaceHWg sg5ziTZ8BAaw/c7hAoGEqwFxqypayIQGGy8f3a4OtpBp0fRSpwM6i8RIJWKFhVLFW1cPqk969iTT/ BUkvXBlw3yNbDsyzsyig==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iLGT5-0003o5-8r; Fri, 18 Oct 2019 00:50:11 +0000 Received: from mail-il1-x141.google.com ([2607:f8b0:4864:20::141]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iLGSs-00033w-DK for linux-riscv@lists.infradead.org; Fri, 18 Oct 2019 00:50:00 +0000 Received: by mail-il1-x141.google.com with SMTP id v2so3960511ilm.0 for ; Thu, 17 Oct 2019 17:49:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JYeo0xAdWe0VE7AGn4vUOp9/RKxdCHKwx1Hu2VD3ZFI=; b=e7FqzvY5kEG/Xv9dIUQ1oCTbqcLEHSai2TGkF9G5GOVHJOR/JRSwHHyKyxE9Y+S1Uq Hb8dlvw9i96xctpHBYqQBqf2k8TItk5GeFtah91bVmtekmsMQyuy9hvZ1tzGZWmJ7Q3R GEgHJm5NtXAKDGR/rADOJZgrY8yLRaSwrpHj7qmYP1C9npIOGGSsJ+sEx/8+SF3AxHF1 zj95h/38bh57/dIL1N0pBQ8+GEsb3385SjPqW4Z2u+/mmYHQM1sgPI/92NHMZR+yr4pf eRB3BIF3i8o0joYNAcCb+1rjlG2oHRXmv5wiiqOCHq94DPnpSd9btuAuXXXApfSK7fB1 Y/fg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=JYeo0xAdWe0VE7AGn4vUOp9/RKxdCHKwx1Hu2VD3ZFI=; b=XL2jEK0I9iMIouq2h5esGZv1R51U2zfZY173EKyue+UtFw+XrwugTIJ7O+P+bQRJH4 HcQpiBWrhMiE3FQ2hRLEz9DPb8pyo2dLiajijecJRtGRaJ82x+fSzYRYNWA6wz6Rgqex Uq0yPHJC9IObYDrLN+EZ8hvgdFr4EFgcSWWku3+HNCz0Ie/KOGWUFFTbjhWGZvrcqEa8 LqKQAHEAMolqXEPleQEPVObPcUSuNvwZtvD23vaP0UumT8CHowZVHZSPWGscJz4ydDGi 3oEAiVWDLIpiCOwvzcdwvhGiDpxbsKM0Uxgemw+HZY4X4INXauLWkYbtfeBGapFiB1e0 FkWg== X-Gm-Message-State: APjAAAX2BOZOJwDa9opVFixp5hvvB0aVp8+pHTMnycAacUe/KKZIqv+W e1rbS9QXshGo6spfOjuY4NN6yQuBcVg= X-Google-Smtp-Source: APXvYqyQCKT5vl5G9xMEmMO1JlNfzDH207v1XKhgNJtHaIqaSHj8HG+prF2g3ggA3i8umXodoDGJGA== X-Received: by 2002:a92:9f8c:: with SMTP id z12mr7348576ilk.111.1571359797398; Thu, 17 Oct 2019 17:49:57 -0700 (PDT) Received: from viisi.Home ([64.62.168.194]) by smtp.gmail.com with ESMTPSA id z20sm1493891iof.38.2019.10.17.17.49.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Oct 2019 17:49:57 -0700 (PDT) From: Paul Walmsley To: linux-riscv@lists.infradead.org Subject: [PATCH 6/8] riscv: mark some code and data as file-static Date: Thu, 17 Oct 2019 17:49:27 -0700 Message-Id: <20191018004929.3445-7-paul.walmsley@sifive.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191018004929.3445-1-paul.walmsley@sifive.com> References: <20191018004929.3445-1-paul.walmsley@sifive.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191017_174958_528472_119C6672 X-CRM114-Status: GOOD ( 12.27 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:141 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org Sender: "linux-riscv" Errors-To: linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org Several functions and arrays which are only used in the files in which they are declared are missing "static" qualifiers. Warnings for these symbols are reported by sparse: arch/riscv/kernel/stacktrace.c:22:14: warning: symbol 'walk_stackframe' was not declared. Should it be static? arch/riscv/kernel/vdso.c:28:18: warning: symbol 'vdso_data' was not declared. Should it be static? arch/riscv/mm/init.c:42:6: warning: symbol 'setup_zero_page' was not declared. Should it be static? arch/riscv/mm/init.c:152:7: warning: symbol 'fixmap_pte' was not declared. Should it be static? arch/riscv/mm/init.c:211:7: warning: symbol 'trampoline_pmd' was not declared. Should it be static? arch/riscv/mm/init.c:212:7: warning: symbol 'fixmap_pmd' was not declared. Should it be static? arch/riscv/mm/init.c:219:7: warning: symbol 'early_pmd' was not declared. Should it be static? arch/riscv/mm/sifive_l2_cache.c:145:12: warning: symbol 'sifive_l2_init' was not declared. Should it be static? Resolve these warnings by marking them as static. Signed-off-by: Paul Walmsley --- arch/riscv/kernel/stacktrace.c | 6 ++++-- arch/riscv/kernel/vdso.c | 2 +- arch/riscv/mm/init.c | 12 +++++++----- arch/riscv/mm/sifive_l2_cache.c | 2 +- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/arch/riscv/kernel/stacktrace.c b/arch/riscv/kernel/stacktrace.c index 0940681d2f68..fd908baed51c 100644 --- a/arch/riscv/kernel/stacktrace.c +++ b/arch/riscv/kernel/stacktrace.c @@ -19,8 +19,10 @@ struct stackframe { unsigned long ra; }; -void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs, - bool (*fn)(unsigned long, void *), void *arg) +static void notrace walk_stackframe(struct task_struct *task, + struct pt_regs *regs, + bool (*fn)(unsigned long, void *), + void *arg) { unsigned long fp, sp, pc; diff --git a/arch/riscv/kernel/vdso.c b/arch/riscv/kernel/vdso.c index c9c21e0d5641..e24fccab8185 100644 --- a/arch/riscv/kernel/vdso.c +++ b/arch/riscv/kernel/vdso.c @@ -25,7 +25,7 @@ static union { struct vdso_data data; u8 page[PAGE_SIZE]; } vdso_data_store __page_aligned_data; -struct vdso_data *vdso_data = &vdso_data_store.data; +static struct vdso_data *vdso_data = &vdso_data_store.data; static int __init vdso_init(void) { diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c index fe68e94ea946..79cfb35f1e0e 100644 --- a/arch/riscv/mm/init.c +++ b/arch/riscv/mm/init.c @@ -40,7 +40,7 @@ static void __init zone_sizes_init(void) free_area_init_nodes(max_zone_pfns); } -void setup_zero_page(void) +static void setup_zero_page(void) { memset((void *)empty_zero_page, 0, PAGE_SIZE); } @@ -150,7 +150,7 @@ EXPORT_SYMBOL(pfn_base); void *dtb_early_va; pgd_t swapper_pg_dir[PTRS_PER_PGD] __page_aligned_bss; pgd_t trampoline_pg_dir[PTRS_PER_PGD] __page_aligned_bss; -pte_t fixmap_pte[PTRS_PER_PTE] __page_aligned_bss; +static pte_t fixmap_pte[PTRS_PER_PTE] __page_aligned_bss; static bool mmu_enabled; #define MAX_EARLY_MAPPING_SIZE SZ_128M @@ -209,15 +209,17 @@ static void __init create_pte_mapping(pte_t *ptep, #ifndef __PAGETABLE_PMD_FOLDED -pmd_t trampoline_pmd[PTRS_PER_PMD] __page_aligned_bss; -pmd_t fixmap_pmd[PTRS_PER_PMD] __page_aligned_bss; +static pmd_t trampoline_pmd[PTRS_PER_PMD] __page_aligned_bss; +static pmd_t fixmap_pmd[PTRS_PER_PMD] __page_aligned_bss; #if MAX_EARLY_MAPPING_SIZE < PGDIR_SIZE #define NUM_EARLY_PMDS 1UL #else #define NUM_EARLY_PMDS (1UL + MAX_EARLY_MAPPING_SIZE / PGDIR_SIZE) #endif -pmd_t early_pmd[PTRS_PER_PMD * NUM_EARLY_PMDS] __initdata __aligned(PAGE_SIZE); + +#define NUM_EARLY_PMDS_PTRS (PTRS_PER_PMD * NUM_EARLY_PMDS) +static pmd_t early_pmd[NUM_EARLY_PMDS_PTRS] __initdata __aligned(PAGE_SIZE); static pmd_t *__init get_pmd_virt(phys_addr_t pa) { diff --git a/arch/riscv/mm/sifive_l2_cache.c b/arch/riscv/mm/sifive_l2_cache.c index 2e637ad71c05..a9ffff3277c7 100644 --- a/arch/riscv/mm/sifive_l2_cache.c +++ b/arch/riscv/mm/sifive_l2_cache.c @@ -142,7 +142,7 @@ static irqreturn_t l2_int_handler(int irq, void *device) return IRQ_HANDLED; } -int __init sifive_l2_init(void) +static int __init sifive_l2_init(void) { struct device_node *np; struct resource res; From patchwork Fri Oct 18 00:49:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Walmsley X-Patchwork-Id: 11197425 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EBB1213BD for ; Fri, 18 Oct 2019 00:50:14 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B8C1B222C1 for ; Fri, 18 Oct 2019 00:50:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="feAp/522"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=sifive.com header.i=@sifive.com header.b="Gok8T07u" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B8C1B222C1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=aXlEhrNnCJvVAC01X8UXKVIiLDwDa9dPTnoYlQ7ygX8=; b=feAp/522AYHspX JzFW3EPASh8J6orOUkMCSDtdUT+fwKvYIFAYHhaOgv3so+PzZSS7c3+PgHAYiKQ9c3uB1JoAdu0OM 4D8q3h5r8JK/Bz+W9EyIdJCqcMgu4tEkdkKUWEOdTLo3pHcSyL0z85AE5i7rgQUbXwgS6hGqVZlAe iKBHzjUVo4NGssAtzU6l2F5a7s1nGF6MRxscma+p0BGCtIL/fw2mX2TXtaDjxjkJm+k4xicYqucPo uBQkEHhW3/JnVm6IJZfk/W7sWAeKBQA7INwKkGePXfScGH+Dm+IvuLPjPk3LkO3v/RBzpJSE+BMzO VJFI/KGcw8dqzGKSEUdw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iLGT7-0004AR-Re; Fri, 18 Oct 2019 00:50:13 +0000 Received: from mail-io1-xd41.google.com ([2607:f8b0:4864:20::d41]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iLGSt-00035x-QG for linux-riscv@lists.infradead.org; Fri, 18 Oct 2019 00:50:01 +0000 Received: by mail-io1-xd41.google.com with SMTP id u8so5388126iom.5 for ; Thu, 17 Oct 2019 17:49:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=D3NziRvdn2+kK8Uw4QbU0HMH6O8cLDFVZEbh6XeL1sY=; b=Gok8T07uC2ipQ9VW5tYHspu6O8Wr0bh0vwo7z2IyRedQR3a3/vHXyFTsGLJAPLpfZ1 wBhDjSO+NWrKT46+f8dUbZbI3wJnelJVVeW0NA+247qCyD6FSmfFvIg2veaQA9/jHn6I 8M+90gxuHpFKbAaTiSLU/A1WYYg4Rjg6oyBjjkYjI64TpxgkqGAmLP/7Cffv1oM/rBup NfeaHsqQYNp/pWyltRpgDB7cozD/ZuWAEjzWNQcA/WGlft7b9DX/bp+60e12xjmzDJfH DWpPtj9gENrn4L4jVTu7g934zaXTN3+znVdX5JNCoHGxB+kL+PVSzHO9b4kbSHRQiFIr dgKQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=D3NziRvdn2+kK8Uw4QbU0HMH6O8cLDFVZEbh6XeL1sY=; b=dyYU3Dqk9i7WtCzG0A9Zo5NWfpc6cDyiUIzqQD45/fCyHFaGkgBlWkxe3t7/etLHbt 9mSS2CW1/KhcQLA96azaJqf5Sv5blk5z29GK2Ans0AhatZUct7Hp6LJwSrHfVvBjszpi 8+qwyW9CxAYSaBgjFNMhQS5JadUD+x7Z8IvtOsVaR5wy0yPDRegC+fVAn0SMPuAaVm4e UKcVRRFMbP2mKrJD2/8NqGO9CLFyRC6mwYXYuVonhJSmZiXNq91a3pU+lpwE/CSPiYPC DJSay9p3A06Wuwm7SbBZ9Tca6JJdZWZ/TCI0piU1lKT/HaQet8CaTrEVGyPTVDcELlol y0AA== X-Gm-Message-State: APjAAAUCUpS/YIvi68mJr03NGL2OL81qLRqOftpoCeHnSvnKLyuSCI5i yNMFUK4r9u1F+ybFhOuM5oyPf2wFYx4= X-Google-Smtp-Source: APXvYqxsnRrt2A3w8IXl4OSNAXOcY/yyDjv4iYOG/mSDmoknP6Xks90gq+mT3OQHegaNfv+sOT2Vsw== X-Received: by 2002:a05:6602:119:: with SMTP id s25mr6015773iot.111.1571359798798; Thu, 17 Oct 2019 17:49:58 -0700 (PDT) Received: from viisi.Home ([64.62.168.194]) by smtp.gmail.com with ESMTPSA id z20sm1493891iof.38.2019.10.17.17.49.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Oct 2019 17:49:58 -0700 (PDT) From: Paul Walmsley To: linux-riscv@lists.infradead.org Subject: [PATCH 7/8] riscv: add missing header file includes Date: Thu, 17 Oct 2019 17:49:28 -0700 Message-Id: <20191018004929.3445-8-paul.walmsley@sifive.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191018004929.3445-1-paul.walmsley@sifive.com> References: <20191018004929.3445-1-paul.walmsley@sifive.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191017_174959_913124_90A204B0 X-CRM114-Status: GOOD ( 10.47 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:d41 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org Sender: "linux-riscv" Errors-To: linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org sparse identifies several missing prototypes caused by missing preprocessor include directives: arch/riscv/kernel/cpufeature.c:16:6: warning: symbol 'has_fpu' was not declared. Should it be static? arch/riscv/kernel/process.c:26:6: warning: symbol 'arch_cpu_idle' was not declared. Should it be static? arch/riscv/kernel/process.c:93:5: warning: symbol 'arch_dup_task_struct' was not declared. Should it be static? arch/riscv/kernel/reset.c:15:6: warning: symbol 'pm_power_off' was not declared. Should it be static? arch/riscv/kernel/syscall_table.c:15:6: warning: symbol 'sys_call_table' was not declared. Should it be static? arch/riscv/kernel/time.c:14:13: warning: symbol 'time_init' was not declared. Should it be static? arch/riscv/kernel/vdso.c:54:5: warning: symbol 'arch_setup_additional_pages' was not declared. Should it be static? arch/riscv/kernel/smpboot.c:134:24: warning: symbol 'smp_callin' was not declared. Should it be static? arch/riscv/kernel/smp.c:64:6: warning: symbol 'arch_match_cpu_phys_id' was not declared. Should it be static? arch/riscv/kernel/smp.c:70:5: warning: symbol 'setup_profiling_timer' was not declared. Should it be static? arch/riscv/kernel/module-sections.c:89:5: warning: symbol 'module_frob_arch_sections' was not declared. Should it be static? arch/riscv/mm/context.c:42:6: warning: symbol 'switch_mm' was not declared. Should it be static? Fix by including the appropriate header files in the appropriate source files. This patch should have no functional impact. Signed-off-by: Paul Walmsley --- arch/riscv/include/asm/irq.h | 3 +++ arch/riscv/include/asm/switch_to.h | 1 + arch/riscv/kernel/cpufeature.c | 1 + arch/riscv/kernel/module-sections.c | 1 + arch/riscv/kernel/process.c | 2 ++ arch/riscv/kernel/reset.c | 1 + arch/riscv/kernel/smp.c | 2 ++ arch/riscv/kernel/smpboot.c | 1 + arch/riscv/kernel/syscall_table.c | 1 + arch/riscv/kernel/time.c | 1 + arch/riscv/kernel/vdso.c | 1 + arch/riscv/mm/context.c | 1 + 12 files changed, 16 insertions(+) diff --git a/arch/riscv/include/asm/irq.h b/arch/riscv/include/asm/irq.h index 589e2d9fb2a6..f0e9df6e6049 100644 --- a/arch/riscv/include/asm/irq.h +++ b/arch/riscv/include/asm/irq.h @@ -7,6 +7,9 @@ #ifndef _ASM_RISCV_IRQ_H #define _ASM_RISCV_IRQ_H +#include +#include + #define NR_IRQS 0 void riscv_timer_interrupt(void); diff --git a/arch/riscv/include/asm/switch_to.h b/arch/riscv/include/asm/switch_to.h index f0227bdce0f0..ee4f0ac62c9d 100644 --- a/arch/riscv/include/asm/switch_to.h +++ b/arch/riscv/include/asm/switch_to.h @@ -6,6 +6,7 @@ #ifndef _ASM_RISCV_SWITCH_TO_H #define _ASM_RISCV_SWITCH_TO_H +#include #include #include #include diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c index b1ade9a49347..a5ad00043104 100644 --- a/arch/riscv/kernel/cpufeature.c +++ b/arch/riscv/kernel/cpufeature.c @@ -10,6 +10,7 @@ #include #include #include +#include unsigned long elf_hwcap __read_mostly; #ifdef CONFIG_FPU diff --git a/arch/riscv/kernel/module-sections.c b/arch/riscv/kernel/module-sections.c index c9ae48333114..e264e59e596e 100644 --- a/arch/riscv/kernel/module-sections.c +++ b/arch/riscv/kernel/module-sections.c @@ -8,6 +8,7 @@ #include #include #include +#include unsigned long module_emit_got_entry(struct module *mod, unsigned long val) { diff --git a/arch/riscv/kernel/process.c b/arch/riscv/kernel/process.c index fb3a082362eb..85e3c39bb60b 100644 --- a/arch/riscv/kernel/process.c +++ b/arch/riscv/kernel/process.c @@ -7,6 +7,7 @@ * Copyright (C) 2017 SiFive */ +#include #include #include #include @@ -19,6 +20,7 @@ #include #include #include +#include extern asmlinkage void ret_from_fork(void); extern asmlinkage void ret_from_kernel_thread(void); diff --git a/arch/riscv/kernel/reset.c b/arch/riscv/kernel/reset.c index d0fe623bfb8f..aa56bb135ec4 100644 --- a/arch/riscv/kernel/reset.c +++ b/arch/riscv/kernel/reset.c @@ -4,6 +4,7 @@ */ #include +#include #include static void default_power_off(void) diff --git a/arch/riscv/kernel/smp.c b/arch/riscv/kernel/smp.c index b18cd6c8e8fb..5c9ec78422c2 100644 --- a/arch/riscv/kernel/smp.c +++ b/arch/riscv/kernel/smp.c @@ -8,7 +8,9 @@ * Copyright (C) 2017 SiFive */ +#include #include +#include #include #include #include diff --git a/arch/riscv/kernel/smpboot.c b/arch/riscv/kernel/smpboot.c index 59fa59e013d4..ec0be2f6a2e8 100644 --- a/arch/riscv/kernel/smpboot.c +++ b/arch/riscv/kernel/smpboot.c @@ -29,6 +29,7 @@ #include #include #include +#include #include "head.h" diff --git a/arch/riscv/kernel/syscall_table.c b/arch/riscv/kernel/syscall_table.c index e5dd52d8f633..f1ead9df96ca 100644 --- a/arch/riscv/kernel/syscall_table.c +++ b/arch/riscv/kernel/syscall_table.c @@ -8,6 +8,7 @@ #include #include #include +#include #undef __SYSCALL #define __SYSCALL(nr, call) [nr] = (call), diff --git a/arch/riscv/kernel/time.c b/arch/riscv/kernel/time.c index 9dd1f2e64db1..6a53c02e9c73 100644 --- a/arch/riscv/kernel/time.c +++ b/arch/riscv/kernel/time.c @@ -7,6 +7,7 @@ #include #include #include +#include unsigned long riscv_timebase; EXPORT_SYMBOL_GPL(riscv_timebase); diff --git a/arch/riscv/kernel/vdso.c b/arch/riscv/kernel/vdso.c index e24fccab8185..484d95a70907 100644 --- a/arch/riscv/kernel/vdso.c +++ b/arch/riscv/kernel/vdso.c @@ -6,6 +6,7 @@ * Copyright (C) 2015 Regents of the University of California */ +#include #include #include #include diff --git a/arch/riscv/mm/context.c b/arch/riscv/mm/context.c index beeb5d7f92ea..ca66d44156b6 100644 --- a/arch/riscv/mm/context.c +++ b/arch/riscv/mm/context.c @@ -7,6 +7,7 @@ #include #include #include +#include /* * When necessary, performs a deferred icache flush for the given MM context, From patchwork Fri Oct 18 00:49:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Walmsley X-Patchwork-Id: 11197427 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id ADA2315AB for ; Fri, 18 Oct 2019 00:50:17 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8B198222C1 for ; Fri, 18 Oct 2019 00:50:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="keH05xMU"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=sifive.com header.i=@sifive.com header.b="ZxKJbb75" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8B198222C1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=BeDcrUBXCnacWulnoqp4NgDlD3cyzuazqLB0F+KXtBc=; b=keH05xMU15Dn/D Uws9phjwb7biYirEZfOI4jw8YeJbf2KUIV7km4Mfly7ML8OOxddTwgdVpunHqFi4I5Nt3HDiE5WoQ nDwukRkvy36zq910MElEtZc1dZw93u/1EwmA3FHCm29vWC2TqFJoW5D21iaM8Fcp96qWKO1e1vbuJ d1Dtqv2A0ocxkxKPoYP5P94TKYUQsmaD5yKYLdJAvYn+sRu7vSXWBzxdFj0TsQU+Y9jOVsrz/tCBa Uq7CsrpUZxzZrSa83YY+GpwKGxWoU3sOwhZp7DFsdqxWn62zEhyKore6uXLeyz4XVTh/1GhM6c+sJ 7QhGh+KFOalpxhSheOsw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iLGTA-0004Zi-E7; Fri, 18 Oct 2019 00:50:16 +0000 Received: from mail-il1-x142.google.com ([2607:f8b0:4864:20::142]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iLGSv-00037e-5W for linux-riscv@lists.infradead.org; Fri, 18 Oct 2019 00:50:03 +0000 Received: by mail-il1-x142.google.com with SMTP id z10so3932165ilo.8 for ; Thu, 17 Oct 2019 17:50:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BDNARAWoiAFizEyliYmITz0WDECsamFFfEfTjTwse14=; b=ZxKJbb75JUb8XtdmyH6ELjVl2TxKr+2knfv6zeJLtjAEUY6blYfLbV5wIOiq5g1CJf qAm4Xy0ZpmQ4dUJXLg3NJ5XiOzOGpaZFsChkS+2oZxuR0aiBeCYVk/q+rwVTGjsdktpd 3tXdvHYaEM6JwRgXysZe7f/u7TBtDC38uEEpA4QGBXtUYqCraU2/mCey9hW93unnycaY rnWIVszNZcwyXk2NQsUP3zRNqNthv4y3wgNgvavnmiFryMA2SRsFocr38S+W6naLIWn4 cmwq9gUuIcIYuKutu2aUOk7ZArHCf6J/7MC0nNg1HyYXzPatkxiSdOBS/jfm+47+SH/t QWIw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=BDNARAWoiAFizEyliYmITz0WDECsamFFfEfTjTwse14=; b=re0AFjOn1kkQyGGFy8RYT/JpKhdMkfT9QLypO7vnu//hMhRgc46taQdUtJgzHbWYw2 kdSIqtJKZggwWmcsHk8kXjrNc+CVQxc+5kNwY/N8+SZwDBOKj2DS2GEI7HDRV1KaZ7QY n7UtScyg4NAmUIHQxW8Gw0zGHLAwyjHFAqcUvNjxvAWGzYMXviN/1/z9rWHHlIAgqQlY 8HnXSWAf9Z4tyDlFHkshcFg88Y94CXxzxiTkwN1eZbryL+Av/gJDAkWFCM5m/5sw76jJ ZGFgMfb28xMjKhB+zvZ2whNrp+6MtGxARAQh/0oH6wR+6cMy5KFWZErkvHglb1YCNaHG jL4A== X-Gm-Message-State: APjAAAW7iL3pD7FmW4kMHlqPbiX47nP3Xc1f+p9zJ/pdLE4F26JzDdQF wRBnopYcQR+6aisQnnlY6fFiMZriSnE= X-Google-Smtp-Source: APXvYqz89Az5yviOLCd30UK04C1xP1O6eNU91MfQje3M5l58kOclitK04wId42uS1RkuH8Tus8v5MQ== X-Received: by 2002:a92:7f0f:: with SMTP id a15mr6918766ild.116.1571359800009; Thu, 17 Oct 2019 17:50:00 -0700 (PDT) Received: from viisi.Home ([64.62.168.194]) by smtp.gmail.com with ESMTPSA id z20sm1493891iof.38.2019.10.17.17.49.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Oct 2019 17:49:59 -0700 (PDT) From: Paul Walmsley To: linux-riscv@lists.infradead.org Subject: [PATCH 8/8] riscv: fp: add missing __user pointer annotations Date: Thu, 17 Oct 2019 17:49:29 -0700 Message-Id: <20191018004929.3445-9-paul.walmsley@sifive.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191018004929.3445-1-paul.walmsley@sifive.com> References: <20191018004929.3445-1-paul.walmsley@sifive.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191017_175001_387060_19B04C3E X-CRM114-Status: UNSURE ( 9.57 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:142 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, Alan Kao Sender: "linux-riscv" Errors-To: linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org The __user annotations were removed from the {save,restore}_fp_state() function signatures by commit 007f5c358957 ("Refactor FPU code in signal setup/return procedures"), but should be present, and sparse warns when they are not applied. Add them back in. This change should have no functional impact. Signed-off-by: Paul Walmsley Fixes: 007f5c358957 ("Refactor FPU code in signal setup/return procedures") Cc: Alan Kao --- arch/riscv/kernel/signal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/riscv/kernel/signal.c b/arch/riscv/kernel/signal.c index 85c700ad47e9..9437167f463e 100644 --- a/arch/riscv/kernel/signal.c +++ b/arch/riscv/kernel/signal.c @@ -28,7 +28,7 @@ struct rt_sigframe { #ifdef CONFIG_FPU static long restore_fp_state(struct pt_regs *regs, - union __riscv_fp_state *sc_fpregs) + union __riscv_fp_state __user *sc_fpregs) { long err; struct __riscv_d_ext_state __user *state = &sc_fpregs->d; @@ -55,7 +55,7 @@ static long restore_fp_state(struct pt_regs *regs, } static long save_fp_state(struct pt_regs *regs, - union __riscv_fp_state *sc_fpregs) + union __riscv_fp_state __user *sc_fpregs) { long err; struct __riscv_d_ext_state __user *state = &sc_fpregs->d;