From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-183.mta0.migadu.com (out-183.mta0.migadu.com [91.218.175.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6E4F22F90C9 for ; Sun, 12 Apr 2026 19:42:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.183 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776022969; cv=none; b=qWe/LJ4qLpHTkehrx8SQXehcfXCAQlq0DQxD2ON8q3ZOkkVTcKKQeZBvPfUtS9h/xswd9jYZB5fn6eMhIE/o2KZy8hFKygyb3EVWyk4lnTH/LfhGuD6BQ7qKgrdpePf6Wa+59Nue6XAPfRyXxYW6nnx8zDKvmDllCZ+Us41e+pM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776022969; c=relaxed/simple; bh=HB+vajFVtEoIDbr3Y2w6LEv93VTwKtHpJs0r8RrScho=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uRF3ZX31kFANzkt+3AbK/EyXl5V24eAielZRki6p/fcMgN3Lclcfd6aqWzGThY35r4QZb1TimPzXn/3rVUQuZcfM2HZIfjW+Ml9KZQdo4KhdND1EXLPSwa2M/aHCNeRkpchULkkueHllL63JVNb5Uv/b3guEK/AC5miM5b17fZ8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=UQf7nYuK; arc=none smtp.client-ip=91.218.175.183 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="UQf7nYuK" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1776022966; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nQkYNSGrXU327YT/AkU4IhOfysgSoF6ODaYcCM0x4bw=; b=UQf7nYuKEHEhyXU0uZz6AHhjA8TRxuq+S2/UpMXv45bejv2Z2RyxzWLk3IZGF5G1xlyS1z rJX6uhr44KICewJZnBJM8yYtG9P8ECAaH9BQbx2trfpyB0JeIFHqbbqpqRKPoCnAmKPu70 VK0AvkqQ3AnVYn2GiJuA1WmVMsbLNe0= From: Thorsten Blum To: Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Eric Biggers , Ard Biesheuvel Cc: Thorsten Blum , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] riscv/purgatory: add asm/purgatory.h Date: Sun, 12 Apr 2026 21:41:16 +0200 Message-ID: <20260412194113.228703-6-thorsten.blum@linux.dev> In-Reply-To: <20260412194113.228703-4-thorsten.blum@linux.dev> References: <20260412194113.228703-4-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1694; i=thorsten.blum@linux.dev; h=from:subject; bh=HB+vajFVtEoIDbr3Y2w6LEv93VTwKtHpJs0r8RrScho=; b=owGbwMvMwCUWt7pQ4caZUj3G02pJDJm3v2adUjZS+uqZ2PGRgdtL8cxNmwcmnC+y1mr+9LHpj kln4ZjcUcrCIMbFICumyPJg1o8ZvqU1lZtMInbCzGFlAhnCwMUpABN5kcbw3z+358XcKO/i9tP+ 77dK6G7x0Hjh/1KbZfrPqw7TrblnT2ZkeGvEwnPiiMAqhtwFdlrTeDwzpn1ZKyQhupS7d9N684Q ofgA= X-Developer-Key: i=thorsten.blum@linux.dev; a=openpgp; fpr=1D60735E8AEF3BE473B69D84733678FD8DFEEAD4 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT Add arch/riscv/include/asm/purgatory.h and provide the purgatory() prototype via the architecture header, mirroring the x86 layout. Remove the workaround from arch/riscv/purgatory/purgatory.c. Signed-off-by: Thorsten Blum --- arch/riscv/include/asm/purgatory.h | 11 +++++++++++ arch/riscv/purgatory/purgatory.c | 5 +---- 2 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 arch/riscv/include/asm/purgatory.h diff --git a/arch/riscv/include/asm/purgatory.h b/arch/riscv/include/asm/purgatory.h new file mode 100644 index 000000000000..a63687be2517 --- /dev/null +++ b/arch/riscv/include/asm/purgatory.h @@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _ASM_RISCV_PURGATORY_H +#define _ASM_RISCV_PURGATORY_H + +#ifndef __ASSEMBLER__ +#include + +extern void purgatory(void); +#endif /* __ASSEMBLER__ */ + +#endif /* _ASM_RISCV_PURGATORY_H */ diff --git a/arch/riscv/purgatory/purgatory.c b/arch/riscv/purgatory/purgatory.c index 15c72dafa3d8..6a6e6f611a56 100644 --- a/arch/riscv/purgatory/purgatory.c +++ b/arch/riscv/purgatory/purgatory.c @@ -8,9 +8,9 @@ * */ -#include #include #include +#include #include u8 purgatory_sha256_digest[SHA256_DIGEST_SIZE] __section(".kexec-purgatory"); @@ -32,9 +32,6 @@ static bool verify_sha256_digest(void) return memcmp(digest, purgatory_sha256_digest, sizeof(digest)); } -/* workaround for a warning with -Wmissing-prototypes */ -void purgatory(void); - void purgatory(void) { if (verify_sha256_digest())