Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750872AbWLLCHP (ORCPT ); Mon, 11 Dec 2006 21:07:15 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750875AbWLLCHP (ORCPT ); Mon, 11 Dec 2006 21:07:15 -0500 Received: from mga01.intel.com ([192.55.52.88]:3607 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750872AbWLLCHK (ORCPT ); Mon, 11 Dec 2006 21:07:10 -0500 X-ExtLoop1: 1 X-IronPort-AV: i="4.09,522,1157353200"; d="scan'208"; a="176137767:sNHT1254395618" From: "Chen, Kenneth W" To: "'Pete Zaitcev'" , "Matt Helsley" Cc: "Erik Jacobson" , , Subject: RE: [PATCH] connector: Some fixes for ia64 unaligned access errors Date: Mon, 11 Dec 2006 18:07:08 -0800 Message-ID: <000001c71d92$3aa76c70$e434030a@amr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 Thread-Index: Accdjo4zfo9eXwARTN+j6Pv5mjRxNAAAl8BQ In-Reply-To: <20061211172907.305473cf.zaitcev@redhat.com> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1586 Lines: 38 Pete Zaitcev wrote on Monday, December 11, 2006 5:29 PM > On Mon, 11 Dec 2006 15:52:47 -0800, Matt Helsley wrote: > > > I'm shocked memcpy() introduces 8-byte stores that violate architecture > > alignment rules. Is there any chance this a bug in ia64's memcpy() > > implementation? I've tried to read it but since I'm not familiar with > > ia64 asm I can't make out significant parts of it in > > arch/ia64/lib/memcpy.S. > > The arch/ia64/lib/memcpy.S is probably fine, it must be gcc doing > an inline substitution of a well-known function. arch/ia64/lib/memcpy.S is fine because it does alignment check at the very beginning of the function and depends on the alignment of dst/src alignment, it does different thing. The unaligned access is coming from gcc inlined version of memcpy. But looking deeply, memory allocation for proc_event in proc_for_connector doesn't looked correct at all: In drivers/connector/cn_proc.c: #define CN_PROC_MSG_SIZE (sizeof(struct cn_msg) + sizeof(struct proc_event)) void proc_fork_connector(struct task_struct *task) { struct cn_msg *msg; struct proc_event *ev; __u8 buffer[CN_PROC_MSG_SIZE]; You can't do that because gcc assumes struct proc_event aligns on certain boundary. Doing fancy hand crafting like that breaks code generated by gcc. - Ken - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/