Skip to content

Commit 99395ee

Browse files
Steven Pricetorvalds
authored andcommitted
mm: ptdump: expand type of 'val' in note_page()
The page table entry is passed in the 'val' argument to note_page(), however this was previously an "unsigned long" which is fine on 64-bit platforms. But for 32 bit x86 it is not always big enough to contain a page table entry which may be 64 bits. Change the type to u64 to ensure that it is always big enough. [[email protected]: fix riscv] Reported-by: Jan Beulich <[email protected]> Signed-off-by: Steven Price <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Dave Hansen <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Linus Torvalds <[email protected]>
1 parent 1494e0c commit 99395ee

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

arch/arm64/mm/dump.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ static void note_prot_wx(struct pg_state *st, unsigned long addr)
247247
}
248248

249249
static void note_page(struct ptdump_state *pt_st, unsigned long addr, int level,
250-
unsigned long val)
250+
u64 val)
251251
{
252252
struct pg_state *st = container_of(pt_st, struct pg_state, ptdump);
253253
static const char units[] = "KMGTPE";

arch/riscv/mm/ptdump.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ static void note_prot_wx(struct pg_state *st, unsigned long addr)
204204
}
205205

206206
static void note_page(struct ptdump_state *pt_st, unsigned long addr,
207-
int level, unsigned long val)
207+
int level, u64 val)
208208
{
209209
struct pg_state *st = container_of(pt_st, struct pg_state, ptdump);
210210
u64 pa = PFN_PHYS(pte_pfn(__pte(val)));

arch/x86/mm/dump_pagetables.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ static void effective_prot(struct ptdump_state *pt_st, int level, u64 val)
273273
* print what we collected so far.
274274
*/
275275
static void note_page(struct ptdump_state *pt_st, unsigned long addr, int level,
276-
unsigned long val)
276+
u64 val)
277277
{
278278
struct pg_state *st = container_of(pt_st, struct pg_state, ptdump);
279279
pgprotval_t new_prot, new_eff;

include/linux/ptdump.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ struct ptdump_range {
1313
struct ptdump_state {
1414
/* level is 0:PGD to 4:PTE, or -1 if unknown */
1515
void (*note_page)(struct ptdump_state *st, unsigned long addr,
16-
int level, unsigned long val);
16+
int level, u64 val);
1717
void (*effective_prot)(struct ptdump_state *st, int level, u64 val);
1818
const struct ptdump_range *range;
1919
};

0 commit comments

Comments
 (0)