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: <c9031b26-d349-9dd0-f8bf-bef15a8fa7ee@oracle.com>
Date:   Thu, 5 Jan 2017 09:17:43 -0500
From:   Boris Ostrovsky <boris.ostrovsky@...cle.com>
To:     Ingo Molnar <mingo@...nel.org>
Cc:     tglx@...utronix.de, mingo@...hat.com, hpa@...or.com,
        x86@...nel.org, linux-kernel@...r.kernel.org,
        xen-devel@...ts.xenproject.org, matt@...eblueprint.co.uk
Subject: Re: [PATCH] x86/head: Refactor 32-bit pgtable setup

On 01/05/2017 03:52 AM, Ingo Molnar wrote:
>
> Yeah, so (belatedly) I tried to merge this to latest upstream, via the commit 
> below (note the slight edits to the changelog) - but 32-bit defconfig fails to 
> build:
>
>   arch/x86/kernel/head_32.S:615: Error: can't resolve `init_thread_union' {*UND* section} - `SIZEOF_PTREGS' {*UND* section}

When you dropped MAPPING_BEYOND_END (that I indeed should have removed)
you left comment opening in the wrong place:

> diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S
> index 4e8577d03372..eca1c93c38e8 100644
> --- a/arch/x86/kernel/head_32.S
> +++ b/arch/x86/kernel/head_32.S
> @@ -24,6 +24,7 @@
>  #include <asm/nops.h>
>  #include <asm/bootparam.h>
>  #include <asm/export.h>
> +#include <asm/pgtable_32.h>
>  
>  /* Physical address */
>  #define pa(X) ((X) - __PAGE_OFFSET)
> @@ -42,43 +43,8 @@
>  #define X86_VENDOR_ID	new_cpu_data+CPUINFO_x86_vendor_id

This one:

>  
>  /*
> - * This is how much memory in addition to the memory covered up to
> - * and including _end we need mapped initially.
> - * We need:
> - *     (KERNEL_IMAGE_SIZE/4096) / 1024 pages (worst case, non PAE)
> - *     (KERNEL_IMAGE_SIZE/4096) / 512 + 4 pages (worst case for PAE)
> - *
> - * Modulo rounding, each megabyte assigned here requires a kilobyte of
> - * memory, which is currently unreclaimed.
> - *
> - * This should be a multiple of a page.
> - *
> - * KERNEL_IMAGE_SIZE should be greater than pa(_end)
> - * and small than max_low_pfn, otherwise will waste some page table entries
> - */
> -
> -#if PTRS_PER_PMD > 1
> -#define PAGE_TABLE_SIZE(pages) (((pages) / PTRS_PER_PMD) + PTRS_PER_PGD)
> -#else
> -#define PAGE_TABLE_SIZE(pages) ((pages) / PTRS_PER_PGD)
> -#endif
> -
>  #define SIZEOF_PTREGS 17*4
>  



In other words, this version of the patch needs:

diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S
index eca1c93..1f85ee8 100644
--- a/arch/x86/kernel/head_32.S
+++ b/arch/x86/kernel/head_32.S
@@ -42,9 +42,10 @@
 #define X86_CAPABILITY new_cpu_data+CPUINFO_x86_capability
 #define X86_VENDOR_ID  new_cpu_data+CPUINFO_x86_vendor_id
 
-/*
+
 #define SIZEOF_PTREGS 17*4
 
+/*
  * Worst-case size of the kernel mapping we need to make:
  * a relocatable kernel can live anywhere in lowmem, so we need to be able
  * to map all of lowmem.



-boris

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ