From patchwork Tue Jul 10 09:12:55 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 170103 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 1394F2C007F for ; Tue, 10 Jul 2012 19:40:31 +1000 (EST) Received: from localhost ([::1]:32855 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SoWX8-0004r5-Qv for incoming@patchwork.ozlabs.org; Tue, 10 Jul 2012 05:15:02 -0400 Received: from eggs.gnu.org ([208.118.235.92]:52856) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SoWVt-0002xR-1l for qemu-devel@nongnu.org; Tue, 10 Jul 2012 05:13:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SoWVm-0002iM-P7 for qemu-devel@nongnu.org; Tue, 10 Jul 2012 05:13:44 -0400 Received: from oxygen.pond.sub.org ([78.46.104.156]:57932) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SoWVm-0002h8-GO for qemu-devel@nongnu.org; Tue, 10 Jul 2012 05:13:38 -0400 Received: from blackfin.pond.sub.org (p57B0F62B.dip.t-dialin.net [87.176.246.43]) by oxygen.pond.sub.org (Postfix) with ESMTPA id 2E7F5A401C; Tue, 10 Jul 2012 11:13:37 +0200 (CEST) Received: by blackfin.pond.sub.org (Postfix, from userid 500) id CD95B600B9; Tue, 10 Jul 2012 11:12:57 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 10 Jul 2012 11:12:55 +0200 Message-Id: <1341911575-7306-30-git-send-email-armbru@redhat.com> X-Mailer: git-send-email 1.7.6.5 In-Reply-To: <1341911575-7306-1-git-send-email-armbru@redhat.com> References: <1341911575-7306-1-git-send-email-armbru@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 78.46.104.156 Cc: kwolf@redhat.com, blauwirbel@gmail.com, stefanha@linux.vnet.ibm.com, pbonzini@redhat.com Subject: [Qemu-devel] [PATCH v3 29/29] Relax IDE CHS limits from 16383, 16, 63 to 65535, 16, 255 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org New limits straight from ATA4 6.2 Register delivered data transfer command sector addressing. I figure the old sector limit 63 was blindly copied from the BIOS int 13 limit. Doesn't apply to the hardware. No idea where the old cylinder limit comes from. Signed-off-by: Markus Armbruster --- hw/ide/core.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/ide/core.c b/hw/ide/core.c index 1ca7cdf..58a454f 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -1935,16 +1935,16 @@ int ide_init_drive(IDEState *s, BlockDriverState *bs, IDEDriveKind kind, s->drive_kind = kind; bdrv_get_geometry(bs, &nb_sectors); - if (cylinders < 1 || cylinders > 16383) { - error_report("cyls must be between 1 and 16383"); + if (cylinders < 1 || cylinders > 65535) { + error_report("cyls must be between 1 and 65535"); return -1; } if (heads < 1 || heads > 16) { error_report("heads must be between 1 and 16"); return -1; } - if (secs < 1 || secs > 63) { - error_report("secs must be between 1 and 63"); + if (secs < 1 || secs > 255) { + error_report("secs must be between 1 and 255"); return -1; } s->cylinders = cylinders;