Skip to contentSkip to conversation

Un(de)selectable block for DISCONTIGMEM/64BIT on parisc

PATCH In review Christoph Egger 1 participant 2 messages May 12, 2010 PA-RISC architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Un(de)selectable block for DISCONTIGMEM/64BIT on parisc

Hi all!

As part of the VAMOS[0] research project at the University of
Erlangen we are looking at multiple integrity errors in linux' configuration system.

When considering the restrictions inposed in kconfig 64BIT
will *always* be set when DISCONTIGMEM is present on parisc so the code path depending on !64BIT is actually unreachable and the whole check unnecessary.

Please keep me informed of this patch getting confirmed /
merged so we can keep track of it.

Regards

Christoph Egger

[0] http://vamos1.informatik.uni-erlangen.de/

----

Quoted 1 line

From 5eeae9c56e2602a68b62b21691e6756fb5198dd7 Mon Sep 17 00:00:00 2001

From: Christoph Egger <[email protected]>
Date: Wed, 12 May 2010 16:59:24 +0200
Subject: [PATCH] on parisc CONFIG_DISCONTIGMEM always depends on CONFIG_64BIT

Removing a conditional on 64BIT inside a DISCONTIGMEM block inside arch/parisc. DISCONTIGMEM depends on ARCH_DISCONTIGMEM_ENABLE either directly or through DISCONTIGMEM_MANUAL which in turn depends on 64BIT inside Kconfig so the check and the else case isn't needed at all (the else case can't ever be reached)

---
 arch/parisc/include/asm/mmzone.h |    5 -----
 1 files changed, 0 insertions(+), 5 deletions(-)
arch/parisc/include/asm/mmzone.h +0 -5
index 9608d2c..dbddcac 100644
@@ -35,12 +35,7 @@ extern struct node_map_data node_data[];
 #define PFNNID_MAP_MAX  512     /* support 512GB */
 extern unsigned char pfnnid_map[PFNNID_MAP_MAX];
 
-#ifndef CONFIG_64BIT
 #define pfn_is_io(pfn) ((pfn & (0xf0000000UL >> PAGE_SHIFT)) == (0xf0000000UL >> PAGE_SHIFT))
-#else
-/* io can be 0xf0f0f0f0f0xxxxxx or 0xfffffffff0000000 */
-#define pfn_is_io(pfn) ((pfn & (0xf000000000000000UL >> PAGE_SHIFT)) == (0xf000000000000000UL >> PAGE_SHIFT))
-#endif
 
 static inline int pfn_to_nid(unsigned long pfn)
 {
Signature · 1 line
1.6.3.3
#1 lore raw

Hi all!

Seems I messed up the logic a bit -- reading the ifndef for an
ifdef reversing the actual behaviour of the code when applying the patch. Below the corrected variant.

Regards

Christoph

Quoted 11 lines · Christoph Egger

Hi all!

As part of the VAMOS[0] research project at the University of
Erlangen we are looking at multiple integrity errors in linux' configuration system.

When considering the restrictions inposed in kconfig 64BIT
will *always* be set when DISCONTIGMEM is present on parisc so the code path depending on !64BIT is actually unreachable and the whole check unnecessary.

Quoted 8 lines

Please keep me informed of this patch getting confirmed /
merged so we can keep track of it.

Regards

Christoph Egger

[0] http://vamos1.informatik.uni-erlangen.de/

----

Quoted 1 line

From 5eeae9c56e2602a68b62b21691e6756fb5198dd7 Mon Sep 17 00:00:00 2001

From: Christoph Egger <[email protected]>
Date: Wed, 12 May 2010 16:59:24 +0200
Subject: [PATCH] on parisc CONFIG_DISCONTIGMEM always depends on CONFIG_64BIT

Removing a conditional on 64BIT inside a DISCONTIGMEM block inside arch/parisc. DISCONTIGMEM depends on ARCH_DISCONTIGMEM_ENABLE either directly or through DISCONTIGMEM_MANUAL which in turn depends on 64BIT inside Kconfig so the check and the else case isn't needed at all (the else case can't ever be reached)

---
 arch/parisc/include/asm/mmzone.h |    5 -----
 1 files changed, 0 insertions(+), 5 deletions(-)
arch/parisc/include/asm/mmzone.h +0 -4
index 9608d2c..dbddcac 100644
@@ -35,12 +35,8 @@ extern struct node_map_data node_data[];
 #define PFNNID_MAP_MAX  512     /* support 512GB */
 extern unsigned char pfnnid_map[PFNNID_MAP_MAX];
 
-#ifndef CONFIG_64BIT
-#define pfn_is_io(pfn) ((pfn & (0xf0000000UL >> PAGE_SHIFT)) == (0xf0000000UL >> PAGE_SHIFT))
-#else
 /* io can be 0xf0f0f0f0f0xxxxxx or 0xfffffffff0000000 */
 #define pfn_is_io(pfn) ((pfn & (0xf000000000000000UL >> PAGE_SHIFT)) == (0xf000000000000000UL >> PAGE_SHIFT))
-#endif
 
 static inline int pfn_to_nid(unsigned long pfn)
 {
Signature · 1 line
1.6.3.3