From patchwork Tue Dec 29 10:07:58 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avi Kivity X-Patchwork-Id: 41880 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 3BD28B6EF3 for ; Tue, 29 Dec 2009 21:10:53 +1100 (EST) Received: from localhost ([127.0.0.1]:60431 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NPZ2Q-0007sX-7a for incoming@patchwork.ozlabs.org; Tue, 29 Dec 2009 05:10:50 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NPYzk-0007SY-Fp for qemu-devel@nongnu.org; Tue, 29 Dec 2009 05:08:04 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NPYzi-0007Rr-Jr for qemu-devel@nongnu.org; Tue, 29 Dec 2009 05:08:03 -0500 Received: from [199.232.76.173] (port=50080 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NPYzi-0007RZ-4s for qemu-devel@nongnu.org; Tue, 29 Dec 2009 05:08:02 -0500 Received: from mx1.redhat.com ([209.132.183.28]:62590) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NPYzh-0004kD-FC for qemu-devel@nongnu.org; Tue, 29 Dec 2009 05:08:01 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nBTA7xHJ007169 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 29 Dec 2009 05:08:00 -0500 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nBTA7w9D014945; Tue, 29 Dec 2009 05:07:59 -0500 Received: from localhost.localdomain (file.tlv.redhat.com [10.35.255.8]) by cleopatra.tlv.redhat.com (Postfix) with ESMTP id 82A7125004D; Tue, 29 Dec 2009 12:07:58 +0200 (IST) From: Avi Kivity To: qemu-devel@nongnu.org Date: Tue, 29 Dec 2009 12:07:58 +0200 Message-Id: <1262081278-1858-1-git-send-email-avi@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: kvm@vger.kernel.org Subject: [Qemu-devel] [PATCH RFC] Advertise IDE physical block size as 4K X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Guests use this number as a hint for alignment and I/O request sizes. Given that modern disks have 4K block sizes, and cached file-backed images also have 4K block sizes, this hint can improve guest performance. We probably need to make this configurable depending on machine type. It should be the default for -M 0.13 only as it can affect guest code paths. Signed-off-by: Avi Kivity --- hw/ide/core.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/hw/ide/core.c b/hw/ide/core.c index 76c3820..89fd3ce 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -164,6 +164,7 @@ static void ide_identify(IDEState *s) put_le16(p + 101, s->nb_sectors >> 16); put_le16(p + 102, s->nb_sectors >> 32); put_le16(p + 103, s->nb_sectors >> 48); + put_le16(p + 106, 0x6000 | 3); /* 8 logical sectors per physical sector */ memcpy(s->identify_data, p, sizeof(s->identify_data)); s->identify_set = 1;