From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L2Bx9-0003EZ-Pb for qemu-devel@nongnu.org; Mon, 17 Nov 2008 16:48:15 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L2Bx8-0003EM-6A for qemu-devel@nongnu.org; Mon, 17 Nov 2008 16:48:15 -0500 Received: from [199.232.76.173] (port=53676 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L2Bx8-0003EJ-23 for qemu-devel@nongnu.org; Mon, 17 Nov 2008 16:48:14 -0500 Received: from bsdimp.com ([199.45.160.85]:49828 helo=harmony.bsdimp.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1L2Bx7-00038D-1A for qemu-devel@nongnu.org; Mon, 17 Nov 2008 16:48:14 -0500 Date: Mon, 17 Nov 2008 13:47:48 -0700 (MST) Message-Id: <20081117.134748.132268808.imp@bsdimp.com> Subject: Re: [Qemu-devel] Re: [RESEND][PATCH] Add 40-bit DMA support to LSI scsi emulation From: "M. Warner Losh" In-Reply-To: <4921CDCD.1060100@codemonkey.ws> References: <20081117173417.GT31893@us.ibm.com> <4921CDCD.1060100@codemonkey.ws> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, anthony@codemonkey.ws Cc: ryanh@us.ibm.com, paul@codesourcery.com In message: <4921CDCD.1060100@codemonkey.ws> Anthony Liguori writes: : Blue Swirl wrote: : > On 11/17/08, Ryan Harper wrote: : > : >> Looking for some feedback on this patch, MAINTAINERS points to Paul for : >> scsi stuff, and I saw Blue Swirl commit a scsi patch recently. : >> : >> This patch fixes Linux machines configured with > 4G of ram and using a : >> SCSI device. I'm working on 64-bit DMA support as well which should : >> hopefully fix 64-bit Windows using SCSI devices as well. : >> : > : > addr = s->dnad; : > + if (lsi_dma_40bit(s)) : > + addr |= ((uint64_t)s->dnad64 << 32UL); : > + else if (s->sbms) : > + addr |= ((uint64_t)s->sbms << 32UL); : > : > Maybe the address could be calculated at script parsing phase for : > small performance gain. : > : > I would use ULL instead of UL, because on 32 bit host long is still 32 bits. : > : : But both ULL and UL are wrong for a shift operation. It always takes an : integer. Yes, the real issue is for something like 1UL << 63 vs 1ULL << 63 Warner