Operating System - HP-UX
1833793 Members
2577 Online
110063 Solutions
New Discussion

Re: Developing DLKM question.

 
Sung-Geun, Lee
Occasional Contributor

Developing DLKM question.

I'm develping DLKM module on HP-UX 11i environment. I wrote routine to get stat(struct stat) information for current proc.

My routine is below..

int p_stat(struct stat *sb)
{
struct vnode *exec_vp;
int error;

exec_vp = findtextvp(p_vas(u.u_procp));
if ( exec_vp == NULL )
return -1;

error = my_vno_stat(exec_vp, sb, kt_cred(u.u_kthreadp), FOLLOW_LINK);
if ( error )
return -2;

return 0;
}

int my_vno_stat(vp, sb, cred, follow)
{
struct vattr vattr;

vattr.va_acl = 0;
vattr.va_basemode = 0;

error = VOP_GETATTR(vp, &vattr, cred, VSYNC);
if (error)
return error;

.....
}

but, Panic occured in some systems when calling VOP_GETATTR().

my_vno_stat() asm code.
my_vno_stat
.PROC
.CALLINFO CALLER,FRAME=208,ENTRY_GR=%r3,SAVE_RP,ARGS_SAVED,ORDERING_AWARE
.ENTRY
STD %r2,-16(%r30) ;offset 0x0
STD,MA %r3,288(%r30) ;offset 0x4
LDB -146(%r30),%r20 ;offset 0x8
DEPW %r0,24,1,%r20 ;offset 0xc
STH %r0,-148(%r30) ;offset 0x10
COPY %r25,%r3 ;offset 0x14
STW %r23,-280(%r30) ;offset 0x18
STB %r20,-146(%r30) ;offset 0x1c
LDD 24(%r26),%r31 ;offset 0x20 <- panic occured.
LDD 40(%r31),%r19 ;offset 0x24
LDO -256(%r30),%r25 ;offset 0x28
LDI 2,%r23 ;offset 0x2c
.CALL ;in=23,24,25,26,29;out=28;
BVE,L (%r19),%r2 ;offset 0x30
LDO -48(%r30),%r29 ;offset 0x34
CMPB,= %r28,%r0,$00000001 ;offset 0x38
NOP ;offset 0x3c
LDD -304(%r30),%r2 ;offset 0x40
BVE (%r2) ;offset 0x44
.EXIT


Is there any problem in my routine?
Plz, help me.. :-(

thanks for reading my poor english.

Other information is below..


Panic Information.
----------------------------------------
Trap Type 15 (Data page fault):
Instruction Address (pcsq.pcoq) = 0x0.0x1f4dee8
Instruction (iir) = 0x535f0030 (load/store)
Target Address (isr.ior) = 0x0.0xffffffffe2ab9658
Base Register (gr26) = 0xffffffffe2ab9640
Savestate Ptr (ssp) = 0x7b74800.0x400003ffffff15d8
Savestate Return Pointer (ss_rp) = 0x0000000001f4e330


Panic System Information.
-----------------------------------------------
System Name: HP-UX
Node Name: oaweb1
Release: 11.11
Version: U
Model: 9000/800/rp7420
Machine ID: 2380997432
Processors: 6
Architecture: PA-RISC 2.0
CPU is a: PCXW+/PA-8600
Physical Mem: 15.97 GBytes

Installed Solution.
-----------------------------------------------
Veritas Cluster, IBM Tape Device Driver, Veritas Storage Solution, Oracle, etc..
withggam
1 REPLY 1
Stephen Keane
Honored Contributor

Re: Developing DLKM question.

You could try amending your code slightly


struct vattr vattr;

memset(&vattr, 0, sizeof(vattr));

vattr.va_acl = 0;
vattr.va_basemode = 0;


Though I suspect that isn't the problem.