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] [thread-next>] [day] [month] [year] [list]
Message-Id: <20150506163024.ba4a8eddc8031e5d32b061ba@linux-foundation.org>
Date:	Wed, 6 May 2015 16:30:24 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Tony Luck <tony.luck@...el.com>
Cc:	linux-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: Re: [PATCH 3/3] x86, mirror: x86 enabling - find mirrored memory
 ranges

On Tue, 3 Feb 2015 14:40:19 -0800 Tony Luck <tony.luck@...el.com> wrote:

> UEFI GetMemoryMap() uses a new attribute bit to mark mirrored memory
> address ranges. See UEFI 2.5 spec pages 157-158:
> 
>   http://www.uefi.org/sites/default/files/resources/UEFI%202_5.pdf
> 
> On EFI enabled systems scan the memory map and tell memblock about
> any mirrored ranges.
> 
> ...
>
> --- a/arch/x86/platform/efi/efi.c
> +++ b/arch/x86/platform/efi/efi.c
> @@ -117,6 +117,27 @@ void efi_get_time(struct timespec *now)
>  	now->tv_nsec = 0;
>  }
>  
> +void __init efi_find_mirror(void)
> +{
> +	void *p;
> +	unsigned long long mirror_size = 0, total_size = 0;
> +
> +	for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) {
> +		efi_memory_desc_t *md = p;
> +		unsigned long long start = md->phys_addr;
> +		unsigned long long size = md->num_pages << EFI_PAGE_SHIFT;

efi_memory_desc_t uses u64 for all this stuff.  Was there a reason for
using ull instead?

> +		total_size += size;
> +		if (md->attribute & EFI_MEMORY_MORE_RELIABLE) {
> +			memblock_mark_mirror(start, size);
> +			mirror_size += size;
> +		}
> +	}
> +	if (mirror_size)
> +		pr_info("Memory: %lldM/%lldM mirrored memory\n",
> +			mirror_size>>20, total_size>>20);
> +}
> +
>
> ...
>
--
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