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]
Date:	Wed, 6 Feb 2013 22:39:32 -0800
From:	Yinghai Lu <yinghai@...nel.org>
To:	Rob Landley <rob@...dley.net>
Cc:	mingo@...nel.org, hpa@...or.com, linux-kernel@...r.kernel.org,
	ebiederm@...ssion.com, tglx@...utronix.de, hpa@...ux.intel.com,
	linux-tip-commits@...r.kernel.org
Subject: Re: [tip:x86/mm2] x86: Add Crash kernel low reservation

On Wed, Feb 6, 2013 at 9:14 PM, Rob Landley <rob@...dley.net> wrote:
> Yeah yeah, I'm behind on email...
>
>
> On 01/29/2013 07:51:25 PM, tip-bot for Yinghai Lu wrote:
>>
>> Commit-ID:  2cde8ae169982ad1d1023ac628bb54053d0e9d4d
>> Gitweb:
>> http://git.kernel.org/tip/2cde8ae169982ad1d1023ac628bb54053d0e9d4d
>> Author:     Yinghai Lu <yinghai@...nel.org>
>> AuthorDate: Thu, 24 Jan 2013 12:20:11 -0800
>> Committer:  H. Peter Anvin <hpa@...ux.intel.com>
>> CommitDate: Tue, 29 Jan 2013 15:31:59 -0800
>>
>> x86: Add Crash kernel low reservation
>>
>> During kdump kernel's booting stage, it need to find low ram for
>> swiotlb buffer when system does not support intel iommu/dmar remapping.
>>
>> kexed-tools is appending memmap=exactmap and range from /proc/iomem
>> with "Crash kernel", and that range is above 4G for 64bit after boot
>> protocol 2.12.
>>
>> We need to add another range in /proc/iomem like "Crash kernel low",
>> so kexec-tools could find that info and append to kdump kernel
>> command line.
>>
>> User could specify the size with crashkernel_low=XX[KMG].
>>
>> -v2: fix warning that is found by Fengguang's test robot.
>> -v3: move out get_mem_size change to another patch, to solve compiling
>>      warning that is found by Borislav Petkov <bp@...en8.de>
>> -v4: user must specify crashkernel_low if system does not support
>>      intel or amd iommu.
>
>
> I missed: why can we not autodetect the lack of support and DTRT?

We need to process crashkernel early, and at that time we can not find out if
we can get iommu initialized properly.

>
>
>> Signed-off-by: Yinghai Lu <yinghai@...nel.org>
>> Link:
>> http://lkml.kernel.org/r/1359058816-7615-31-git-send-email-yinghai@kernel.org
>> Cc: Eric Biederman <ebiederm@...ssion.com>
>> Cc: Rob Landley <rob@...dley.net>
>> Signed-off-by: H. Peter Anvin <hpa@...ux.intel.com>
>> ---
>>  Documentation/kernel-parameters.txt |  3 +++
>>  arch/x86/kernel/setup.c             | 42
>> +++++++++++++++++++++++++++++++++++--
>>  include/linux/kexec.h               |  3 +++
>>  kernel/kexec.c                      | 34 +++++++++++++++++++++++++-----
>>  4 files changed, 75 insertions(+), 7 deletions(-)
>>
>> diff --git a/Documentation/kernel-parameters.txt
>> b/Documentation/kernel-parameters.txt
>> index 363e348..da0e077 100644
>> --- a/Documentation/kernel-parameters.txt
>> +++ b/Documentation/kernel-parameters.txt
>> @@ -594,6 +594,9 @@ bytes respectively. Such letter suffixes can also be
>> entirely omitted.
>>                         is selected automatically. Check
>>                         Documentation/kdump/kdump.txt for further details.
>>
>> +       crashkernel_low=size[KMG]
>> +                       [KNL, x86] parts under 4G.
>> +
>>         crashkernel=range1:size1[,range2:size2,...][@offset]
>>                         [KNL] Same as above, but depends on the memory
>>                         in the running system. The syntax of range is
>
>
> I don't understand this documentation.

Looks better if crashkernel_low is moved under crashkernel.

>
> The "parts under 4G." assumes you understand the context of this posting
> which isn't going into the docs. Above you say:
>
>
>> Try to reserve some under 4G if the normal "Crash kernel" is above 4G.
>
>
> Which is much clearer. Adding this in the middle also makes the "Same as
> above" slightly confusing (you have two different aboves...)
>
> The first version (crashkernel=onesize) strongly implies the reservation is
> physically contiguous. The comma separated version implies that there are
> discontiguous reservations, manually specified.
>
> So is crashkernel_low=size a separate reservation from crashkernel=size, or
> a modifier on the existing contiguous allocation? Do you still need a
> crashkernel= entry if you've got a crashkernel_low= entry? If you can (or
> are required to) specify both, is one a constraint on part of the other or
> it an addition (so it reserves crashkernel+crashkernel_low)? I seems
> unlikely "parts under 4G" means it's trying to make one contiguous
> reservation straddle the high/low boundary to put parts in each while still
> being contiguous...
>
> I have no idea from what you've added to kernel-parameters.txt.
>
> Looking at the code, I _think_ this adds an additional independent
> reservation. I.E. crashkernel=size says "allocate memory from anywhere",
> crashkernel_low=size says "allocate memory from low memory", and doing both
> allocates two chunks like the comma separated version.

comma separated version only allocate one piece, right?

The syntax is:

    crashkernel=<range1>:<size1>[,<range2>:<size2>,...][@offset]
    range=start-[end]

    'start' is inclusive and 'end' is exclusive.

For example:

    crashkernel=512M-2G:64M,2G-:128M

This would mean:

    1) if the RAM is smaller than 512M, then don't reserve anything
       (this is the "rescue" case)
    2) if the RAM size is between 512M and 2G (exclusive), then reserve 64M
    3) if the RAM size is larger than 2G, then reserve 128M

>
> Oh well. It's not hugely important that I understand a subsystem I don't
> use, but having to look at the code to figure out what the documentation is
> saying makes me uncomfortable.

logic for crashkernel_low, if crashkernel allocate above 4G, and will continue
allocate ram under 4G as user specified with crashkernel_low.

Yinghai
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ