Skip to contentSkip to conversation

Help: strange messages from kernel on IA64 platform

DISCUSSION Sakurai Hiroomi 2 participants 2 messages Jul 12, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi,

I saw same message.

When GAM(Global Array Manager) is started, The following message output.
kernel: kernel unaligned access to 0xe0000001fe1080d4, ip=0xa000000200053371

The uioc structure used by ioctl is defined by packed,
the allignment of each member are disturbed.
In a 64 bit structure, the allignment of member doesn't fit 64 bit boundary. this causes this messages.
In a 32 bit structure, we don't see the message because the allinment of member fit 32 bit boundary even if packed is specified.

patch
I Add 32 bit dummy member to fit 64 bit boundary. I tested. We confirmed this patch fix the problem by IA64 server.

******************************************************************************

drivers/scsi/megaraid/megaraid_ioctl.h renamed from drivers/scsi/megaraid/megaraid_ioctl.h.orig +4 -0
@@ -132,6 +132,10 @@
 /* Driver Data: */
         void __user *           user_data;
         uint32_t                user_data_len;
+
+        /* 64bit alignment */
+        uint32_t                pad_0xBC;
+
         mraid_passthru_t        __user *user_pthru;
 
         mraid_passthru_t        *pthru32;

******************************************************************************

I'm not participated in the linux-scsi mailing list. Please reply to the following addresses.

E-Mail : [email protected]

Best regards,
Hiroomi Sakurai

#1 lore raw
Quoted 6 lines · Sakurai Hiroomi

Hi,

I saw same message.

When GAM(Global Array Manager) is started, The following message output.
kernel: kernel unaligned access to 0xe0000001fe1080d4, ip=0xa000000200053371

first of all you should file a bug against this kernel; the kernel should not printk about unaligned accesses by default!

Quoted 11 lines

The uioc structure used by ioctl is defined by packed,
the allignment of each member are disturbed.
In a 64 bit structure, the allignment of member doesn't fit 64 bit boundary. this causes this messages.
In a 32 bit structure, we don't see the message because the allinment of member fit 32 bit boundary even if packed is specified.

patch
I Add 32 bit dummy member to fit 64 bit boundary. I tested. We confirmed this patch fix the problem by IA64 server.

this changes the calling convention of this structure!
If there is no strict calling convention, then the packed can be removed, but if there is your patch changes the ABI!!
(and you could then fix it by using get_unaligned() in the places that use this field)