Re: [PATCH 1/3] x86, mm: Include the entire kernel memory map in trampoline_pgd

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/03/2012 06:31 AM, Jan Beulich wrote:
Matt Fleming <matt@xxxxxxxxxxxxxxxxx> 10/03/12 2:59 PM >>>
+static int insert_identity_mapping(resource_size_t paddr, unsigned long vaddr,
+                    unsigned long size)
+{
+    unsigned long end = vaddr + size;
+    unsigned long next;
+    pgd_t *vpgd, *ppgd;
+
+#ifdef CONFIG_X86_32
+    ppgd = initial_page_table + pgd_index(paddr);
+
+    if (paddr >= PAGE_OFFSET || paddr + size > PAGE_OFFSET)
+        return 1;
+#else
+    ppgd = __va(real_mode_header->trampoline_pgd) + pgd_index(paddr);

Missing equivalent code (to the 32-bit one above) here - after all, you're trying
to potentially insert a 52-bit physical address into 48-bit virtual space.


We should have the check, but at least for Linux support we require
P <= V-2.

	-hpa


--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.

--
To unsubscribe from this list: send the line "unsubscribe linux-efi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux