From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46153) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0Uas-0005W6-LY for qemu-devel@nongnu.org; Fri, 27 Jun 2014 07:45:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X0Uaf-0005tO-2y for qemu-devel@nongnu.org; Fri, 27 Jun 2014 07:45:26 -0400 Received: from cantor2.suse.de ([195.135.220.15]:34940 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0Uae-0005sA-TT for qemu-devel@nongnu.org; Fri, 27 Jun 2014 07:45:13 -0400 Message-ID: <53AD5947.2040704@suse.de> Date: Fri, 27 Jun 2014 13:45:11 +0200 From: Alexander Graf MIME-Version: 1.0 References: <1403868326-7718-1-git-send-email-cornelia.huck@de.ibm.com> <1403868326-7718-4-git-send-email-cornelia.huck@de.ibm.com> In-Reply-To: <1403868326-7718-4-git-send-email-cornelia.huck@de.ibm.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PULL 03/10] pc-bios/s390-ccw: handle different sector sizes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cornelia Huck , qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, jfrei@linux.vnet.ibm.com, "Eugene (jno) Dvurechenski" , aliguori@amazon.com, borntraeger@de.ibm.com On 27.06.14 13:25, Cornelia Huck wrote: > From: "Eugene (jno) Dvurechenski" > > Use the virtio device's configuration to figure out the disk geometry > and use a sector size based upon the layout. > > [CH: s/SECTOR_SIZE/MAX_SECTOR_SIZE/g] > Acked-by: Christian Borntraeger > Signed-off-by: Eugene (jno) Dvurechenski > Signed-off-by: Jens Freimann > Signed-off-by: Cornelia Huck > --- > pc-bios/s390-ccw/bootmap.c | 12 +++--- > pc-bios/s390-ccw/s390-ccw.h | 2 +- > pc-bios/s390-ccw/virtio.c | 96 ++++++++++++++++++++++++++++++++++++++++--- > pc-bios/s390-ccw/virtio.h | 48 ++++++++++++++++++++++ > 4 files changed, 147 insertions(+), 11 deletions(-) > > diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c > index c216030..fa2ca26 100644 > --- a/pc-bios/s390-ccw/bootmap.c > +++ b/pc-bios/s390-ccw/bootmap.c > @@ -10,6 +10,7 @@ > > #include "s390-ccw.h" > #include "bootmap.h" > +#include "virtio.h" > > /* #define DEBUG_FALLBACK */ > > @@ -22,7 +23,8 @@ > #endif > > /* Scratch space */ > -static uint8_t sec[SECTOR_SIZE] __attribute__((__aligned__(SECTOR_SIZE))); > +static uint8_t sec[MAX_SECTOR_SIZE] > +__attribute__((__aligned__(MAX_SECTOR_SIZE))); > > typedef struct ResetInfo { > uint32_t ipl_mask; > @@ -99,7 +101,7 @@ static inline bool unused_space(const void *p, unsigned int size) > > static int zipl_load_segment(ComponentEntry *entry) > { > - const int max_entries = (SECTOR_SIZE / sizeof(ScsiBlockPtr)); > + const int max_entries = (MAX_SECTOR_SIZE / sizeof(ScsiBlockPtr)); Is this really safe to increase? Doesn't max_entries depend on the real sector size? Alex