From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:35398) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SPWdt-0003s0-QE for qemu-devel@nongnu.org; Wed, 02 May 2012 06:18:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SPWds-0006eR-32 for qemu-devel@nongnu.org; Wed, 02 May 2012 06:18:41 -0400 Received: from e06smtp18.uk.ibm.com ([195.75.94.114]:33091) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SPWdr-0006e6-Qt for qemu-devel@nongnu.org; Wed, 02 May 2012 06:18:40 -0400 Received: from /spool/local by e06smtp18.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 2 May 2012 11:18:36 +0100 Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1307.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q42AIY4f2404406 for ; Wed, 2 May 2012 11:18:34 +0100 Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q42AIXQE027817 for ; Wed, 2 May 2012 04:18:33 -0600 Message-ID: <4FA109F6.3090107@de.ibm.com> Date: Wed, 02 May 2012 12:18:30 +0200 From: Christian Borntraeger MIME-Version: 1.0 References: <1335448165-26174-1-git-send-email-borntraeger@de.ibm.com> <1335448165-26174-2-git-send-email-borntraeger@de.ibm.com> <4F9AC55F.5000101@redhat.com> In-Reply-To: <4F9AC55F.5000101@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/3] Fix geometry sector calculation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Heinz Graalfs , Alexander Graf , qemu-devel , Jens Freimann , Cornelia Huck , Christoph Hellwig >> + blkcfg.sectors = secs & ~(blk_size / pblk_size - 1); > > I'm not sure here what you mean. Usually blk_size >= pblk_size on > non-s390 systems, so this is completely different from the previous > code, which is effectively I was trying to prevent the masking of the sector number. the first version of the patch simply did blkcfg.sectors = secs; but this broke setups that really need that masking. > > blkcfg.sectors = secs & ~(blk_size / 512 - 1); > > I wonder if s390 gives a different meaning to logical vs. physical > sector sizes, compared to what virtio expects (which is what SCSI says, > basically). Physical block sizes on non-s390 systems are really just > useful as an alignment hint, they do not affect correctness. Maybe that really points to the problem that we are trying to solve here. For a dasd device, there is usually a 4096 byte block size and on the host these 4096 arereported via getss and getpbsz. The geometry reported by the device driver is usually 15 head and 12 sectors per track, but actually means 12 sectors of 4096 bytes size (a track ~ 48k). What I want to achieve is that the guest view is identical to the host view for cyls, heads, secs, and all block sizes. Christian