* [Linux-ia64] [patch] 2.4.21-rc2-cset-1129 hugetlb, unwind fixes
@ 2003-05-28 7:17 Keith Owens
2003-05-29 1:27 ` Seth, Rohit
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Keith Owens @ 2003-05-28 7:17 UTC (permalink / raw)
To: linux-ia64
2.4.21-rc2-cset-1129 is 9 days old so some of these may have been fixed
already.
fs/proc/proc_misc.c:
Allow build with CONFIG_HUGETLB_PAGE=n.
arch/ia64/kernel/unwind.c:
Only call get_scratch_regs() when pt is really needed. The premature
calls to get_scratch_regs() would pick up the wrong address for pt if
the register was in switch_stack and pt_regs had not been reached
yet, e.g. unw_access_ar(&info, UNW_AR_BSPSTORE,...) before pt_regs
had been reached.
Correct debugging code that had the wrong the number of parameters
and referred to non-existent variables. Only shows up with
CFLAGS_unwind.o += -DUNW_DEBUG=<number>.
Index: 21-rc2.3/fs/proc/proc_misc.c
--- 21-rc2.3/fs/proc/proc_misc.c Wed, 28 May 2003 16:39:56 +1000 kaos (linux-2.4/o/b/48_proc_misc. 1.1.1.1.1.1.1.17 644)
+++ 21-rc2.3(w)/fs/proc/proc_misc.c Wed, 28 May 2003 16:57:30 +1000 kaos (linux-2.4/o/b/48_proc_misc. 1.1.1.1.1.1.1.17 644)
@@ -208,7 +208,9 @@ static int meminfo_read_proc(char *page,
K(i.totalswap),
K(i.freeswap));
+#ifdef CONFIG_HUGETLB_PAGE
len += hugetlb_report_meminfo(page + len);
+#endif
return proc_calc_metrics(page, start, off, count, eof, len);
#undef B
Index: 21-rc2.3/arch/ia64/kernel/unwind.c
--- 21-rc2.3/arch/ia64/kernel/unwind.c Sun, 18 May 2003 15:06:40 +1000 kaos (linux-2.4/r/c/42_unwind.c 1.1.2.1.1.2.3.1.1.1.1.4 644)
+++ 21-rc2.3(w)/arch/ia64/kernel/unwind.c Wed, 28 May 2003 17:05:42 +1000 kaos (linux-2.4/r/c/42_unwind.c 1.1.2.1.1.2.3.1.1.1.1.4 644)
@@ -371,12 +371,11 @@ unw_access_br (struct unw_frame_info *in
unsigned long *addr;
struct pt_regs *pt;
- pt = get_scratch_regs(info);
switch (regnum) {
/* scratch: */
- case 0: addr = &pt->b0; break;
- case 6: addr = &pt->b6; break;
- case 7: addr = &pt->b7; break;
+ case 0: pt = get_scratch_regs(info); addr = &pt->b0; break;
+ case 6: pt = get_scratch_regs(info); addr = &pt->b6; break;
+ case 7: pt = get_scratch_regs(info); addr = &pt->b7; break;
/* preserved: */
case 1: case 2: case 3: case 4: case 5:
@@ -409,15 +408,15 @@ unw_access_fr (struct unw_frame_info *in
return -1;
}
- pt = get_scratch_regs(info);
-
if (regnum <= 5) {
addr = *(&info->f2_loc + (regnum - 2));
if (!addr)
addr = &info->sw->f2 + (regnum - 2);
} else if (regnum <= 15) {
- if (regnum <= 9)
+ if (regnum <= 9) {
+ pt = get_scratch_regs(info);
addr = &pt->f6 + (regnum - 6);
+ }
else
addr = &info->sw->f10 + (regnum - 10);
} else if (regnum <= 31) {
@@ -447,7 +446,6 @@ unw_access_ar (struct unw_frame_info *in
unsigned long *addr;
struct pt_regs *pt;
- pt = get_scratch_regs(info);
switch (regnum) {
case UNW_AR_BSP:
addr = info->bsp_loc;
@@ -502,10 +500,12 @@ unw_access_ar (struct unw_frame_info *in
break;
case UNW_AR_RSC:
+ pt = get_scratch_regs(info);
addr = &pt->ar_rsc;
break;
case UNW_AR_CCV:
+ pt = get_scratch_regs(info);
addr = &pt->ar_ccv;
break;
@@ -1931,7 +1931,7 @@ init_frame_info (struct unw_frame_info *
" pr 0x%lx\n"
" sw 0x%lx\n"
" sp 0x%lx\n",
- __FUNCTION__, (unsigned long) task, rbslimit, rbstop, stktop, stklimit,
+ __FUNCTION__, (unsigned long) t, rbslimit, rbstop, stktop, stklimit,
info->pr, (unsigned long) info->sw, info->sp);
STAT(unw.stat.api.init_time += ia64_get_itc() - start; local_irq_restore(flags));
}
@@ -1952,7 +1952,7 @@ unw_init_from_interruption (struct unw_f
" bsp 0x%lx\n"
" sof 0x%lx\n"
" ip 0x%lx\n",
- info->bsp, sof, info->ip);
+ __FUNCTION__, info->bsp, sof, info->ip);
find_save_locs(info);
}
@@ -1970,7 +1970,7 @@ unw_init_frame_info (struct unw_frame_in
" bsp 0x%lx\n"
" sol 0x%lx\n"
" ip 0x%lx\n",
- info->bsp, sol, info->ip);
+ __FUNCTION__, info->bsp, sol, info->ip);
find_save_locs(info);
}
^ permalink raw reply [flat|nested] 5+ messages in thread* RE: [Linux-ia64] [patch] 2.4.21-rc2-cset-1129 hugetlb, unwind fixes
2003-05-28 7:17 [Linux-ia64] [patch] 2.4.21-rc2-cset-1129 hugetlb, unwind fixes Keith Owens
@ 2003-05-29 1:27 ` Seth, Rohit
2003-05-29 4:26 ` Bjorn Helgaas
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Seth, Rohit @ 2003-05-29 1:27 UTC (permalink / raw)
To: linux-ia64
[-- Attachment #1: Type: text/plain, Size: 4945 bytes --]
Thanks Keith for pointing out the issue with fs/proc/proc_misc.c for
!CONFIG_HUGETLB_PAGE. Please use the attached small patch for
fs/proc/proc_misc.c (as is there in 2.5).
> -----Original Message-----
> From: Keith Owens [mailto:kaos@ocs.com.au]
> Sent: Wednesday, May 28, 2003 12:17 AM
> To: linux-ia64@linuxia64.org
> Subject: [Linux-ia64] [patch] 2.4.21-rc2-cset-1129 hugetlb,
> unwind fixes
>
>
> 2.4.21-rc2-cset-1129 is 9 days old so some of these may have
> been fixed already.
>
> fs/proc/proc_misc.c:
> Allow build with CONFIG_HUGETLB_PAGE=n.
>
> arch/ia64/kernel/unwind.c:
> Only call get_scratch_regs() when pt is really needed. The
> premature
> calls to get_scratch_regs() would pick up the wrong address
> for pt if
> the register was in switch_stack and pt_regs had not been reached
> yet, e.g. unw_access_ar(&info, UNW_AR_BSPSTORE,...) before pt_regs
> had been reached.
>
> Correct debugging code that had the wrong the number of parameters
> and referred to non-existent variables. Only shows up with
> CFLAGS_unwind.o += -DUNW_DEBUG=<number>.
>
>
> Index: 21-rc2.3/fs/proc/proc_misc.c
> --- 21-rc2.3/fs/proc/proc_misc.c Wed, 28 May 2003 16:39:56
> +1000 kaos (linux-2.4/o/b/48_proc_misc. 1.1.1.1.1.1.1.17 644)
> +++ 21-rc2.3(w)/fs/proc/proc_misc.c Wed, 28 May 2003 16:57:30
> +1000 kaos
> +++ (linux-2.4/o/b/48_proc_misc. 1.1.1.1.1.1.1.17 644)
> @@ -208,7 +208,9 @@ static int meminfo_read_proc(char *page,
> K(i.totalswap),
> K(i.freeswap));
>
> +#ifdef CONFIG_HUGETLB_PAGE
> len += hugetlb_report_meminfo(page + len);
> +#endif
>
> return proc_calc_metrics(page, start, off, count, eof,
> len); #undef B
> Index: 21-rc2.3/arch/ia64/kernel/unwind.c
> --- 21-rc2.3/arch/ia64/kernel/unwind.c Sun, 18 May 2003
> 15:06:40 +1000 kaos (linux-2.4/r/c/42_unwind.c
> 1.1.2.1.1.2.3.1.1.1.1.4 644)
> +++ 21-rc2.3(w)/arch/ia64/kernel/unwind.c Wed, 28 May 2003 17:05:42
> +++ +1000 kaos (linux-2.4/r/c/42_unwind.c 1.1.2.1.1.2.3.1.1.1.1.4 644)
> @@ -371,12 +371,11 @@ unw_access_br (struct unw_frame_info *in
> unsigned long *addr;
> struct pt_regs *pt;
>
> - pt = get_scratch_regs(info);
> switch (regnum) {
> /* scratch: */
> - case 0: addr = &pt->b0; break;
> - case 6: addr = &pt->b6; break;
> - case 7: addr = &pt->b7; break;
> + case 0: pt = get_scratch_regs(info); addr =
> &pt->b0; break;
> + case 6: pt = get_scratch_regs(info); addr =
> &pt->b6; break;
> + case 7: pt = get_scratch_regs(info); addr =
> &pt->b7; break;
>
> /* preserved: */
> case 1: case 2: case 3: case 4: case 5:
> @@ -409,15 +408,15 @@ unw_access_fr (struct unw_frame_info *in
> return -1;
> }
>
> - pt = get_scratch_regs(info);
> -
> if (regnum <= 5) {
> addr = *(&info->f2_loc + (regnum - 2));
> if (!addr)
> addr = &info->sw->f2 + (regnum - 2);
> } else if (regnum <= 15) {
> - if (regnum <= 9)
> + if (regnum <= 9) {
> + pt = get_scratch_regs(info);
> addr = &pt->f6 + (regnum - 6);
> + }
> else
> addr = &info->sw->f10 + (regnum - 10);
> } else if (regnum <= 31) {
> @@ -447,7 +446,6 @@ unw_access_ar (struct unw_frame_info *in
> unsigned long *addr;
> struct pt_regs *pt;
>
> - pt = get_scratch_regs(info);
> switch (regnum) {
> case UNW_AR_BSP:
> addr = info->bsp_loc;
> @@ -502,10 +500,12 @@ unw_access_ar (struct unw_frame_info *in
> break;
>
> case UNW_AR_RSC:
> + pt = get_scratch_regs(info);
> addr = &pt->ar_rsc;
> break;
>
> case UNW_AR_CCV:
> + pt = get_scratch_regs(info);
> addr = &pt->ar_ccv;
> break;
>
> @@ -1931,7 +1931,7 @@ init_frame_info (struct unw_frame_info *
> " pr 0x%lx\n"
> " sw 0x%lx\n"
> " sp 0x%lx\n",
> - __FUNCTION__, (unsigned long) task,
> rbslimit, rbstop, stktop, stklimit,
> + __FUNCTION__, (unsigned long) t, rbslimit,
> rbstop, stktop,
> +stklimit,
> info->pr, (unsigned long) info->sw, info->sp);
> STAT(unw.stat.api.init_time += ia64_get_itc() - start;
> local_irq_restore(flags)); } @@ -1952,7 +1952,7 @@
> unw_init_from_interruption (struct unw_f
> " bsp 0x%lx\n"
> " sof 0x%lx\n"
> " ip 0x%lx\n",
> - info->bsp, sof, info->ip);
> + __FUNCTION__, info->bsp, sof, info->ip);
> find_save_locs(info);
> }
>
> @@ -1970,7 +1970,7 @@ unw_init_frame_info (struct unw_frame_in
> " bsp 0x%lx\n"
> " sol 0x%lx\n"
> " ip 0x%lx\n",
> - info->bsp, sol, info->ip);
> + __FUNCTION__, info->bsp, sol, info->ip);
> find_save_locs(info);
> }
>
>
>
> _______________________________________________
> Linux-IA64 mailing list
> Linux-IA64@linuxia64.org
> http://lists.linuxia64.org/lists/listinfo/linu> x-ia64
>
[-- Attachment #2: hugetlb_report_meminfo-2420.diff --]
[-- Type: application/octet-stream, Size: 350 bytes --]
diff -Nur A/fs/proc/proc_misc.c B/fs/proc/proc_misc.c
--- A/fs/proc/proc_misc.c Mon Mar 17 23:40:10 2003
+++ B/fs/proc/proc_misc.c Mon Mar 17 23:42:24 2003
@@ -36,6 +36,7 @@
#include <linux/init.h>
#include <linux/smp_lock.h>
#include <linux/seq_file.h>
+#include <linux/hugetlb.h>
#include <asm/uaccess.h>
#include <asm/pgtable.h>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [Linux-ia64] [patch] 2.4.21-rc2-cset-1129 hugetlb, unwind fixes
2003-05-28 7:17 [Linux-ia64] [patch] 2.4.21-rc2-cset-1129 hugetlb, unwind fixes Keith Owens
2003-05-29 1:27 ` Seth, Rohit
@ 2003-05-29 4:26 ` Bjorn Helgaas
2003-05-29 4:35 ` Bjorn Helgaas
2003-05-31 1:16 ` David Mosberger
3 siblings, 0 replies; 5+ messages in thread
From: Bjorn Helgaas @ 2003-05-29 4:26 UTC (permalink / raw)
To: linux-ia64
On Wednesday 28 May 2003 7:27 pm, Seth, Rohit wrote:
> Thanks Keith for pointing out the issue with fs/proc/proc_misc.c for
> !CONFIG_HUGETLB_PAGE. Please use the attached small patch for
> fs/proc/proc_misc.c (as is there in 2.5).
I applied Rohit's patch (adding the #include of <linux/hugetlb.h>) to
2.4 so it's the same as 2.5.
Bjorn
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Linux-ia64] [patch] 2.4.21-rc2-cset-1129 hugetlb, unwind fixes
2003-05-28 7:17 [Linux-ia64] [patch] 2.4.21-rc2-cset-1129 hugetlb, unwind fixes Keith Owens
2003-05-29 1:27 ` Seth, Rohit
2003-05-29 4:26 ` Bjorn Helgaas
@ 2003-05-29 4:35 ` Bjorn Helgaas
2003-05-31 1:16 ` David Mosberger
3 siblings, 0 replies; 5+ messages in thread
From: Bjorn Helgaas @ 2003-05-29 4:35 UTC (permalink / raw)
To: linux-ia64
On Wednesday 28 May 2003 1:17 am, Keith Owens wrote:
> arch/ia64/kernel/unwind.c:
> Only call get_scratch_regs() when pt is really needed. The premature
> calls to get_scratch_regs() would pick up the wrong address for pt if
> the register was in switch_stack and pt_regs had not been reached
> yet, e.g. unw_access_ar(&info, UNW_AR_BSPSTORE,...) before pt_regs
> had been reached.
>
> Correct debugging code that had the wrong the number of parameters
> and referred to non-existent variables. Only shows up with
> CFLAGS_unwind.o += -DUNW_DEBUG=<number>.
It looks like these changes should be applicable to 2.5 as well.
I'd like to avoid gratuitous differences with 2.5, so can you
get David to apply them there first? (I'm not implying that your
fixes are gratuitous, just that since David is "Mr. Unwind", he
may make minor changes when applying your patch, and I
might as well get those at the same time. :-)
Bjorn
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Linux-ia64] [patch] 2.4.21-rc2-cset-1129 hugetlb, unwind fixes
2003-05-28 7:17 [Linux-ia64] [patch] 2.4.21-rc2-cset-1129 hugetlb, unwind fixes Keith Owens
` (2 preceding siblings ...)
2003-05-29 4:35 ` Bjorn Helgaas
@ 2003-05-31 1:16 ` David Mosberger
3 siblings, 0 replies; 5+ messages in thread
From: David Mosberger @ 2003-05-31 1:16 UTC (permalink / raw)
To: linux-ia64
>>>>> On Wed, 28 May 2003 17:17:24 +1000, Keith Owens <kaos@ocs.com.au> said:
Keith> arch/ia64/kernel/unwind.c: Only call get_scratch_regs() when
Keith> pt is really needed. The premature calls to
Keith> get_scratch_regs() would pick up the wrong address for pt if
Keith> the register was in switch_stack and pt_regs had not been
Keith> reached yet, e.g. unw_access_ar(&info, UNW_AR_BSPSTORE,...)
Keith> before pt_regs had been reached.
This looks fine to me. Can you send me a 2.5 patch?
--david
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2003-05-31 1:16 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-28 7:17 [Linux-ia64] [patch] 2.4.21-rc2-cset-1129 hugetlb, unwind fixes Keith Owens
2003-05-29 1:27 ` Seth, Rohit
2003-05-29 4:26 ` Bjorn Helgaas
2003-05-29 4:35 ` Bjorn Helgaas
2003-05-31 1:16 ` David Mosberger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox