2006-05-18 23:24:49

by Seiji Munetoh

[permalink] [raw]
Subject: [PATCH 0/2] tpm: bios log parsing fixes

This following patch set fixes
PATCH 1/2) eventlog parser to get the correct ASCII output
PATCH 2/2) changes the BINARY output to the actual ACPI log structure.

--
Seiji Munetoh




2006-05-22 03:43:00

by Libershteyn, Vladimir

[permalink] [raw]
Subject: [LINUX-KERNEL] Problem loading any custom driver

Greetings,

I need a help on understanding and possible resolution on a problem I have while trying to load driver(s) to a server running Linux_IA32_RH_EL4_Update3 either AS or WS
I have a few (actually four) device drivers for different type of devices.
These drivers compile and run fine on any 2.4.x kernels for both desktops/workstations and servers.
The same drivers run fine on desktops/workstations and on slected servers, like IA64 Itanium servers, AMD64 servers, however I can't make it run on IA32 servers.
I've noticed one common among all IA32 servers drivers won't run. All of them have dual processors motherboard with only one processor installed.
The actual problem is: the first kernel function call from the driver (I'm running "insmod drivername" that calls driver_init function) cause kernel to panic.
I believe the problem is either with kernel configuration/setup or with development environment configuration/setup.
Any help/ideas are greatly appretiated. Below are part of a source code and related part of /var/log/messages. Please let me know if more information needed

Regards,
Vladimir Libershteyn, CISSP
Atalla Security Products
Hewlett-Packard
-----------------------------------------

#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
int init_module(void)
#else // LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
int __init atf_init_module(void)
#endif // LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
{
int result;
int i;

/* If already registered, fail */
if (major != 0)
{
printk(KERN_ERR "%s: device interface already registered on major number %d\n", MAJOR_DEVICE_NAME, major);
return -EBUSY;
}

/* Register major, and accept a dynamic number */
result = register_chrdev(major, MAJOR_DEVICE_NAME, &atf_fops); /* This cause the kernel panic , In other driver kmalloc causing the same kernel panic */
if (result < 0)
{
printk(KERN_ERR "%s: failed to register on major number %d\n", MAJOR_DEVICE_NAME, major);
return result;
}

-----------------------------------------------------------------------------


May 18 15:24:20 localhost kernel: Unable to handle kernel paging request at virtual address 83535657
May 18 15:24:20 localhost kernel: printing eip:
May 18 15:24:20 localhost kernel: c0150bf5
May 18 15:24:20 localhost kernel: *pde = 00000000
May 18 15:24:20 localhost kernel: Oops: 0000 [#1]
May 18 15:24:20 localhost kernel: Modules linked in: atflorin(U) vfat fat nls_utf8 parport_pc lp parport autofs4 i2c_dev i2c_core sunrpc ipt_REJECT ipt_state ip_conntrack iptable_filter ip_tables button battery ac md5 ipv6 e100 mii floppy dm_snapshot dm_zero dm_mirror ext3 jbd dm_mod cpqarray sd_mod scsi_mod
May 18 15:24:20 localhost kernel: CPU: 0
May 18 15:24:20 localhost kernel: EIP: 0060:[<c0150bf5>] Not tainted VLI
May 18 15:24:20 localhost kernel: EFLAGS: 00210046 (2.6.9-34.EL)
May 18 15:24:20 localhost kernel: EIP is at kmem_cache_alloc+0x27/0x4c
May 18 15:24:20 localhost kernel: eax: c89c7000 ebx: 00000000 ecx: c0360640 edx: 83535657
May 18 15:24:20 localhost kernel: esi: 00200246 edi: c89c7000 ebp: c494c000 esp: c494cf44
May 18 15:24:20 localhost kernel: ds: 007b es: 007b ss: 0068
May 18 15:24:20 localhost kernel: Process insmod (pid: 3429, threadinfo=c494c000 task=c75eb970)
May 18 15:24:20 localhost kernel: Stack: c0360640 c88d0800 c0360600 c89c7016 c7ffbf60 000000d0 00000000 00000000
May 18 15:24:20 localhost kernel: 0000000b 00000000 00000013 00000000 0000000e 00000000 00000021 00000020
May 18 15:24:20 localhost kernel: 00000022 c89c5b90 c89c3575 c89bd000 00200246 c88d0800 c0360640 c88d0800
May 18 15:24:20 localhost kernel: Call Trace:
May 18 15:24:20 localhost kernel: [<c89c7016>] atflorin_init_module+0x16/0x1bb [atflorin]
May 18 15:24:20 localhost kernel: [<c013de72>] sys_init_module+0xe9/0x1d0
May 18 15:24:20 localhost kernel: [<c0311443>] syscall_call+0x7/0xb
May 18 15:24:20 localhost kernel: Code: 5a 5b 09 00 57 f6 c2 10 89 c7 56 53 89 d3 74 16 31 c9 ba 0f 08 00 00 b8 cd 27 32 c0 e8 d5 d5 fc ff e8 ec ef 1b 00 9c 5e fa 8b 17 <8b> 02 85 c0 74 10 c7 42 0c 01 00 00 00 48 89 02 8b 44 82 10 eb
May 18 15:24:20 localhost kernel: <0>Fatal exception: panic in 5 seconds

-----------------------------------------------------------------------

2006-05-22 03:50:51

by Arjan van de Ven

[permalink] [raw]
Subject: Re: [LINUX-KERNEL] Problem loading any custom driver

On Sun, 2006-05-21 at 20:42 -0700, Libershteyn, Vladimir wrote:
> Greetings,
>
> I need a help on understanding and possible resolution on a problem I have while trying to load driver(s) to a server running Linux_IA32_RH_EL4_Update3 either AS or WS
> I have a few (actually four) device drivers for different type of devices.
> These drivers compile and run fine on any 2.4.x kernels for both desktops/workstations and servers.
> The same drivers run fine on desktops/workstations and on slected servers, like IA64 Itanium servers, AMD64 servers, however I can't make it run on IA32 servers.
> I've noticed one common among all IA32 servers drivers won't run. All of them have dual processors motherboard with only one processor installed.
> The actual problem is: the first kernel function call from the driver (I'm running "insmod drivername" that calls driver_init function) cause kernel to panic.
> I believe the problem is either with kernel configuration/setup or with development environment configuration/setup.
> Any help/ideas are greatly appretiated. Below are part of a source code and related part of /var/log/messages. Please let me know if more information needed
>
> Regards,

you forgot to put a URL to your source code.......

however it strongly points towards a broken Makefile on your side.... if
we'd have that URL I could say for sure ..


2006-05-22 04:05:39

by Libershteyn, Vladimir

[permalink] [raw]
Subject: RE: [LINUX-KERNEL] Problem loading any custom driver

Here is a makefile
-------------------------------------------------
#
# Makefile for the Los Angeles PCI Adapter
# This file supports Red Hat Linux kernel 2.6(included) and above
#
HPATH := /usr/src/kernels/2.6.9-34.EL-i686/include
CFLAGS = -I$(HPATH) -Wall -O2 -fomit-frame-pointer -c
CFLAGS := $(CFLAGS) -DHOST_LITTLE_ENDIAN -DHOST_SIZE_32

obj-m += atf_host.o
-------------------------------------------------

Our group does not have ability to put files for outside access.
Can you specify what parts of the code you need me to attach?
Im not familiar with rules, is it allowed to attach source files?

Regards,
Vlad


-----Original Message-----
From: Arjan van de Ven [mailto:[email protected]]
Sent: Sunday, May 21, 2006 8:51 PM
To: Libershteyn, Vladimir
Cc: [email protected]
Subject: Re: [LINUX-KERNEL] Problem loading any custom driver


On Sun, 2006-05-21 at 20:42 -0700, Libershteyn, Vladimir wrote:
> Greetings,
>
> I need a help on understanding and possible resolution on a problem I have while trying to load driver(s) to a server running Linux_IA32_RH_EL4_Update3 either AS or WS
> I have a few (actually four) device drivers for different type of devices.
> These drivers compile and run fine on any 2.4.x kernels for both desktops/workstations and servers.
> The same drivers run fine on desktops/workstations and on slected servers, like IA64 Itanium servers, AMD64 servers, however I can't make it run on IA32 servers.
> I've noticed one common among all IA32 servers drivers won't run. All of them have dual processors motherboard with only one processor installed.
> The actual problem is: the first kernel function call from the driver (I'm running "insmod drivername" that calls driver_init function) cause kernel to panic.
> I believe the problem is either with kernel configuration/setup or with development environment configuration/setup.
> Any help/ideas are greatly appretiated. Below are part of a source code and related part of /var/log/messages. Please let me know if more information needed
>
> Regards,

you forgot to put a URL to your source code.......

however it strongly points towards a broken Makefile on your side.... if
we'd have that URL I could say for sure ..


2006-05-22 04:13:08

by Arjan van de Ven

[permalink] [raw]
Subject: RE: [LINUX-KERNEL] Problem loading any custom driver

On Sun, 2006-05-21 at 21:05 -0700, Libershteyn, Vladimir wrote:
> Here is a makefile
> -------------------------------------------------
> #
> # Makefile for the Los Angeles PCI Adapter
> # This file supports Red Hat Linux kernel 2.6(included) and above
> #
> HPATH := /usr/src/kernels/2.6.9-34.EL-i686/include
> CFLAGS = -I$(HPATH) -Wall -O2 -fomit-frame-pointer -c
> CFLAGS := $(CFLAGS) -DHOST_LITTLE_ENDIAN -DHOST_SIZE_32
>
> obj-m += atf_host.o

this is buggy, you have to drop the CFLAGS lines!!!!!


> Our group does not have ability to put files for outside access.
> Can you specify what parts of the code you need me to attach?
> Im not familiar with rules, is it allowed to attach source files?

yeah that's fine if they're not gigantic (50Kb or so is a reasonable
boundary for that)

2006-05-22 05:30:34

by Libershteyn, Vladimir

[permalink] [raw]
Subject: RE: [LINUX-KERNEL] Problem loading any custom driver

So,
in this case what kind of makefile I should have?
Can you attach an example?
Attached makefile is very similar what I found in the 2.6.9-34.EL-i686 source
I also were thinking that some os includes are not the right ones

--------------------------------------------------

/* Include Files */
#ifdef MODULE
#include <linux/module.h>
#include <linux/version.h>
#endif

#include <linux/config.h>
#include <linux/types.h>
#include <linux/pci.h>
#include <linux/kernel.h>
#include <linux/sched.h>

#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/init.h>
#include <linux/skbuff.h>
#include <linux/ethtool.h>

#include <linux/mm.h>
#include <linux/errno.h>
#include <linux/ioport.h>

#include <linux/delay.h>
#include <linux/timer.h>
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/version.h>
#include <linux/inetdevice.h>
#include <linux/bitops.h>

#include <asm/uaccess.h>
#include <linux/if_ether.h>
#include <linux/if_arp.h>
#include <net/arp.h>

#include "atf.h"
#include "atf_host.h"
#include "atf_common.h"

-------------------------------------------------------------

-----Original Message-----
From: Arjan van de Ven [mailto:[email protected]]
Sent: Sunday, May 21, 2006 9:13 PM
To: Libershteyn, Vladimir
Cc: [email protected]
Subject: RE: [LINUX-KERNEL] Problem loading any custom driver


On Sun, 2006-05-21 at 21:05 -0700, Libershteyn, Vladimir wrote:
> Here is a makefile
> -------------------------------------------------
> #
> # Makefile for the Los Angeles PCI Adapter
> # This file supports Red Hat Linux kernel 2.6(included) and above
> #
> HPATH := /usr/src/kernels/2.6.9-34.EL-i686/include
> CFLAGS = -I$(HPATH) -Wall -O2 -fomit-frame-pointer -c
> CFLAGS := $(CFLAGS) -DHOST_LITTLE_ENDIAN -DHOST_SIZE_32
>
> obj-m += atf_host.o

this is buggy, you have to drop the CFLAGS lines!!!!!


> Our group does not have ability to put files for outside access.
> Can you specify what parts of the code you need me to attach?
> Im not familiar with rules, is it allowed to attach source files?

yeah that's fine if they're not gigantic (50Kb or so is a reasonable
boundary for that)