From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-180.mta0.migadu.com (out-180.mta0.migadu.com [91.218.175.180]) (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 446C537CD52 for ; Sat, 9 May 2026 07:39:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778312365; cv=none; b=N3tkz3EQY9Fxf0Nv5t6tts5Q2rwlxbfBjxBE9UZEI98RyX+cuDXEMFbNqcy4c0ZRjDYh0fcIPR19yzsYAHmEcui02MB+bBb71zne6vM2GtIzUado4lrCL9prbVXf/RVBhIZqn+HJrNgv4kkX/ekSx7wJ9e3KjtLn7pJ7w/qBlOg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778312365; c=relaxed/simple; bh=m3P5UTf7QNWv2g5DbtvZi4S8gvDYX5rkrsOoDucAc9c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CgaxJNUlcAU2iw2kmG3sy7Yy3c31k3ReoXF04Gw1RZLl/c2SOSnlIuL4o9MS5amTzGz+tJ6xYERuBp6TkP+/LVECC7mzB8ab+gGAWzNSYDMgVJJhKYrGnfPa3tCNdl8HHuCmeOEpU8CIPzvkDYYyev9uJKsZ50yQRDzG0oYVLw0= 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=qljhDLO0; arc=none smtp.client-ip=91.218.175.180 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="qljhDLO0" 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=1778312362; 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=foDb7jRhQ7tTjvHMCNJc4xapsrfITaiL459E77sMl4c=; b=qljhDLO0ORexztI863p++m93L7kO2CAsowpr2erFMXCPPmD23VjzWqZtOE9jptQ0/89EZ/ B55U8cQZEK/ouoHMnkajZQQ6dKuxXF4Go2Bx/iyI425ATrQVQ58/kTBXKLqdEeYAv05O1b g4uXrmAbPEtPIGpyrulLxQpwV39e7fA= 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 v2 2/2] riscv/purgatory: add asm/purgatory.h Date: Sat, 9 May 2026 09:38:51 +0200 Message-ID: <20260509073850.44595-4-thorsten.blum@linux.dev> In-Reply-To: <20260509073850.44595-3-thorsten.blum@linux.dev> References: <20260509073850.44595-3-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=1731; i=thorsten.blum@linux.dev; h=from:subject; bh=m3P5UTf7QNWv2g5DbtvZi4S8gvDYX5rkrsOoDucAc9c=; b=owGbwMvMwCUWt7pQ4caZUj3G02pJDJn/nkwzPlXDmhb3f4H+0ch3exf6XJJjvrParWfKoX27l +bzvbwc0VHKwiDGxSArpsjyYNaPGb6lNZWbTCJ2wsxhZQIZwsDFKQATCX3LyLCi13bRQSORldeP z7j8U9zmk3rrwy055k6sNoGxQXuOZWxlZLjIs767qOCHWU1ok2ph7EUxNgkXhscvNum4dpr3vZT o5wMA 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 --- No changes in patch 2/2. --- 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 745deeb6e3a5..3474e3abe5d7 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)) == 0; } -/* workaround for a warning with -Wmissing-prototypes */ -void purgatory(void); - void purgatory(void) { if (!verify_sha256_digest())