kdb
[Top] [All Lists]

Re: [PATCH] access user space addresses/switch process context

To: "Dong, Eddie" <eddie.dong@xxxxxxxxx>
Subject: Re: [PATCH] access user space addresses/switch process context
From: "Vamsi Krishna S ." <vamsi@xxxxxxxxxx>
Date: Thu, 17 Apr 2003 11:09:00 +0530
Cc: kdb <kdb@xxxxxxxxxxx>
In-reply-to: <37FBBA5F3A361C41AB7CE44558C3448E6E583C@pdsmsx403.ccr.corp.intel.com>; from eddie.dong@intel.com on Thu, Apr 17, 2003 at 08:51:30AM +0800
References: <37FBBA5F3A361C41AB7CE44558C3448E6E583C@pdsmsx403.ccr.corp.intel.com>
Reply-to: vamsi@xxxxxxxxxx
Sender: kdb-bounce@xxxxxxxxxxx
User-agent: Mutt/1.2.5i
On Thu, Apr 17, 2003 at 08:51:30AM +0800, Dong, Eddie wrote:
> Do you have any interests in applying this feature to XScale architecture? 
> The xscale patch is under KDB4.0 folder.
> 
Sure.. here it is. I think (addr < PAGE_OFFSET) is the correct test
to determine user space addresses in arm arch too. Please verify
this.

This patch should be applied on top of my earlier patch + kdb 4.0 xscale.

Thanks,
Vamsi.
-- 
Vamsi Krishna S.
IBM Software Lab, Bangalore.
Ph: +91 80 5044959
Internet: vamsi@xxxxxxxxxx
--
diff -urN -X /home/vamsi/.dontdiff 2420-kdb4.1-pure/arch/arm/kdb/kdbasupport.c 
2420-kdb4.1/arch/arm/kdb/kdbasupport.c
--- 2420-kdb4.1-pure/arch/arm/kdb/kdbasupport.c 2003-04-17 09:39:34.000000000 
+0530
+++ 2420-kdb4.1/arch/arm/kdb/kdbasupport.c      2003-04-17 09:39:25.000000000 
+0530
@@ -694,9 +694,9 @@
         && (type[0] == 'u')) {
                struct context_save_struct  *pSave;
                type = NULL;
-               pSave = current->thread.save;
+               pSave = kdb_current_task->thread.save;
                if ( !pSave ) {
-                       kdb_printf("Uninitialized current->thread.save!!!\n");
+                       kdb_printf("Uninitialized current->thread.save 
(pid=%d)!!!\n", kdb_current_task->pid);
                        return 0;
                }
                for (i=0; i<KDB_THREAD_REGNUM; i++) {
diff -urN -X /home/vamsi/.dontdiff 2420-kdb4.1-pure/include/asm-arm/kdb.h 
2420-kdb4.1/include/asm-arm/kdb.h
--- 2420-kdb4.1-pure/include/asm-arm/kdb.h      2003-04-17 09:37:53.000000000 
+0530
+++ 2420-kdb4.1/include/asm-arm/kdb.h   2003-04-17 09:38:08.000000000 +0530
@@ -84,6 +84,9 @@
 
 #include <asm/uaccess.h>
 
+extern int kdb_getuserarea_size(void *, unsigned long, size_t);
+extern int kdb_putuserarea_size(unsigned long, void *, size_t);
+
 static inline int
 __kdba_putarea_size(unsigned long to_xxx, void *from, size_t size)
 {
@@ -92,6 +95,11 @@
        char c;
        c = *((volatile char *)from);
        c = *((volatile char *)from + size - 1);
+      
+       if (to_xxx < PAGE_OFFSET) {
+               return kdb_putuserarea_size(to_xxx, from, size);
+       }
+
 #ifdef VPERNODE_BASE /* if present, the new CONFIG_NUMA code */
        if (to_xxx >= VPERNODE_BASE && to_xxx < VGLOBAL_BASE) {
                to_xxx = __imva(to_xxx);
@@ -110,6 +118,11 @@
        int r;
        *((volatile char *)to) = '\0';
        *((volatile char *)to + size - 1) = '\0';
+
+       if (from_xxx < PAGE_OFFSET) {
+               return kdb_getuserarea_size(to, from_xxx, size);
+       }
+
        set_fs(KERNEL_DS);
        switch (size) {
        case 1:

<Prev in Thread] Current Thread [Next in Thread>