mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-12 08:26:38 -04:00
kexec: add KHO parsing support
When we have a KHO kexec, we get an FDT blob and scratch region to populate the state of the system. Provide helper functions that allow architecture code to easily handle memory reservations based on them and give device drivers visibility into the KHO FDT and memory reservations so they can recover their own state. Include a fix from Arnd Bergmann <arnd@arndb.de> https://lore.kernel.org/lkml/20250424093302.3894961-1-arnd@kernel.org/. Link: https://lkml.kernel.org/r/20250509074635.3187114-6-changyuanl@google.com Signed-off-by: Alexander Graf <graf@amazon.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Co-developed-by: Mike Rapoport (Microsoft) <rppt@kernel.org> Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org> Co-developed-by: Changyuan Lyu <changyuanl@google.com> Signed-off-by: Changyuan Lyu <changyuanl@google.com> Cc: Andy Lutomirski <luto@kernel.org> Cc: Anthony Yznaga <anthony.yznaga@oracle.com> Cc: Ashish Kalra <ashish.kalra@amd.com> Cc: Ben Herrenschmidt <benh@kernel.crashing.org> Cc: Borislav Betkov <bp@alien8.de> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Dave Hansen <dave.hansen@linux.intel.com> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Eric Biederman <ebiederm@xmission.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: James Gowans <jgowans@amazon.com> Cc: Jason Gunthorpe <jgg@nvidia.com> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Krzysztof Kozlowski <krzk@kernel.org> Cc: Marc Rutland <mark.rutland@arm.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Pasha Tatashin <pasha.tatashin@soleen.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Pratyush Yadav <ptyadav@amazon.de> Cc: Rob Herring <robh@kernel.org> Cc: Saravana Kannan <saravanak@google.com> Cc: Stanislav Kinsburskii <skinsburskii@linux.microsoft.com> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Thomas Gleinxer <tglx@linutronix.de> Cc: Thomas Lendacky <thomas.lendacky@amd.com> Cc: Will Deacon <will@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
committed by
Andrew Morton
parent
3dc92c3114
commit
c609c144b0
@@ -24,11 +24,15 @@ struct kho_serialization;
|
||||
bool kho_is_enabled(void);
|
||||
|
||||
int kho_add_subtree(struct kho_serialization *ser, const char *name, void *fdt);
|
||||
int kho_retrieve_subtree(const char *name, phys_addr_t *phys);
|
||||
|
||||
int register_kho_notifier(struct notifier_block *nb);
|
||||
int unregister_kho_notifier(struct notifier_block *nb);
|
||||
|
||||
void kho_memory_init(void);
|
||||
|
||||
void kho_populate(phys_addr_t fdt_phys, u64 fdt_len, phys_addr_t scratch_phys,
|
||||
u64 scratch_len);
|
||||
#else
|
||||
static inline bool kho_is_enabled(void)
|
||||
{
|
||||
@@ -41,6 +45,11 @@ static inline int kho_add_subtree(struct kho_serialization *ser,
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
static inline int kho_retrieve_subtree(const char *name, phys_addr_t *phys)
|
||||
{
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
static inline int register_kho_notifier(struct notifier_block *nb)
|
||||
{
|
||||
return -EOPNOTSUPP;
|
||||
@@ -54,6 +63,11 @@ static inline int unregister_kho_notifier(struct notifier_block *nb)
|
||||
static inline void kho_memory_init(void)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void kho_populate(phys_addr_t fdt_phys, u64 fdt_len,
|
||||
phys_addr_t scratch_phys, u64 scratch_len)
|
||||
{
|
||||
}
|
||||
#endif /* CONFIG_KEXEC_HANDOVER */
|
||||
|
||||
#endif /* LINUX_KEXEC_HANDOVER_H */
|
||||
|
||||
Reference in New Issue
Block a user