Ensure mapped page virtuals don't set weird bits
authorJack Miller <jack@codezen.org>
Mon, 21 Mar 2016 18:21:08 +0000 (13:21 -0500)
committerJack Miller <jack@codezen.org>
Mon, 21 Mar 2016 18:21:08 +0000 (13:21 -0500)
Didn't actually hit an error, but everywhere else we can use unaligned
addresses since we're just deriving the locations of structures.

mm/map.c

index dd1a73d..03f1e10 100644 (file)
--- a/mm/map.c
+++ b/mm/map.c
@@ -97,8 +97,7 @@ int __map_page_flags(u64 virtual, u64 physical, u8 flags)
        if (ret < 0)
                goto cleanup_pdpe;
 
-       *pte = physical | PF_P | flags;
-
+       *pte = PAGE_ALIGN(physical) | PF_P | flags;
 
        return 0;