lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Y7ynnzmfy+Kxj8hQ@fedora>
Date:   Tue, 10 Jan 2023 07:47:43 +0800
From:   Baoquan He <bhe@...hat.com>
To:     Eric DeVolder <eric.devolder@...cle.com>
Cc:     linux-kernel@...r.kernel.org, x86@...nel.org,
        kexec@...ts.infradead.org, ebiederm@...ssion.com,
        dyoung@...hat.com, vgoyal@...hat.com, tglx@...utronix.de,
        mingo@...hat.com, bp@...en8.de, dave.hansen@...ux.intel.com,
        hpa@...or.com, nramas@...ux.microsoft.com, thomas.lendacky@....com,
        robh@...nel.org, efault@....de, rppt@...nel.org, david@...hat.com,
        sourabhjain@...ux.ibm.com, konrad.wilk@...cle.com,
        boris.ostrovsky@...cle.com
Subject: Re: [PATCH v16 7/7] x86/crash: add x86 crash hotplug support

On 01/09/23 at 01:43pm, Eric DeVolder wrote:
> 
> 
> On 1/9/23 01:36, Baoquan He wrote:
> > On 01/05/23 at 10:17am, Eric DeVolder wrote:
> > ......
> > > @@ -394,10 +409,37 @@ int crash_load_segments(struct kimage *image)
> > >   	if (ret)
> > >   		return ret;
> > > -	image->elf_headers = kbuf.buffer;
> > > -	image->elf_headers_sz = kbuf.bufsz;
> > > +	image->elf_headers	= kbuf.buffer;
> > > +	image->elf_headers_sz	= kbuf.bufsz;
> > > +	kbuf.memsz		= kbuf.bufsz;
> > > +
> > > +	if (IS_ENABLED(CONFIG_CRASH_HOTPLUG)) {
> > > +		/*
> > > +		 * Ensure the elfcorehdr segment large enough for hotplug changes.
> > > +		 * Start with VMCOREINFO and kernel_map.
> > > +		 */
> > > +		unsigned long pnum = 2;
> > > +
> > > +		if (IS_ENABLED(CONFIG_HOTPLUG_CPU))
> > > +			pnum += CONFIG_NR_CPUS_DEFAULT;
> > > +
> > > +		if (IS_ENABLED(CONFIG_MEMORY_HOTPLUG))
> > > +			pnum += CRASH_MAX_MEMORY_RANGES;
> > 
> > Logic of pnum calculating is a little confusing to me. If I only enable
> > one of CONFIG_HOTPLUG_CPU and CONFIG_MEMORY_HOTPLUG, is it OK? Say I
> > only enable CONFIG_HOTPLUG_CPU and CONFIG_SMP, on x86_64,
> > CONFIG_NR_CPUS_DEFAULT will be 64. pnum will be 64, is it OK. Am I miss
> > anything?
> 
> Ah, your understanding is correct, and the issue you point out I need to fix.
> Specifically is only one of HOTPLUG_CPU or MEMORY_HOTPLUG is set, then I need
> to allow a default for the other. Using the example you have above, there would
> not be room for a single memory region, so I need to allow for a default number
> of memory regions.

Hmm, for the above example, should we get real number of memory
regions? I am worried if the default number of memory regions 
need be big enough. Because on system w/o memory hotplug, it could have
very many memory regions. The cpu number is similar.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ