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>] [day] [month] [year] [list]
Message-ID: <CAHkaATRnQtn+yu3aScsL-E-EYBTmZ7xSzWOQ7Z6pj0VYwGM+iA@mail.gmail.com>
Date:	Mon, 17 Nov 2014 22:57:30 +0800
From:	Min-Hua Chen <orca.chen@...il.com>
To:	Catalin Marinas <catalin.marinas@....com>,
	Will Deacon <will.deacon@....com>,
	Santosh Shilimkar <santosh.shilimkar@...com>
Cc:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Does kernel assume PHYS_OFFSET must be SECTION_SIZE aligned?

Hi,

I have a problem about kernel_x_start and kernel_x_end in map_lowmem.
If the start address of DRAM is 0x20000000 and PHYS_OFFSET is 0x20100000 (1MB)
and _start is 0xc0008000 and SECTION_SIZE is 0x200000 (2MB).
Let's say the memory between 0x20000000 and 0x20100000 is used by some H/W,
and not available for kernel.

According to current implementation:

unsigned long kernel_x_start = round_down(__pa(_stext), SECTION_SIZE);
unsigned long kernel_x_end = round_up(__pa(__init_end), SECTION_SIZE);

Than we'll get kernel_x_start = round_down(__pa(0xc0008000), SECTION_SIZE)
                  = round_down(0x20008000, SECTION_SIZE)
                  = 0x20000000

In this case, 0x20000000 is not available for kernel memory.

Does kernel assume PHYS_OFFSET must be SECTION_SIZE aligned or we
should get kernel_x_start by rounding down _start first then convert
the virtual address to physical address.

phys_addr_t kernel_x_start = __pa(round_down(_stext, SECTION_SIZE));
phys_addr_t kernel_x_end = __pa(round_up(__init_end, SECTION_SIZE));

get kernel_x_start = __pa(round_down(0xc0008000, SECTION_SIZE))
           = __pa(round_down(0xc0008000, SECTION_SIZE))
           = __pa(0xc0000000)
           = 0x20100000

thanks,
Min-Hua
--
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