public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [Linux-ia64] [PATCH] fix /proc/.../vm_info
@ 2002-12-12 13:49 Christian Hildner
  2002-12-12 19:56 ` David Mosberger
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Christian Hildner @ 2002-12-12 13:49 UTC (permalink / raw)
  To: linux-ia64

[-- Attachment #1: Type: text/plain, Size: 182 bytes --]

Hi,

in vm_info the information about the supported memory attributes is
wrong. The patch  is based on 2.4.18, but it should also work for 2.4.20
and 2.5.x. Please apply.

Christian

[-- Attachment #2: palinfo.c_patch --]
[-- Type: text/plain, Size: 1378 bytes --]

--- palinfo.c_orig	Tue Mar 19 11:22:28 2002
+++ palinfo.c	Thu Dec 12 14:33:51 2002
@@ -113,14 +113,14 @@
  *      bit 7 - 111 - NatPage
  */
 static const char *mem_attrib[]={
-	"Write Back (WB)",		/* 000 */
-	"Uncacheable (UC)",		/* 001 */
-	"Reserved",			/* 010 */
-	"Reserved",			/* 011 */
-	"Uncacheable (UC)",		/* 100 */
-	"Uncacheable Exported (UCE)",	/* 101 */
-	"Write Coalescing (WC)",	/* 110 */
-	"NaTPage"			/* 111 */
+	"Write Back (WB) ma=000",		/* 000 */
+	"Uncacheable (UC) ma=001",		/* 001 */
+	"Reserved ma=010",			/* 010 */
+	"Reserved ma=011",			/* 011 */
+	"Uncacheable (UC) ma=100",		/* 100 */
+	"Uncacheable Exported (UCE) ma=101",	/* 101 */
+	"Write Coalescing (WC) ma=110",	/* 110 */
+	"NaTPage ma=111"			/* 111 */
 };
 
 /*
@@ -339,7 +339,15 @@
 
 	if (ia64_pal_mem_attrib(&attrib) != 0) return 0;
 
-	p += sprintf(p, "Supported memory attributes    : %s\n", mem_attrib[attrib&0x7]);
+	p += sprintf(p, "Supported memory attributes    : ");
+	j = 0;					// first line
+	for (i=0; i < 8; i++) {
+		if (attrib & (1 << i)) {
+			if (j) p += sprintf(p, "                                 ");
+			p += sprintf(p, "%s\n", mem_attrib[i]);
+			j = 1;
+		}
+	}
 
 	if ((status=ia64_pal_vm_page_size(&tr_pages, &vw_pages)) !=0) {
 		printk("ia64_pal_vm_page_size=%ld\n", status);
@@ -971,3 +979,7 @@
 
 module_init(palinfo_init);
 module_exit(palinfo_exit);
+
+
+
+

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Linux-ia64] [PATCH] fix /proc/.../vm_info
  2002-12-12 13:49 [Linux-ia64] [PATCH] fix /proc/.../vm_info Christian Hildner
@ 2002-12-12 19:56 ` David Mosberger
  2002-12-13  7:45 ` Christian Hildner
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: David Mosberger @ 2002-12-12 19:56 UTC (permalink / raw)
  To: linux-ia64

>>>>> On Thu, 12 Dec 2002 14:49:10 +0100, Christian Hildner <christian.hildner@hob.de> said:

  Christian> Hi, in vm_info the information about the supported memory
  Christian> attributes is wrong. The patch is based on 2.4.18, but it
  Christian> should also work for 2.4.20 and 2.5.x. Please apply.

I'd like to keep the output a bit more concise.  How about the attached
patch (untested)?

	--david

=== arch/ia64/kernel/palinfo.c 1.7 vs edited ==--- 1.7/arch/ia64/kernel/palinfo.c	Sun Dec  1 22:17:31 2002
+++ edited/arch/ia64/kernel/palinfo.c	Thu Dec 12 11:54:24 2002
@@ -101,26 +101,15 @@
 
 #define RSE_HINTS_COUNT (sizeof(rse_hints)/sizeof(const char *))
 
-/*
- * The current revision of the Volume 2 (July 2000) of
- * IA-64 Architecture Software Developer's Manual is wrong.
- * Table 4-10 has invalid information concerning the ma field:
- * Correct table is:
- *      bit 0 - 001 - UC
- *      bit 4 - 100 - UC
- *      bit 5 - 101 - UCE
- *      bit 6 - 110 - WC
- *      bit 7 - 111 - NatPage
- */
 static const char *mem_attrib[]={
-	"Write Back (WB)",		/* 000 */
-	"Uncacheable (UC)",		/* 001 */
-	"Reserved",			/* 010 */
-	"Reserved",			/* 011 */
-	"Uncacheable (UC)",		/* 100 */
-	"Uncacheable Exported (UCE)",	/* 101 */
-	"Write Coalescing (WC)",	/* 110 */
-	"NaTPage"			/* 111 */
+	"WB",		/* 000 */
+	"UC",		/* 001 */
+	"010",		/* 010 */
+	"011",		/* 011 */
+	"UC",		/* 100 */
+	"UCE",		/* 101 */
+	"WC",		/* 110 */
+	"NaTPage"	/* 111 */
 };
 
 /*
@@ -315,6 +304,7 @@
 	pal_vm_info_2_u_t vm_info_2;
 	pal_tc_info_u_t	tc_info;
 	ia64_ptce_info_t ptce;
+	const char *sep;
 	int i, j;
 	s64 status;
 
@@ -339,7 +329,14 @@
 
 	if (ia64_pal_mem_attrib(&attrib) != 0) return 0;
 
-	p += sprintf(p, "Supported memory attributes    : %s\n", mem_attrib[attrib&0x7]);
+	p += sprintf(p, "Supported memory attributes    : ");
+	sep = "";
+	for (i = 0; i < 8; i++) {
+		if (attrib & (1 << i)) {
+			p += sprintf(p, "%s%s\n", sep, mem_attrib[i]);
+			sep = ", ";
+		}
+	}
 
 	if ((status=ia64_pal_vm_page_size(&tr_pages, &vw_pages)) !=0) {
 		printk("ia64_pal_vm_page_size=%ld\n", status);


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Linux-ia64] [PATCH] fix /proc/.../vm_info
  2002-12-12 13:49 [Linux-ia64] [PATCH] fix /proc/.../vm_info Christian Hildner
  2002-12-12 19:56 ` David Mosberger
@ 2002-12-13  7:45 ` Christian Hildner
  2002-12-13 22:09 ` David Mosberger
  2002-12-13 23:40 ` David Mosberger
  3 siblings, 0 replies; 5+ messages in thread
From: Christian Hildner @ 2002-12-13  7:45 UTC (permalink / raw)
  To: linux-ia64

David Mosberger schrieb:

> >>>>> On Thu, 12 Dec 2002 14:49:10 +0100, Christian Hildner <christian.hildner@hob.de> said:
>
>   Christian> Hi, in vm_info the information about the supported memory
>   Christian> attributes is wrong. The patch is based on 2.4.18, but it
>   Christian> should also work for 2.4.20 and 2.5.x. Please apply.
>
> I'd like to keep the output a bit more concise.  How about the attached
> patch (untested)?

I agree. But I would like a distinction between both UCs like "UC (001)" and "UC (100)".

Christian

>
>
>         --david
>
> === arch/ia64/kernel/palinfo.c 1.7 vs edited ==> --- 1.7/arch/ia64/kernel/palinfo.c      Sun Dec  1 22:17:31 2002
> +++ edited/arch/ia64/kernel/palinfo.c   Thu Dec 12 11:54:24 2002
> @@ -101,26 +101,15 @@
>
>  #define RSE_HINTS_COUNT (sizeof(rse_hints)/sizeof(const char *))
>
> -/*
> - * The current revision of the Volume 2 (July 2000) of
> - * IA-64 Architecture Software Developer's Manual is wrong.
> - * Table 4-10 has invalid information concerning the ma field:
> - * Correct table is:
> - *      bit 0 - 001 - UC
> - *      bit 4 - 100 - UC
> - *      bit 5 - 101 - UCE
> - *      bit 6 - 110 - WC
> - *      bit 7 - 111 - NatPage
> - */
>  static const char *mem_attrib[]={
> -       "Write Back (WB)",              /* 000 */
> -       "Uncacheable (UC)",             /* 001 */
> -       "Reserved",                     /* 010 */
> -       "Reserved",                     /* 011 */
> -       "Uncacheable (UC)",             /* 100 */
> -       "Uncacheable Exported (UCE)",   /* 101 */
> -       "Write Coalescing (WC)",        /* 110 */
> -       "NaTPage"                       /* 111 */
> +       "WB",           /* 000 */
> +       "UC",           /* 001 */
> +       "010",          /* 010 */
> +       "011",          /* 011 */
> +       "UC",           /* 100 */
> +       "UCE",          /* 101 */
> +       "WC",           /* 110 */
> +       "NaTPage"       /* 111 */
>  };
>
>  /*
> @@ -315,6 +304,7 @@
>         pal_vm_info_2_u_t vm_info_2;
>         pal_tc_info_u_t tc_info;
>         ia64_ptce_info_t ptce;
> +       const char *sep;
>         int i, j;
>         s64 status;
>
> @@ -339,7 +329,14 @@
>
>         if (ia64_pal_mem_attrib(&attrib) != 0) return 0;
>
> -       p += sprintf(p, "Supported memory attributes    : %s\n", mem_attrib[attrib&0x7]);
> +       p += sprintf(p, "Supported memory attributes    : ");
> +       sep = "";
> +       for (i = 0; i < 8; i++) {
> +               if (attrib & (1 << i)) {
> +                       p += sprintf(p, "%s%s\n", sep, mem_attrib[i]);
> +                       sep = ", ";
> +               }
> +       }
>
>         if ((status=ia64_pal_vm_page_size(&tr_pages, &vw_pages)) !=0) {
>                 printk("ia64_pal_vm_page_size=%ld\n", status);



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Linux-ia64] [PATCH] fix /proc/.../vm_info
  2002-12-12 13:49 [Linux-ia64] [PATCH] fix /proc/.../vm_info Christian Hildner
  2002-12-12 19:56 ` David Mosberger
  2002-12-13  7:45 ` Christian Hildner
@ 2002-12-13 22:09 ` David Mosberger
  2002-12-13 23:40 ` David Mosberger
  3 siblings, 0 replies; 5+ messages in thread
From: David Mosberger @ 2002-12-13 22:09 UTC (permalink / raw)
  To: linux-ia64

>>>>> On Fri, 13 Dec 2002 08:45:37 +0100, Christian Hildner <christian.hildner@hob.de> said:

  Christian> I agree. But I would like a distinction between both UCs
  Christian> like "UC (001)" and "UC (100)".

Ah, yes indeed.  I changed it to the strings you suggested.

Thanks for catching this.

	--david


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Linux-ia64] [PATCH] fix /proc/.../vm_info
  2002-12-12 13:49 [Linux-ia64] [PATCH] fix /proc/.../vm_info Christian Hildner
                   ` (2 preceding siblings ...)
  2002-12-13 22:09 ` David Mosberger
@ 2002-12-13 23:40 ` David Mosberger
  3 siblings, 0 replies; 5+ messages in thread
From: David Mosberger @ 2002-12-13 23:40 UTC (permalink / raw)
  To: linux-ia64

>>>>> On Fri, 13 Dec 2002 08:45:37 +0100, Christian Hildner <christian.hildner@hob.de> said:

  Christian> I agree. But I would like a distinction between both UCs
  Christian> like "UC (001)" and "UC (100)".

Actually, it turns out the double UC entry was just plain wrong.  I
wondered about that, but got distracted before I got to double-check
it.  In reality, 001 is reserved for Software Use.  I changed the
table to read:

	"WB",		/* 000 */
	"SW",		/* 001 */
	"010",		/* 010 */
	"011",		/* 011 */
	"UC",		/* 100 */
	"UCE",		/* 101 */
	"WC",		/* 110 */
	"NaTPage"	/* 111 */

Thanks to Jim Hull for catching this.

	--david


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-12-13 23:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-12 13:49 [Linux-ia64] [PATCH] fix /proc/.../vm_info Christian Hildner
2002-12-12 19:56 ` David Mosberger
2002-12-13  7:45 ` Christian Hildner
2002-12-13 22:09 ` David Mosberger
2002-12-13 23:40 ` David Mosberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox