diff for duplicates of <YmeBjrChOHsIYG3e@MiWiFi-R3L-srv> diff --git a/a/1.txt b/N1/1.txt index 0589ad4..a2a2b93 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -25,118 +25,118 @@ On 04/26/22 at 09:36am, Sourabh Jain wrote: > > > > > > > > Signed-off-by: Eric DeVolder <eric.devolder@oracle.com> > > > > --- -> > > > ? include/linux/kexec.h |? 16 +++++++ -> > > > ? kernel/crash_core.c?? | 101 +> > > > include/linux/kexec.h | 16 +++++++ +> > > > kernel/crash_core.c | 101 > > > > ++++++++++++++++++++++++++++++++++++++++++ -> > > > ? 2 files changed, 117 insertions(+) +> > > > 2 files changed, 117 insertions(+) > > > > > > > > diff --git a/include/linux/kexec.h b/include/linux/kexec.h > > > > index f93f2591fc1e..02daff1f47dd 100644 > > > > --- a/include/linux/kexec.h > > > > +++ b/include/linux/kexec.h > > > > @@ -306,6 +306,13 @@ struct kimage { -> > > > ? ????? /* Information for loading purgatory */ -> > > > ????? struct purgatory_info purgatory_info; +> > > > /* Information for loading purgatory */ +> > > > struct purgatory_info purgatory_info; > > > > + > > > > +#ifdef CONFIG_CRASH_HOTPLUG -> > > > +??? bool hotplug_event; -> > > > +??? unsigned int offlinecpu; -> > > > +??? bool elfcorehdr_index_valid; -> > > > +??? int elfcorehdr_index; +> > > > + bool hotplug_event; +> > > > + unsigned int offlinecpu; +> > > > + bool elfcorehdr_index_valid; +> > > > + int elfcorehdr_index; > > > > +#endif -> > > > ? #endif -> > > > ? ? #ifdef CONFIG_IMA_KEXEC +> > > > #endif +> > > > #ifdef CONFIG_IMA_KEXEC > > > > @@ -322,6 +329,15 @@ struct kimage { -> > > > ????? unsigned long elf_load_addr; -> > > > ? }; -> > > > ? +#ifdef CONFIG_CRASH_HOTPLUG +> > > > unsigned long elf_load_addr; +> > > > }; +> > > > +#ifdef CONFIG_CRASH_HOTPLUG > > > > +void arch_crash_hotplug_handler(struct kimage *image, -> > > > +??? unsigned int hp_action, unsigned int cpu); -> > > > +#define KEXEC_CRASH_HP_REMOVE_CPU?? 0 -> > > > +#define KEXEC_CRASH_HP_ADD_CPU????? 1 +> > > > + unsigned int hp_action, unsigned int cpu); +> > > > +#define KEXEC_CRASH_HP_REMOVE_CPU 0 +> > > > +#define KEXEC_CRASH_HP_ADD_CPU 1 > > > > +#define KEXEC_CRASH_HP_REMOVE_MEMORY 2 -> > > > +#define KEXEC_CRASH_HP_ADD_MEMORY?? 3 +> > > > +#define KEXEC_CRASH_HP_ADD_MEMORY 3 > > > > +#endif /* CONFIG_CRASH_HOTPLUG */ > > > > + -> > > > ? /* kexec interface functions */ -> > > > ? extern void machine_kexec(struct kimage *image); -> > > > ? extern int machine_kexec_prepare(struct kimage *image); +> > > > /* kexec interface functions */ +> > > > extern void machine_kexec(struct kimage *image); +> > > > extern int machine_kexec_prepare(struct kimage *image); > > > > diff --git a/kernel/crash_core.c b/kernel/crash_core.c > > > > index 256cf6db573c..ecf746243ab2 100644 > > > > --- a/kernel/crash_core.c > > > > +++ b/kernel/crash_core.c > > > > @@ -9,12 +9,17 @@ -> > > > ? #include <linux/init.h> -> > > > ? #include <linux/utsname.h> -> > > > ? #include <linux/vmalloc.h> +> > > > #include <linux/init.h> +> > > > #include <linux/utsname.h> +> > > > #include <linux/vmalloc.h> > > > > +#include <linux/highmem.h> > > > > +#include <linux/memory.h> > > > > +#include <linux/cpuhotplug.h> -> > > > ? ? #include <asm/page.h> -> > > > ? #include <asm/sections.h> -> > > > ? ? #include <crypto/sha1.h> -> > > > ? +#include "kexec_internal.h" +> > > > #include <asm/page.h> +> > > > #include <asm/sections.h> +> > > > #include <crypto/sha1.h> +> > > > +#include "kexec_internal.h" > > > > + -> > > > ? /* vmcoreinfo stuff */ -> > > > ? unsigned char *vmcoreinfo_data; -> > > > ? size_t vmcoreinfo_size; +> > > > /* vmcoreinfo stuff */ +> > > > unsigned char *vmcoreinfo_data; +> > > > size_t vmcoreinfo_size; > > > > @@ -491,3 +496,99 @@ static int __init crash_save_vmcoreinfo_init(void) -> > > > ? } -> > > > ? ? subsys_initcall(crash_save_vmcoreinfo_init); +> > > > } +> > > > subsys_initcall(crash_save_vmcoreinfo_init); > > > > + > > > > +#ifdef CONFIG_CRASH_HOTPLUG > > > > +void __weak arch_crash_hotplug_handler(struct kimage *image, -> > > > +??? unsigned int hp_action, unsigned int cpu) +> > > > + unsigned int hp_action, unsigned int cpu) > > > > +{ -> > > > +??? pr_warn("crash hp: %s not implemented", __func__); +> > > > + pr_warn("crash hp: %s not implemented", __func__); > > > > +} > > > > + > > > > +static void crash_hotplug_handler(unsigned int hp_action, -> > > > +??? unsigned int cpu) +> > > > + unsigned int cpu) > > > > +{ -> > > > +??? /* Obtain lock while changing crash information */ -> > > > +??? if (!mutex_trylock(&kexec_mutex)) -> > > > +??????? return; +> > > > + /* Obtain lock while changing crash information */ +> > > > + if (!mutex_trylock(&kexec_mutex)) +> > > > + return; > > > > + -> > > > +??? /* Check kdump is loaded */ -> > > > +??? if (kexec_crash_image) { -> > > > +??????? pr_debug("crash hp: hp_action %u, cpu %u", hp_action, cpu); +> > > > + /* Check kdump is loaded */ +> > > > + if (kexec_crash_image) { +> > > > + pr_debug("crash hp: hp_action %u, cpu %u", hp_action, cpu); > > > > + -> > > > +??????? /* Needed in order for the segments to be updated */ -> > > > +??????? arch_kexec_unprotect_crashkres(); +> > > > + /* Needed in order for the segments to be updated */ +> > > > + arch_kexec_unprotect_crashkres(); > > > > + -> > > > +??????? /* Flag to differentiate between normal load and hotplug */ -> > > > +??????? kexec_crash_image->hotplug_event = true; +> > > > + /* Flag to differentiate between normal load and hotplug */ +> > > > + kexec_crash_image->hotplug_event = true; > > > > + -> > > > +??????? /* Now invoke arch-specific update handler */ -> > > > +??????? arch_crash_hotplug_handler(kexec_crash_image, hp_action, cpu); +> > > > + /* Now invoke arch-specific update handler */ +> > > > + arch_crash_hotplug_handler(kexec_crash_image, hp_action, cpu); > > > > + -> > > > +??????? /* No longer handling a hotplug event */ -> > > > +??????? kexec_crash_image->hotplug_event = false; +> > > > + /* No longer handling a hotplug event */ +> > > > + kexec_crash_image->hotplug_event = false; > > > > + -> > > > +??????? /* Change back to read-only */ -> > > > +??????? arch_kexec_protect_crashkres(); -> > > > +??? } +> > > > + /* Change back to read-only */ +> > > > + arch_kexec_protect_crashkres(); +> > > > + } > > > > + -> > > > +??? /* Release lock now that update complete */ -> > > > +??? mutex_unlock(&kexec_mutex); +> > > > + /* Release lock now that update complete */ +> > > > + mutex_unlock(&kexec_mutex); > > > > +} > > > > + > > > > +#if defined(CONFIG_MEMORY_HOTPLUG) > > > > +static int crash_memhp_notifier(struct notifier_block *nb, -> > > > +??? unsigned long val, void *v) +> > > > + unsigned long val, void *v) > > > > +{ -> > > > +??? struct memory_notify *mhp = v; +> > > > + struct memory_notify *mhp = v; > > > > + -> > > > +??? switch (val) { -> > > > +??? case MEM_ONLINE: -> > > > +??????? crash_hotplug_handler(KEXEC_CRASH_HP_ADD_MEMORY, -1U); +> > > > + switch (val) { +> > > > + case MEM_ONLINE: +> > > > + crash_hotplug_handler(KEXEC_CRASH_HP_ADD_MEMORY, -1U); > > > We don't differentiate the memory add/remove, cpu add, except of cpu > > > remove. Means the hp_action only differentiate cpu remove from the other > > > action. Maybe only making two types? > > > -> > > #define KEXEC_CRASH_HP_REMOVE_CPU?? 0 -> > > #define KEXEC_CRASH_HP_UPDATE_OTHER????? 1 +> > > #define KEXEC_CRASH_HP_REMOVE_CPU 0 +> > > #define KEXEC_CRASH_HP_UPDATE_OTHER 1 > > > > > Sourabh Jain's work with PPC uses REMOVE_CPU, REMOVE_MEMORY, and > > ADD_MEMORY. diff --git a/a/content_digest b/N1/content_digest index c77b227..e48606f 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -4,9 +4,29 @@ "ref\04eea2373-32f3-9960-cbec-21dc1a428807@oracle.com\0" "ref\06f3a6cbb-0ac4-f178-fc17-18f9594da319@linux.ibm.com\0" "From\0Baoquan He <bhe@redhat.com>\0" - "Subject\0[PATCH v7 4/8] crash: add generic infrastructure for crash hotplug support\0" + "Subject\0Re: [PATCH v7 4/8] crash: add generic infrastructure for crash hotplug support\0" "Date\0Tue, 26 Apr 2022 13:22:22 +0800\0" - "To\0kexec@lists.infradead.org\0" + "To\0Sourabh Jain <sourabhjain@linux.ibm.com>\0" + "Cc\0Eric DeVolder <eric.devolder@oracle.com>" + linux-kernel@vger.kernel.org + x86@kernel.org + kexec@lists.infradead.org + ebiederm@xmission.com + dyoung@redhat.com + vgoyal@redhat.com + tglx@linutronix.de + mingo@redhat.com + bp@alien8.de + dave.hansen@linux.intel.com + hpa@zytor.com + nramas@linux.microsoft.com + thomas.lendacky@amd.com + robh@kernel.org + efault@gmx.de + rppt@kernel.org + david@redhat.com + konrad.wilk@oracle.com + " boris.ostrovsky@oracle.com\0" "\00:1\0" "b\0" "On 04/26/22 at 09:36am, Sourabh Jain wrote:\n" @@ -36,118 +56,118 @@ "> > > > \n" "> > > > Signed-off-by: Eric DeVolder <eric.devolder@oracle.com>\n" "> > > > ---\n" - "> > > > ? include/linux/kexec.h |? 16 +++++++\n" - "> > > > ? kernel/crash_core.c?? | 101\n" + "> > > > \302\240 include/linux/kexec.h |\302\240 16 +++++++\n" + "> > > > \302\240 kernel/crash_core.c\302\240\302\240 | 101\n" "> > > > ++++++++++++++++++++++++++++++++++++++++++\n" - "> > > > ? 2 files changed, 117 insertions(+)\n" + "> > > > \302\240 2 files changed, 117 insertions(+)\n" "> > > > \n" "> > > > diff --git a/include/linux/kexec.h b/include/linux/kexec.h\n" "> > > > index f93f2591fc1e..02daff1f47dd 100644\n" "> > > > --- a/include/linux/kexec.h\n" "> > > > +++ b/include/linux/kexec.h\n" "> > > > @@ -306,6 +306,13 @@ struct kimage {\n" - "> > > > ? ????? /* Information for loading purgatory */\n" - "> > > > ????? struct purgatory_info purgatory_info;\n" + "> > > > \302\240 \302\240\302\240\302\240\302\240\302\240 /* Information for loading purgatory */\n" + "> > > > \302\240\302\240\302\240\302\240\302\240 struct purgatory_info purgatory_info;\n" "> > > > +\n" "> > > > +#ifdef CONFIG_CRASH_HOTPLUG\n" - "> > > > +??? bool hotplug_event;\n" - "> > > > +??? unsigned int offlinecpu;\n" - "> > > > +??? bool elfcorehdr_index_valid;\n" - "> > > > +??? int elfcorehdr_index;\n" + "> > > > +\302\240\302\240\302\240 bool hotplug_event;\n" + "> > > > +\302\240\302\240\302\240 unsigned int offlinecpu;\n" + "> > > > +\302\240\302\240\302\240 bool elfcorehdr_index_valid;\n" + "> > > > +\302\240\302\240\302\240 int elfcorehdr_index;\n" "> > > > +#endif\n" - "> > > > ? #endif\n" - "> > > > ? ? #ifdef CONFIG_IMA_KEXEC\n" + "> > > > \302\240 #endif\n" + "> > > > \302\240 \302\240 #ifdef CONFIG_IMA_KEXEC\n" "> > > > @@ -322,6 +329,15 @@ struct kimage {\n" - "> > > > ????? unsigned long elf_load_addr;\n" - "> > > > ? };\n" - "> > > > ? +#ifdef CONFIG_CRASH_HOTPLUG\n" + "> > > > \302\240\302\240\302\240\302\240\302\240 unsigned long elf_load_addr;\n" + "> > > > \302\240 };\n" + "> > > > \302\240 +#ifdef CONFIG_CRASH_HOTPLUG\n" "> > > > +void arch_crash_hotplug_handler(struct kimage *image,\n" - "> > > > +??? unsigned int hp_action, unsigned int cpu);\n" - "> > > > +#define KEXEC_CRASH_HP_REMOVE_CPU?? 0\n" - "> > > > +#define KEXEC_CRASH_HP_ADD_CPU????? 1\n" + "> > > > +\302\240\302\240\302\240 unsigned int hp_action, unsigned int cpu);\n" + "> > > > +#define KEXEC_CRASH_HP_REMOVE_CPU\302\240\302\240 0\n" + "> > > > +#define KEXEC_CRASH_HP_ADD_CPU\302\240\302\240\302\240\302\240\302\240 1\n" "> > > > +#define KEXEC_CRASH_HP_REMOVE_MEMORY 2\n" - "> > > > +#define KEXEC_CRASH_HP_ADD_MEMORY?? 3\n" + "> > > > +#define KEXEC_CRASH_HP_ADD_MEMORY\302\240\302\240 3\n" "> > > > +#endif /* CONFIG_CRASH_HOTPLUG */\n" "> > > > +\n" - "> > > > ? /* kexec interface functions */\n" - "> > > > ? extern void machine_kexec(struct kimage *image);\n" - "> > > > ? extern int machine_kexec_prepare(struct kimage *image);\n" + "> > > > \302\240 /* kexec interface functions */\n" + "> > > > \302\240 extern void machine_kexec(struct kimage *image);\n" + "> > > > \302\240 extern int machine_kexec_prepare(struct kimage *image);\n" "> > > > diff --git a/kernel/crash_core.c b/kernel/crash_core.c\n" "> > > > index 256cf6db573c..ecf746243ab2 100644\n" "> > > > --- a/kernel/crash_core.c\n" "> > > > +++ b/kernel/crash_core.c\n" "> > > > @@ -9,12 +9,17 @@\n" - "> > > > ? #include <linux/init.h>\n" - "> > > > ? #include <linux/utsname.h>\n" - "> > > > ? #include <linux/vmalloc.h>\n" + "> > > > \302\240 #include <linux/init.h>\n" + "> > > > \302\240 #include <linux/utsname.h>\n" + "> > > > \302\240 #include <linux/vmalloc.h>\n" "> > > > +#include <linux/highmem.h>\n" "> > > > +#include <linux/memory.h>\n" "> > > > +#include <linux/cpuhotplug.h>\n" - "> > > > ? ? #include <asm/page.h>\n" - "> > > > ? #include <asm/sections.h>\n" - "> > > > ? ? #include <crypto/sha1.h>\n" - "> > > > ? +#include \"kexec_internal.h\"\n" + "> > > > \302\240 \302\240 #include <asm/page.h>\n" + "> > > > \302\240 #include <asm/sections.h>\n" + "> > > > \302\240 \302\240 #include <crypto/sha1.h>\n" + "> > > > \302\240 +#include \"kexec_internal.h\"\n" "> > > > +\n" - "> > > > ? /* vmcoreinfo stuff */\n" - "> > > > ? unsigned char *vmcoreinfo_data;\n" - "> > > > ? size_t vmcoreinfo_size;\n" + "> > > > \302\240 /* vmcoreinfo stuff */\n" + "> > > > \302\240 unsigned char *vmcoreinfo_data;\n" + "> > > > \302\240 size_t vmcoreinfo_size;\n" "> > > > @@ -491,3 +496,99 @@ static int __init crash_save_vmcoreinfo_init(void)\n" - "> > > > ? }\n" - "> > > > ? ? subsys_initcall(crash_save_vmcoreinfo_init);\n" + "> > > > \302\240 }\n" + "> > > > \302\240 \302\240 subsys_initcall(crash_save_vmcoreinfo_init);\n" "> > > > +\n" "> > > > +#ifdef CONFIG_CRASH_HOTPLUG\n" "> > > > +void __weak arch_crash_hotplug_handler(struct kimage *image,\n" - "> > > > +??? unsigned int hp_action, unsigned int cpu)\n" + "> > > > +\302\240\302\240\302\240 unsigned int hp_action, unsigned int cpu)\n" "> > > > +{\n" - "> > > > +??? pr_warn(\"crash hp: %s not implemented\", __func__);\n" + "> > > > +\302\240\302\240\302\240 pr_warn(\"crash hp: %s not implemented\", __func__);\n" "> > > > +}\n" "> > > > +\n" "> > > > +static void crash_hotplug_handler(unsigned int hp_action,\n" - "> > > > +??? unsigned int cpu)\n" + "> > > > +\302\240\302\240\302\240 unsigned int cpu)\n" "> > > > +{\n" - "> > > > +??? /* Obtain lock while changing crash information */\n" - "> > > > +??? if (!mutex_trylock(&kexec_mutex))\n" - "> > > > +??????? return;\n" + "> > > > +\302\240\302\240\302\240 /* Obtain lock while changing crash information */\n" + "> > > > +\302\240\302\240\302\240 if (!mutex_trylock(&kexec_mutex))\n" + "> > > > +\302\240\302\240\302\240\302\240\302\240\302\240\302\240 return;\n" "> > > > +\n" - "> > > > +??? /* Check kdump is loaded */\n" - "> > > > +??? if (kexec_crash_image) {\n" - "> > > > +??????? pr_debug(\"crash hp: hp_action %u, cpu %u\", hp_action, cpu);\n" + "> > > > +\302\240\302\240\302\240 /* Check kdump is loaded */\n" + "> > > > +\302\240\302\240\302\240 if (kexec_crash_image) {\n" + "> > > > +\302\240\302\240\302\240\302\240\302\240\302\240\302\240 pr_debug(\"crash hp: hp_action %u, cpu %u\", hp_action, cpu);\n" "> > > > +\n" - "> > > > +??????? /* Needed in order for the segments to be updated */\n" - "> > > > +??????? arch_kexec_unprotect_crashkres();\n" + "> > > > +\302\240\302\240\302\240\302\240\302\240\302\240\302\240 /* Needed in order for the segments to be updated */\n" + "> > > > +\302\240\302\240\302\240\302\240\302\240\302\240\302\240 arch_kexec_unprotect_crashkres();\n" "> > > > +\n" - "> > > > +??????? /* Flag to differentiate between normal load and hotplug */\n" - "> > > > +??????? kexec_crash_image->hotplug_event = true;\n" + "> > > > +\302\240\302\240\302\240\302\240\302\240\302\240\302\240 /* Flag to differentiate between normal load and hotplug */\n" + "> > > > +\302\240\302\240\302\240\302\240\302\240\302\240\302\240 kexec_crash_image->hotplug_event = true;\n" "> > > > +\n" - "> > > > +??????? /* Now invoke arch-specific update handler */\n" - "> > > > +??????? arch_crash_hotplug_handler(kexec_crash_image, hp_action, cpu);\n" + "> > > > +\302\240\302\240\302\240\302\240\302\240\302\240\302\240 /* Now invoke arch-specific update handler */\n" + "> > > > +\302\240\302\240\302\240\302\240\302\240\302\240\302\240 arch_crash_hotplug_handler(kexec_crash_image, hp_action, cpu);\n" "> > > > +\n" - "> > > > +??????? /* No longer handling a hotplug event */\n" - "> > > > +??????? kexec_crash_image->hotplug_event = false;\n" + "> > > > +\302\240\302\240\302\240\302\240\302\240\302\240\302\240 /* No longer handling a hotplug event */\n" + "> > > > +\302\240\302\240\302\240\302\240\302\240\302\240\302\240 kexec_crash_image->hotplug_event = false;\n" "> > > > +\n" - "> > > > +??????? /* Change back to read-only */\n" - "> > > > +??????? arch_kexec_protect_crashkres();\n" - "> > > > +??? }\n" + "> > > > +\302\240\302\240\302\240\302\240\302\240\302\240\302\240 /* Change back to read-only */\n" + "> > > > +\302\240\302\240\302\240\302\240\302\240\302\240\302\240 arch_kexec_protect_crashkres();\n" + "> > > > +\302\240\302\240\302\240 }\n" "> > > > +\n" - "> > > > +??? /* Release lock now that update complete */\n" - "> > > > +??? mutex_unlock(&kexec_mutex);\n" + "> > > > +\302\240\302\240\302\240 /* Release lock now that update complete */\n" + "> > > > +\302\240\302\240\302\240 mutex_unlock(&kexec_mutex);\n" "> > > > +}\n" "> > > > +\n" "> > > > +#if defined(CONFIG_MEMORY_HOTPLUG)\n" "> > > > +static int crash_memhp_notifier(struct notifier_block *nb,\n" - "> > > > +??? unsigned long val, void *v)\n" + "> > > > +\302\240\302\240\302\240 unsigned long val, void *v)\n" "> > > > +{\n" - "> > > > +??? struct memory_notify *mhp = v;\n" + "> > > > +\302\240\302\240\302\240 struct memory_notify *mhp = v;\n" "> > > > +\n" - "> > > > +??? switch (val) {\n" - "> > > > +??? case MEM_ONLINE:\n" - "> > > > +??????? crash_hotplug_handler(KEXEC_CRASH_HP_ADD_MEMORY, -1U);\n" + "> > > > +\302\240\302\240\302\240 switch (val) {\n" + "> > > > +\302\240\302\240\302\240 case MEM_ONLINE:\n" + "> > > > +\302\240\302\240\302\240\302\240\302\240\302\240\302\240 crash_hotplug_handler(KEXEC_CRASH_HP_ADD_MEMORY, -1U);\n" "> > > We don't differentiate the memory add/remove, cpu add, except of cpu\n" "> > > remove. Means the hp_action only differentiate cpu remove from the other\n" "> > > action. Maybe only making two types?\n" "> > > \n" - "> > > #define KEXEC_CRASH_HP_REMOVE_CPU?? 0\n" - "> > > #define KEXEC_CRASH_HP_UPDATE_OTHER????? 1\n" + "> > > #define KEXEC_CRASH_HP_REMOVE_CPU\302\240\302\240 0\n" + "> > > #define KEXEC_CRASH_HP_UPDATE_OTHER\302\240\302\240\302\240\302\240\302\240 1\n" "> > > \n" "> > Sourabh Jain's work with PPC uses REMOVE_CPU, REMOVE_MEMORY, and\n" "> > ADD_MEMORY.\n" @@ -180,4 +200,4 @@ "> Sourabh Jain\n" > -f12532dc156cd3a495bf93415b2e1d7726fa1fa99b1f1414e88248b303a8d64a +232e503efd2a0bf69eeb02e10cede99cb7a0f82a1abad237e649b7e673a213dc
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.