diff mbox

[v4,3/3] kallsyms: remove --page-offset command line option

Message ID 1455030828-6416-4-git-send-email-ard.biesheuvel@linaro.org
State New
Headers show

Commit Message

Ard Biesheuvel Feb. 9, 2016, 3:13 p.m. UTC
The --page-offset command line option was only used for ARM, to filter
symbol addresses below CONFIG_PAGE_OFFSET. This is no longer needed, so
remove the functionality altogether.

Acked-by: Nicolas Pitre <nico@linaro.org>

Acked-by: Chris Brandt <chris.brandt@renesas.com>

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

---
 scripts/kallsyms.c | 8 --------
 1 file changed, 8 deletions(-)

-- 
2.5.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Comments

Ard Biesheuvel Feb. 9, 2016, 4:17 p.m. UTC | #1
On 9 February 2016 at 17:09, Chris Brandt <Chris.Brandt@renesas.com> wrote:
> On 9 Feb 2016, Ard Biesheuvel wrote:

>

>>diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c

>>index 02473b71643b..32c8d43590af 100644

>>--- a/scripts/kallsyms.c

>>+++ b/scripts/kallsyms.c

>>@@ -63,7 +63,6 @@ static unsigned int table_size, table_cnt;

>> static int all_symbols = 0;

>> static int absolute_percpu = 0;

>> static char symbol_prefix_char = '\0';

>>-static unsigned long long kernel_start_addr = 0;

>> static int base_relative = 0;

>

>

>

> You removed kernel_start_addr, but you didn't remove all the instances of it in the file (you did remove them all in V2 though).

>

> So, now I get:

>

>   CC      scripts/mod/devicetable-offsets.s

> ../scripts/kallsyms.c: In function 'record_relative_base':

> ../scripts/kallsyms.c:740:6: error: 'kernel_start_addr' undeclared (first use in this function)

>   if (kernel_start_addr > 0) {

>       ^

> ../scripts/kallsyms.c:740:6: note: each undeclared identifier is reported only once for each function it appears in

> make[2]: *** [scripts/kallsyms] Error 1

>


That is because this patch

http://ozlabs.org/~akpm/mmots/broken-out/kallsyms-add-support-for-relative-offsets-in-kallsyms-address-table-v5.patch

is also in flight, via akpm's tree, and is expected to hit -next
tomorrow. That patch removes this reference (or alternatively, will
not introduce it anymore if akpm decides to fold it into
http://ozlabs.org/~akpm/mmots/broken-out/kallsyms-add-support-for-relative-offsets-in-kallsyms-address-table.patch
before submitting it)

Going forward, it probably makes sense to only submit #1 of this
series for v4.6, and queue the remaining two after the merge window.

Thanks for testing btw,
Ard.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Nicolas Pitre Feb. 9, 2016, 7:28 p.m. UTC | #2
On Tue, 9 Feb 2016, Ard Biesheuvel wrote:

> On 9 February 2016 at 17:09, Chris Brandt <Chris.Brandt@renesas.com> wrote:

> > On 9 Feb 2016, Ard Biesheuvel wrote:

> >

> >>diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c

> >>index 02473b71643b..32c8d43590af 100644

> >>--- a/scripts/kallsyms.c

> >>+++ b/scripts/kallsyms.c

> >>@@ -63,7 +63,6 @@ static unsigned int table_size, table_cnt;

> >> static int all_symbols = 0;

> >> static int absolute_percpu = 0;

> >> static char symbol_prefix_char = '\0';

> >>-static unsigned long long kernel_start_addr = 0;

> >> static int base_relative = 0;

> >

> >

> >

> > You removed kernel_start_addr, but you didn't remove all the instances of it in the file (you did remove them all in V2 though).

> >

> > So, now I get:

> >

> >   CC      scripts/mod/devicetable-offsets.s

> > ../scripts/kallsyms.c: In function 'record_relative_base':

> > ../scripts/kallsyms.c:740:6: error: 'kernel_start_addr' undeclared (first use in this function)

> >   if (kernel_start_addr > 0) {

> >       ^

> > ../scripts/kallsyms.c:740:6: note: each undeclared identifier is reported only once for each function it appears in

> > make[2]: *** [scripts/kallsyms] Error 1

> >

> 

> That is because this patch

> 

> http://ozlabs.org/~akpm/mmots/broken-out/kallsyms-add-support-for-relative-offsets-in-kallsyms-address-table-v5.patch

> 

> is also in flight, via akpm's tree, and is expected to hit -next

> tomorrow. That patch removes this reference (or alternatively, will

> not introduce it anymore if akpm decides to fold it into

> http://ozlabs.org/~akpm/mmots/broken-out/kallsyms-add-support-for-relative-offsets-in-kallsyms-address-table.patch

> before submitting it)

> 

> Going forward, it probably makes sense to only submit #1 of this

> series for v4.6, and queue the remaining two after the merge window.


Well... If akpm agrees, you could get those patches back and create a 
tree of your own with all ACKs for this work to avoi all this patch 
ordering dependency nightmare (including the work that depends on this) 
and submit it upstream (to Linus maybe?) while having it merged in 
linux-next in the mean time.


Nicolas

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Ard Biesheuvel Feb. 9, 2016, 8:18 p.m. UTC | #3
On 9 February 2016 at 20:28, Nicolas Pitre <nicolas.pitre@linaro.org> wrote:
> On Tue, 9 Feb 2016, Ard Biesheuvel wrote:

>

>> On 9 February 2016 at 17:09, Chris Brandt <Chris.Brandt@renesas.com> wrote:

>> > On 9 Feb 2016, Ard Biesheuvel wrote:

>> >

>> >>diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c

>> >>index 02473b71643b..32c8d43590af 100644

>> >>--- a/scripts/kallsyms.c

>> >>+++ b/scripts/kallsyms.c

>> >>@@ -63,7 +63,6 @@ static unsigned int table_size, table_cnt;

>> >> static int all_symbols = 0;

>> >> static int absolute_percpu = 0;

>> >> static char symbol_prefix_char = '\0';

>> >>-static unsigned long long kernel_start_addr = 0;

>> >> static int base_relative = 0;

>> >

>> >

>> >

>> > You removed kernel_start_addr, but you didn't remove all the instances of it in the file (you did remove them all in V2 though).

>> >

>> > So, now I get:

>> >

>> >   CC      scripts/mod/devicetable-offsets.s

>> > ../scripts/kallsyms.c: In function 'record_relative_base':

>> > ../scripts/kallsyms.c:740:6: error: 'kernel_start_addr' undeclared (first use in this function)

>> >   if (kernel_start_addr > 0) {

>> >       ^

>> > ../scripts/kallsyms.c:740:6: note: each undeclared identifier is reported only once for each function it appears in

>> > make[2]: *** [scripts/kallsyms] Error 1

>> >

>>

>> That is because this patch

>>

>> http://ozlabs.org/~akpm/mmots/broken-out/kallsyms-add-support-for-relative-offsets-in-kallsyms-address-table-v5.patch

>>

>> is also in flight, via akpm's tree, and is expected to hit -next

>> tomorrow. That patch removes this reference (or alternatively, will

>> not introduce it anymore if akpm decides to fold it into

>> http://ozlabs.org/~akpm/mmots/broken-out/kallsyms-add-support-for-relative-offsets-in-kallsyms-address-table.patch

>> before submitting it)

>>

>> Going forward, it probably makes sense to only submit #1 of this

>> series for v4.6, and queue the remaining two after the merge window.

>

> Well... If akpm agrees, you could get those patches back and create a

> tree of your own with all ACKs for this work to avoi all this patch

> ordering dependency nightmare (including the work that depends on this)

> and submit it upstream (to Linus maybe?) while having it merged in

> linux-next in the mean time.

>


All these changes are related to my KASLR series for arm64 in one way
or the other, some of which is en route via akpm's tree (including the
generic kallsyms changes that these patches are based on) and some via
Catalin's tree. If Russell is ok to take this #1 for v4.6, I am happy
to sit on the remaining two for a while (which essentially only remove
dead code once #1 is applied)

Thanks,
Ard.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Nicolas Pitre Feb. 9, 2016, 8:45 p.m. UTC | #4
On Tue, 9 Feb 2016, Ard Biesheuvel wrote:

> On 9 February 2016 at 20:28, Nicolas Pitre <nicolas.pitre@linaro.org> wrote:

> > On Tue, 9 Feb 2016, Ard Biesheuvel wrote:

> >

> >> On 9 February 2016 at 17:09, Chris Brandt <Chris.Brandt@renesas.com> wrote:

> >> > On 9 Feb 2016, Ard Biesheuvel wrote:

> >> >

> >> >>diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c

> >> >>index 02473b71643b..32c8d43590af 100644

> >> >>--- a/scripts/kallsyms.c

> >> >>+++ b/scripts/kallsyms.c

> >> >>@@ -63,7 +63,6 @@ static unsigned int table_size, table_cnt;

> >> >> static int all_symbols = 0;

> >> >> static int absolute_percpu = 0;

> >> >> static char symbol_prefix_char = '\0';

> >> >>-static unsigned long long kernel_start_addr = 0;

> >> >> static int base_relative = 0;

> >> >

> >> >

> >> >

> >> > You removed kernel_start_addr, but you didn't remove all the instances of it in the file (you did remove them all in V2 though).

> >> >

> >> > So, now I get:

> >> >

> >> >   CC      scripts/mod/devicetable-offsets.s

> >> > ../scripts/kallsyms.c: In function 'record_relative_base':

> >> > ../scripts/kallsyms.c:740:6: error: 'kernel_start_addr' undeclared (first use in this function)

> >> >   if (kernel_start_addr > 0) {

> >> >       ^

> >> > ../scripts/kallsyms.c:740:6: note: each undeclared identifier is reported only once for each function it appears in

> >> > make[2]: *** [scripts/kallsyms] Error 1

> >> >

> >>

> >> That is because this patch

> >>

> >> http://ozlabs.org/~akpm/mmots/broken-out/kallsyms-add-support-for-relative-offsets-in-kallsyms-address-table-v5.patch

> >>

> >> is also in flight, via akpm's tree, and is expected to hit -next

> >> tomorrow. That patch removes this reference (or alternatively, will

> >> not introduce it anymore if akpm decides to fold it into

> >> http://ozlabs.org/~akpm/mmots/broken-out/kallsyms-add-support-for-relative-offsets-in-kallsyms-address-table.patch

> >> before submitting it)

> >>

> >> Going forward, it probably makes sense to only submit #1 of this

> >> series for v4.6, and queue the remaining two after the merge window.

> >

> > Well... If akpm agrees, you could get those patches back and create a

> > tree of your own with all ACKs for this work to avoi all this patch

> > ordering dependency nightmare (including the work that depends on this)

> > and submit it upstream (to Linus maybe?) while having it merged in

> > linux-next in the mean time.

> >

> 

> All these changes are related to my KASLR series for arm64 in one way

> or the other, some of which is en route via akpm's tree (including the

> generic kallsyms changes that these patches are based on) and some via

> Catalin's tree. If Russell is ok to take this #1 for v4.6, I am happy

> to sit on the remaining two for a while (which essentially only remove

> dead code once #1 is applied)


OK makes sense.


Nicolas

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
diff mbox

Patch

diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c
index 02473b71643b..32c8d43590af 100644
--- a/scripts/kallsyms.c
+++ b/scripts/kallsyms.c
@@ -63,7 +63,6 @@  static unsigned int table_size, table_cnt;
 static int all_symbols = 0;
 static int absolute_percpu = 0;
 static char symbol_prefix_char = '\0';
-static unsigned long long kernel_start_addr = 0;
 static int base_relative = 0;
 
 int token_profit[0x10000];
@@ -228,10 +227,6 @@  static int symbol_valid(struct sym_entry *s)
 	int i;
 	char *sym_name = (char *)s->sym + 1;
 
-
-	if (s->addr < kernel_start_addr)
-		return 0;
-
 	/* skip prefix char */
 	if (symbol_prefix_char && *sym_name == symbol_prefix_char)
 		sym_name++;
@@ -774,9 +769,6 @@  int main(int argc, char **argv)
 				if ((*p == '"' && *(p+2) == '"') || (*p == '\'' && *(p+2) == '\''))
 					p++;
 				symbol_prefix_char = *p;
-			} else if (strncmp(argv[i], "--page-offset=", 14) == 0) {
-				const char *p = &argv[i][14];
-				kernel_start_addr = strtoull(p, NULL, 16);
 			} else if (strcmp(argv[i], "--base-relative") == 0)
 				base_relative = 1;
 			else