From patchwork Sun Aug 14 14:12:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Conor Dooley X-Patchwork-Id: 12942899 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 3CD12C25B08 for ; Sun, 14 Aug 2022 14:13:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+JTDelQxFWQwZOMZn2dfZT9dd6LNpv6UtXK25NI+Miw=; b=VoYBdn1aSKsw4E L6fforupnU7Vib9OuNeLTyjvj8C3df+sADTAzUdjpQaIdlOsxLY2MXsZauSHK77mnXNGcd7487Dja Br1ZIy8EC2mODDRwB3l1DmLcJR7he3rPTibRT1+0xAfDnqiy/xPgFDLkcl/almMAYTKxf97VHCyOt 2Su+OmsZ2Dgfd9RJIqXuDaf+dxc2+dTUU/AlX7c2/tJ0XobCtx2FN8y+Yjg0/Uuw2D3MXkwaoLpyg 95AddqUPMgwYc9lceD8/D0xhVWEKmEWNmEyK5gSd7VhEWPZFPG5Zr8dmxKS0w/jDkbi5Es3PIlUMl FuJrHwpNAADkbAt/58FA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oNEMP-0070Yx-7q; Sun, 14 Aug 2022 14:13:01 +0000 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oNEMI-0070Rt-7P for linux-riscv@lists.infradead.org; Sun, 14 Aug 2022 14:12:56 +0000 Received: by mail-wr1-x42c.google.com with SMTP id h13so6353572wrf.6 for ; Sun, 14 Aug 2022 07:12:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=conchuod.ie; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=Xqc3VtPSBOAfpxrTQ3FQnbEScSjzijC2Ge9Qv+3BLFo=; b=KSSPXqdDvQ30jRp5ZEhGlfQ/aS0hz2oSUFeTar1lta3J4zdKDfpW/jUYA0/PiDxfDa 7CaS1dovo6wdlqR6phEaSv5eUlvB0h4SZHh1+4WgiaWr9tMGHL3VrRJsE6ppzN8fow3i sRXlxbOajPCerCw1GcDlS2x8dobocGRI1cVsgcqeGnYtM1XDr5z1nMJPIvXFATv4ZA93 ao69Y8ApqC0YOZL0ByltUGbCWAT1GUOx7eu27fPQFM4nExizuoS54M71vFUPoP8n2iPc McBTZn5q2UiGtoC4//f166GNAWF4vGRe7ySnMZp8phvvR0EOCoZZtTw14ts7untZY9li hS7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=Xqc3VtPSBOAfpxrTQ3FQnbEScSjzijC2Ge9Qv+3BLFo=; b=QoQPQvwPz3xkzyULfm5Y0PQspSgQWqM6nKaV7VufjVUFFuqJl46fkwzlAGruYYtLqX lWUYmfPS/cC8IARwwNpkZPQDc45/OxSp7v1EZkKVL4HAuHK7AJh0imKEy4l398dxXYHt fJouWP+roBxS+fUHg+QJ5jvWJcZmRvTv6HyCvN2AvCcN9m82ziMmA1oAJKEXdJKZJXAN 2gCKR9TIOpknKFlSDBqZpm1P/nrXjMlw/iTQDBNnnOYLwoxZwNqrs/WFTSEDk+mOxQ1/ ifZ8+CXPxjy6oHVvFBp3yCs2pj/o0xJTPyTXQyrxDF8hdGCSk+KsE80OCqQOTljqOCYx Z7+g== X-Gm-Message-State: ACgBeo3ovqF4M5rf6VgFGnwelR+sKnOPmDhN5DQJkNCGaPsVqA3IANSt AApWPI3MHPWadVi7cEQ0zqscqA== X-Google-Smtp-Source: AA6agR7L6qLIdUlUFVOsEa6ZwXoag/PaFOX3IukupKFIqjjhVOE/vcErNmGNQSSR0BwuzhSCaRA2HQ== X-Received: by 2002:adf:f708:0:b0:221:6cb7:8d52 with SMTP id r8-20020adff708000000b002216cb78d52mr6272145wrp.186.1660486371758; Sun, 14 Aug 2022 07:12:51 -0700 (PDT) Received: from henark71.. ([109.76.58.63]) by smtp.gmail.com with ESMTPSA id b8-20020adfde08000000b0021db7b0162esm4625419wrm.105.2022.08.14.07.12.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Aug 2022 07:12:51 -0700 (PDT) From: Conor Dooley To: Anup Patel , Atish Patra , Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: Conor Dooley , Guo Ren , Vincent Chen , Xianting Tian , Heiko Stuebner , Kefeng Wang , Tong Tiangen , kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/4] riscv: kvm: vcpu_timer: fix unused variable warnings Date: Sun, 14 Aug 2022 15:12:35 +0100 Message-Id: <20220814141237.493457-2-mail@conchuod.ie> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220814141237.493457-1-mail@conchuod.ie> References: <20220814141237.493457-1-mail@conchuod.ie> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220814_071254_273760_3C4EF2B5 X-CRM114-Status: UNSURE ( 8.94 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org From: Conor Dooley In two places, csr is set but never used: arch/riscv/kvm/vcpu_timer.c:302:23: warning: variable 'csr' set but not used [-Wunused-but-set-variable] struct kvm_vcpu_csr *csr; ^ arch/riscv/kvm/vcpu_timer.c:327:23: warning: variable 'csr' set but not used [-Wunused-but-set-variable] struct kvm_vcpu_csr *csr; ^ Remove the variable. Fixes: 8f5cb44b1bae ("RISC-V: KVM: Support sstc extension") Signed-off-by: Conor Dooley --- arch/riscv/kvm/vcpu_timer.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/arch/riscv/kvm/vcpu_timer.c b/arch/riscv/kvm/vcpu_timer.c index 16f50c46ba39..185f2386a747 100644 --- a/arch/riscv/kvm/vcpu_timer.c +++ b/arch/riscv/kvm/vcpu_timer.c @@ -299,7 +299,6 @@ static void kvm_riscv_vcpu_update_timedelta(struct kvm_vcpu *vcpu) void kvm_riscv_vcpu_timer_restore(struct kvm_vcpu *vcpu) { - struct kvm_vcpu_csr *csr; struct kvm_vcpu_timer *t = &vcpu->arch.timer; kvm_riscv_vcpu_update_timedelta(vcpu); @@ -307,7 +306,6 @@ void kvm_riscv_vcpu_timer_restore(struct kvm_vcpu *vcpu) if (!t->sstc_enabled) return; - csr = &vcpu->arch.guest_csr; #if defined(CONFIG_32BIT) csr_write(CSR_VSTIMECMP, (u32)t->next_cycles); csr_write(CSR_VSTIMECMPH, (u32)(t->next_cycles >> 32)); @@ -324,13 +322,11 @@ void kvm_riscv_vcpu_timer_restore(struct kvm_vcpu *vcpu) void kvm_riscv_vcpu_timer_save(struct kvm_vcpu *vcpu) { - struct kvm_vcpu_csr *csr; struct kvm_vcpu_timer *t = &vcpu->arch.timer; if (!t->sstc_enabled) return; - csr = &vcpu->arch.guest_csr; t = &vcpu->arch.timer; #if defined(CONFIG_32BIT) t->next_cycles = csr_read(CSR_VSTIMECMP); From patchwork Sun Aug 14 14:12:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Conor Dooley X-Patchwork-Id: 12942900 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 7DE1DC25B06 for ; Sun, 14 Aug 2022 14:13:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=6+f3eGDFeoh1UKZD+K/TOMVSIAtMpAB9XGVKO2MbnaI=; b=SOdDWGqI6rGdqS pI3l59IsH2CvtOVi2zhWpJQgwRtoE+0LU56/wZQDd+FG6YBe5ZqI4mALlAJtnIKXfzy5s5IYRykgD 0+HqhsoXONjaBYTVfXgrVCLKuSyzHYdtxkUl7Kp9BICg7fmb92V9kyuDJYOAveRf/SMH1aw1PC+Zq XdBI8LyK8zBDSk7Kr+vQKPfQ3cd/RW9M6CF5nJxPwy/5lDreVaF5zYarbKE19q59Zh10VkRmFBF2u TZdrxOoAmdHDJLTMpHNyDPF/Q3pWQ0j2RiBN7z1mo+3hwiOJn2bcd1JECabjpxNynB2fCJ3V0eUfO x4hsw28fzka4+mnXAroQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oNEMU-0070bQ-LS; Sun, 14 Aug 2022 14:13:06 +0000 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oNEMJ-0070SW-KB for linux-riscv@lists.infradead.org; Sun, 14 Aug 2022 14:12:57 +0000 Received: by mail-wm1-x32d.google.com with SMTP id z14-20020a7bc7ce000000b003a5db0388a8so1021323wmk.1 for ; Sun, 14 Aug 2022 07:12:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=conchuod.ie; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=qMUpNbdJFHkt8LehO+vj4FoNVMjMZ3b4RSV8Kbu/byM=; b=VU4X7ETrUmw6SeHfZ8AdO5lxQKOQF2HqiEeNSOaEO67IQgUu4al0l7Lp3vRJzsv8Ft 148XhPJaK+g8F+K2pFvw/ibH2zC/GW6G3TP/Sub0QP9WkIpbzxC521jv+uLO/jzmgdCC diUBrwCfWZAKEoAmALJ7bywyWKZDHeo5iPTbotwxY1F/O5oI4I5Ic4VuSvMYwZdFUQh/ ZEEUY4gc60LRUCvGwVdTLyUl+apOZQtsCzBQlH0d/e91I9A9waemfuZBe86cO8GtLRDm XrQDdAFcRZvf/GQyqSv1qssDXttkUmbTxG0amI78ugyDHn2eEBwwRt3ahtZMIU5vgAfm +YBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=qMUpNbdJFHkt8LehO+vj4FoNVMjMZ3b4RSV8Kbu/byM=; b=ifmtprwpZRefe1pWm6EIv393r1Zuh/cBQCFnHB/7e2SiC/h3XRuWgmasyefmvOEjgB 4elJUlPhaBXQeZGNyNKeRwflhyLOS2EmhGOo2s96Tw3+fD9YSq9p1+jVYsi3Ccy2MQbZ 3YiMWCYTo1Me1mmoI18pJL7ZLhYx2Bsbf+pKeIjaaK+CDRikV7YkJlTeVzN1P9R3b65E sCi5eM715WgAc6eP/tLL6DNYGmkguhLcIjUxm3BsG7Q7AXjKd9tGcZvuhO9/1ePS+/Q2 zAWeYOKlgAjdjKQLVgdbpp1vqJT5NdWCNox233HJCuxiZM28Idrq+g+oJ7FYeGvEPNO4 Tnlg== X-Gm-Message-State: ACgBeo0tr/yHq7cN7Z6a/z/tYtFVeUxkW6iFmS0Qa8EBKifgBvJfInre ug5By2zX9BQWtIbJ8JbHAuiW6A== X-Google-Smtp-Source: AA6agR4TZ6OGzcxxznTc5xN2jS1X/dAKB1yFSxHRG1y13P0Di1gIIk68PUhQuEwPcdtEnEPKe4wd+Q== X-Received: by 2002:a05:600c:a4c:b0:39c:34d0:fd25 with SMTP id c12-20020a05600c0a4c00b0039c34d0fd25mr7924157wmq.172.1660486373101; Sun, 14 Aug 2022 07:12:53 -0700 (PDT) Received: from henark71.. ([109.76.58.63]) by smtp.gmail.com with ESMTPSA id b8-20020adfde08000000b0021db7b0162esm4625419wrm.105.2022.08.14.07.12.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Aug 2022 07:12:52 -0700 (PDT) From: Conor Dooley To: Anup Patel , Atish Patra , Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: Conor Dooley , Guo Ren , Vincent Chen , Xianting Tian , Heiko Stuebner , Kefeng Wang , Tong Tiangen , kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/4] riscv: kvm: move extern sbi_ext declarations to a header Date: Sun, 14 Aug 2022 15:12:36 +0100 Message-Id: <20220814141237.493457-3-mail@conchuod.ie> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220814141237.493457-1-mail@conchuod.ie> References: <20220814141237.493457-1-mail@conchuod.ie> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220814_071255_667398_3E08349A X-CRM114-Status: GOOD ( 10.15 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org From: Conor Dooley Sparse complains about missing statics in the declarations of several variables: arch/riscv/kvm/vcpu_sbi_replace.c:38:37: warning: symbol 'vcpu_sbi_ext_time' was not declared. Should it be static? arch/riscv/kvm/vcpu_sbi_replace.c:73:37: warning: symbol 'vcpu_sbi_ext_ipi' was not declared. Should it be static? arch/riscv/kvm/vcpu_sbi_replace.c:126:37: warning: symbol 'vcpu_sbi_ext_rfence' was not declared. Should it be static? arch/riscv/kvm/vcpu_sbi_replace.c:170:37: warning: symbol 'vcpu_sbi_ext_srst' was not declared. Should it be static? arch/riscv/kvm/vcpu_sbi_base.c:69:37: warning: symbol 'vcpu_sbi_ext_base' was not declared. Should it be static? arch/riscv/kvm/vcpu_sbi_base.c:90:37: warning: symbol 'vcpu_sbi_ext_experimental' was not declared. Should it be static? arch/riscv/kvm/vcpu_sbi_base.c:96:37: warning: symbol 'vcpu_sbi_ext_vendor' was not declared. Should it be static? arch/riscv/kvm/vcpu_sbi_hsm.c:115:37: warning: symbol 'vcpu_sbi_ext_hsm' was not declared. Should it be static? These variables are however used in vcpu_sbi.c where they are declared as extern. Move them to kvm_vcpu_sbi.h which is handily already included by the three other files. Fixes: a046c2d8578c ("RISC-V: KVM: Reorganize SBI code by moving SBI v0.1 to its own file") Fixes: 5f862df5585c ("RISC-V: KVM: Add v0.1 replacement SBI extensions defined in v0.2") Fixes: 3e1d86569c21 ("RISC-V: KVM: Add SBI HSM extension in KVM") Signed-off-by: Conor Dooley --- arch/riscv/include/asm/kvm_vcpu_sbi.h | 12 ++++++++++++ arch/riscv/kvm/vcpu_sbi.c | 12 +----------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/arch/riscv/include/asm/kvm_vcpu_sbi.h b/arch/riscv/include/asm/kvm_vcpu_sbi.h index 83d6d4d2b1df..26a446a34057 100644 --- a/arch/riscv/include/asm/kvm_vcpu_sbi.h +++ b/arch/riscv/include/asm/kvm_vcpu_sbi.h @@ -33,4 +33,16 @@ void kvm_riscv_vcpu_sbi_system_reset(struct kvm_vcpu *vcpu, u32 type, u64 flags); const struct kvm_vcpu_sbi_extension *kvm_vcpu_sbi_find_ext(unsigned long extid); +#ifdef CONFIG_RISCV_SBI_V01 +extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_v01; +#endif +extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_base; +extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_time; +extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_ipi; +extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_rfence; +extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_srst; +extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_hsm; +extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_experimental; +extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_vendor; + #endif /* __RISCV_KVM_VCPU_SBI_H__ */ diff --git a/arch/riscv/kvm/vcpu_sbi.c b/arch/riscv/kvm/vcpu_sbi.c index d45e7da3f0d3..f96991d230bf 100644 --- a/arch/riscv/kvm/vcpu_sbi.c +++ b/arch/riscv/kvm/vcpu_sbi.c @@ -32,23 +32,13 @@ static int kvm_linux_err_map_sbi(int err) }; } -#ifdef CONFIG_RISCV_SBI_V01 -extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_v01; -#else +#ifndef CONFIG_RISCV_SBI_V01 static const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_v01 = { .extid_start = -1UL, .extid_end = -1UL, .handler = NULL, }; #endif -extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_base; -extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_time; -extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_ipi; -extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_rfence; -extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_srst; -extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_hsm; -extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_experimental; -extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_vendor; static const struct kvm_vcpu_sbi_extension *sbi_ext[] = { &vcpu_sbi_ext_v01, From patchwork Sun Aug 14 14:12:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Conor Dooley X-Patchwork-Id: 12942901 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 15481C25B06 for ; Sun, 14 Aug 2022 14:13:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=RuC3o8JpD9FkJok4jNHRrZvrkV+8uEERQ7QiqTWMdrs=; b=U8nlQ5g3tCfqJh hgm56DPnO2VLjGvTVaJWVKls4UF26SIHLN48fFh5iJsJltgDAPEOat03rqw6uXKGQpumhxCFyoXeC nw4Z22sjmpNhk7Qvepfc0JfJAAJoQlEobQ2RlCToMksyue77d54pHfMJ3NPnMfB89wq03rEI+Ch8Q 7jS9OIrJjEVLULj1IQaxSvuKyXbkzxENLuup6p9TiEeTtQYjcFcWR/HEFS6PuJBZqffe3QL7rBe3h SZq0heQwryxuAlCuvnfYvQQcjwQlWpwYXHv46t8GvDYqyPKXPsvBJyx5A4iL2ACVOQKF0H11EKGro DRthTTVMrnEHMhU2DtFg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oNEMW-0070du-R1; Sun, 14 Aug 2022 14:13:08 +0000 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oNEMK-0070T6-8q for linux-riscv@lists.infradead.org; Sun, 14 Aug 2022 14:12:58 +0000 Received: by mail-wr1-x42e.google.com with SMTP id j1so6369888wrw.1 for ; Sun, 14 Aug 2022 07:12:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=conchuod.ie; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=pPv0l6vD5WlLpI1nTN7zzV3sMR7lS/dRIy37KSKLV6k=; b=HMMTLU/p8YLEHSGr0JdrSHHzL+KPSzr/2SbHVIYZPefUDLh0i6BEpVFmoM7PonqAQu XHK1xmVw1UBg2BPE8d6h3iPvrE+h3Ms+3mRmDMA9Wb50IKTeWvZ0qIOlXZ1ZkoUbFGHE 0mUhMOI5/9Bp3r2iu5qSOoF2uZw6OohSrtuVWL1610+z/NlAO6QENPP2PWA5I1CD3+Ng euh7jve2sSLkFojItamUEEE3h9vElikeXBeEWacM1nyspNJDM6MQj9pdpf6uA3YdvvbX JHdWK+memg4nFTSgdmc6BoFrjCm7SFf/6eVZhXMvj+kHJE/DRuNDbHBIhxDKgeNhP0WF Scrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=pPv0l6vD5WlLpI1nTN7zzV3sMR7lS/dRIy37KSKLV6k=; b=64f4GkxYiczY362FOgPtNQvUHAIxiB07riEieSFdh9qvbYyi4kE2uX4F4AaAoehnrb Wam9+qfUm3xem6zFqYBIO0rE2cMOwIOyOeTJAp39/UvPSfEFHoT/Jbx7nORsmuxOLWLC IobFnCfmpXI7u15uEylur7KhOXiracOP2+JQwlx7XsFslRI/ez6UIYL8+oUJ9gHoybvo rHanJvlUfV++4GmqTpZNDVMithC28RR5LkfyWIaE8uNeLqPnR9hN1UUyjT5fqCwUUid2 CHx7JTl2Rsn/nF5NAMuEanan95qH/HMvCq8SiMR6Wz0NdzH4K84Qmut7aoaBBcU5uQOc TUpw== X-Gm-Message-State: ACgBeo1zZAurXwqKjYsJ2UrGJJO7LT9wU9VZRoSOkgZfJ0cojPUYkQK6 UpSKkXSjTUpSqgse/TDqAIrFuA== X-Google-Smtp-Source: AA6agR6BPhLCEYbGHWwFtW7IA0BVcNy4nXrlbW7af92IxkgTrJMJnNk9uz1mkz0iwWDTuJ1TmfrDbA== X-Received: by 2002:a5d:4705:0:b0:21f:3890:8619 with SMTP id y5-20020a5d4705000000b0021f38908619mr6285685wrq.104.1660486374334; Sun, 14 Aug 2022 07:12:54 -0700 (PDT) Received: from henark71.. ([109.76.58.63]) by smtp.gmail.com with ESMTPSA id b8-20020adfde08000000b0021db7b0162esm4625419wrm.105.2022.08.14.07.12.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Aug 2022 07:12:53 -0700 (PDT) From: Conor Dooley To: Anup Patel , Atish Patra , Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: Conor Dooley , Guo Ren , Vincent Chen , Xianting Tian , Heiko Stuebner , Kefeng Wang , Tong Tiangen , kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/4] riscv: signal: fix missing prototype warning Date: Sun, 14 Aug 2022 15:12:37 +0100 Message-Id: <20220814141237.493457-4-mail@conchuod.ie> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220814141237.493457-1-mail@conchuod.ie> References: <20220814141237.493457-1-mail@conchuod.ie> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220814_071256_495882_DDD838BC X-CRM114-Status: GOOD ( 11.83 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org From: Conor Dooley Fix the warning: arch/riscv/kernel/signal.c:316:27: warning: no previous prototype for function 'do_notify_resume' [-Wmissing-prototypes] asmlinkage __visible void do_notify_resume(struct pt_regs *regs, All other functions in the file are static & none of the existing headers stood out as an obvious location. Create signal.h to hold the declaration. Fixes: e2c0cdfba7f6 ("RISC-V: User-facing API") Signed-off-by: Conor Dooley --- arch/riscv/include/asm/signal.h | 12 ++++++++++++ arch/riscv/kernel/signal.c | 1 + 2 files changed, 13 insertions(+) create mode 100644 arch/riscv/include/asm/signal.h diff --git a/arch/riscv/include/asm/signal.h b/arch/riscv/include/asm/signal.h new file mode 100644 index 000000000000..532c29ef0376 --- /dev/null +++ b/arch/riscv/include/asm/signal.h @@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifndef __ASM_SIGNAL_H +#define __ASM_SIGNAL_H + +#include +#include + +asmlinkage __visible +void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags); + +#endif diff --git a/arch/riscv/kernel/signal.c b/arch/riscv/kernel/signal.c index 38b05ca6fe66..5a2de6b6f882 100644 --- a/arch/riscv/kernel/signal.c +++ b/arch/riscv/kernel/signal.c @@ -15,6 +15,7 @@ #include #include +#include #include #include #include From patchwork Sun Aug 14 14:12:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Conor Dooley X-Patchwork-Id: 12942902 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 65EEEC25B06 for ; Sun, 14 Aug 2022 14:13:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KC3F1RjMBEueWwiQHGnP5tufMZiV+xhOJnc4wFvTRdY=; b=ogSocqsENi+OYa d8dt+WgMbXnJRg9gfeTIogBpTlNlzNA+2rcjg9B88qGjnrOekIMIncKn1T4fdhSDOKg7SMczwHo8q tO++sEbH+oXXzbnKSs6Kig7j2LxQvIKvq5PjmpTJG9HZrqJNySDpQVyAW0IkGmsGQWvbIWfalJYEp 8zbRyMBckMQTFXYh76j4Y2/1zoZx58556ePIvItoU7HaZElYn0ijF6cN0q6ZlfcTlP1W+aLaUep2C ENn/CHOXgrRVU/1wq9Oc34ExeCIdGBZEav5fMSy/6tTBzV9Qaz3ALckQYWH/rLudMzrgj9ANZlD1W bFolifteBcN22c7XMYKg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oNEMZ-0070gT-5F; Sun, 14 Aug 2022 14:13:11 +0000 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oNEML-0070U6-Hk for linux-riscv@lists.infradead.org; Sun, 14 Aug 2022 14:12:59 +0000 Received: by mail-wr1-x430.google.com with SMTP id j1so6369921wrw.1 for ; Sun, 14 Aug 2022 07:12:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=conchuod.ie; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=Jpi+qYPVkjjgLSftDLRCVgzhzYoBkPjkNBatqeFjYP4=; b=Qq8AUk/9AWVqplZnZsraolgAwvvs+PIe6EeGfq6jN5MM2n6AruvuyymJsCkvpb+OzP DYg/NMqHsO6QTHRAmrKsuXtxegQV5ArT1zwjqST2UY7tF7wobikGXu8YTrZv50Ep0Ae3 kQ6O0X7afhbpbhHnOfxIltiwZLRErrqF5lam6sIXJu4xMzzliWzprfPqRkgZB1tMXU1/ R7yHX1sH3JLUhkX3H1H84GsxsU9S9kdPrpHmC8xt1v98s+gs4HLrQJ3K/kl6UABKJ4Rr uV7ZKh1Ouv6RetM5zMnnJz7UfMlbuOU52TAUum4YqqIrYAQSjRgz7dY13Phg2BCkc3lq qL4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=Jpi+qYPVkjjgLSftDLRCVgzhzYoBkPjkNBatqeFjYP4=; b=vZBgpQf1jVPmru8LWst7HeXOOAa0ZfJAT+U7b3i+pkVUJ6mIUUrUUGrfZdv+7Ga5V5 GG/Jrjm41OSUbC4nWO0C37pmtUjdRdvCbhTZRZU1vyezXCVVFKeJm33NlMq0mr1SN8R4 5PQvcXHQ+KmoeJzN8QpnUFJOS9/L+TOFvff1+3TuutIkf4bceTXLncYPTFnnhwMEubte rr9SLEBxTm2CEakCg0LLN62PeYBhVL8JzbPwg3x/DH6MZoENQSTfVeaKSSJL4I5BtbG8 XBgd4M3hnn6AzrwmqG+ti0/7hd/PWv3R8G5QXLtsbZvtaxw2o5c34DDSk5xzxVGZRqvW N7Ig== X-Gm-Message-State: ACgBeo1q/jeGIuO7M1dJbzTLfjxnFfwcAJieSZufKsp6/dr/gayyxZCN IsyhyJEmDIKfRZbEsRouIzgZJw== X-Google-Smtp-Source: AA6agR6FYk+iY85iu6ZNNhqlEqAtS2htyInEPS/oNlnm6Idei+lVhLdGdUcw2QokwFea/pPKDyVQbg== X-Received: by 2002:adf:f90e:0:b0:21e:417b:dbd with SMTP id b14-20020adff90e000000b0021e417b0dbdmr6282420wrr.425.1660486375541; Sun, 14 Aug 2022 07:12:55 -0700 (PDT) Received: from henark71.. ([109.76.58.63]) by smtp.gmail.com with ESMTPSA id b8-20020adfde08000000b0021db7b0162esm4625419wrm.105.2022.08.14.07.12.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Aug 2022 07:12:55 -0700 (PDT) From: Conor Dooley To: Anup Patel , Atish Patra , Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: Conor Dooley , Guo Ren , Vincent Chen , Xianting Tian , Heiko Stuebner , Kefeng Wang , Tong Tiangen , kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/4] riscv: traps: add missing prototype Date: Sun, 14 Aug 2022 15:12:38 +0100 Message-Id: <20220814141237.493457-5-mail@conchuod.ie> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220814141237.493457-1-mail@conchuod.ie> References: <20220814141237.493457-1-mail@conchuod.ie> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220814_071257_726646_CF76F791 X-CRM114-Status: GOOD ( 10.00 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org From: Conor Dooley Sparse complains: arch/riscv/kernel/traps.c:213:6: warning: symbol 'shadow_stack' was not declared. Should it be static? The variable is used in entry.S, so declare shadow_stack there alongside SHADOW_OVERFLOW_STACK_SIZE. Fixes: 31da94c25aea ("riscv: add VMAP_STACK overflow detection") Signed-off-by: Conor Dooley --- arch/riscv/include/asm/thread_info.h | 2 ++ arch/riscv/kernel/traps.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/riscv/include/asm/thread_info.h b/arch/riscv/include/asm/thread_info.h index 78933ac04995..67322f878e0d 100644 --- a/arch/riscv/include/asm/thread_info.h +++ b/arch/riscv/include/asm/thread_info.h @@ -42,6 +42,8 @@ #ifndef __ASSEMBLY__ +extern long shadow_stack[SHADOW_OVERFLOW_STACK_SIZE / sizeof(long)]; + #include #include diff --git a/arch/riscv/kernel/traps.c b/arch/riscv/kernel/traps.c index 39d0f8bba4b4..635e6ec26938 100644 --- a/arch/riscv/kernel/traps.c +++ b/arch/riscv/kernel/traps.c @@ -20,9 +20,10 @@ #include #include +#include #include #include -#include +#include int show_unhandled_signals = 1;