From nobody Thu Dec 18 19:38:04 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=google.com ARC-Seal: i=1; a=rsa-sha256; t=1571244284; cv=none; d=zoho.com; s=zohoarc; b=Jc4HC/kqmuWIptZkRy+bOBBpINrsEkG3jp/S1u+98Pr894GGh4fyc4DIaxR1gunrx+dPiS3iRa2Iip9gaeDHl6HFLFrlgPlEBstNaqsatbUZrm3pPdCEUi+PCirgVudHkBTv3UA9QkDQDDCu95cu/WkpdRib8k0NFxhGYqjHYXU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571244284; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=E89nW/zbiaC6f3L/yPugJBT28Z9/vrZkYwI78yCPi60=; b=cif5KeeXIPTkNUYYdBfD400tP0zlipM7O2s3o0hgolbhKfWTo1dhnxAE0ZUKmhLyfkISwABH/TJnVI+4yc/c/oIBFmzX/BHkr7cARtCYd9gfEV/C+7AqkHKJxBy9py/JJrgikNCzeLVth9GSXhxUJdscYyUjuAs1GuNz23ew5Og= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1571244284055839.0040042403583; Wed, 16 Oct 2019 09:44:44 -0700 (PDT) Received: from localhost ([::1]:45568 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iKmPi-0005tU-CH for importer@patchew.org; Wed, 16 Oct 2019 12:44:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36094) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <3XkinXQYKCn8vdphlgjrrjoh.frpthpx-ghyhoqrqjqx.ruj@flex--sameid.bounces.google.com>) id 1iKmNJ-00046T-HR for qemu-devel@nongnu.org; Wed, 16 Oct 2019 12:42:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <3XkinXQYKCn8vdphlgjrrjoh.frpthpx-ghyhoqrqjqx.ruj@flex--sameid.bounces.google.com>) id 1iKmNG-0006Br-Di for qemu-devel@nongnu.org; Wed, 16 Oct 2019 12:42:12 -0400 Received: from mail-wr1-x449.google.com ([2a00:1450:4864:20::449]:38042) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from <3XkinXQYKCn8vdphlgjrrjoh.frpthpx-ghyhoqrqjqx.ruj@flex--sameid.bounces.google.com>) id 1iKmNG-0006AR-8E for qemu-devel@nongnu.org; Wed, 16 Oct 2019 12:42:10 -0400 Received: by mail-wr1-x449.google.com with SMTP id w10so11982175wrl.5 for ; Wed, 16 Oct 2019 09:42:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=E89nW/zbiaC6f3L/yPugJBT28Z9/vrZkYwI78yCPi60=; b=p6zBUQjc9k6gj3CDXZkSUQ5JvLyGxIChJh4Mpo9LP2bgfxOMAHV/ztOb7BkU0t03/R ImaPiAUe7L924UIHUhjqo12iAsCPJyEHAspu6LboqA/vchCUHMeEZYmakj3zHLg230Y8 pC4z1b3If9pqmuUKa7ZwRDNtRfGhBnXySvjf9a5qkB3T7i9FrVnwuEkE3qFpSXWS7Lmh CExcW/kLe3ugbVWnvfRVClzEWHTRQ8sUV5xpbS127sCi4GR8XtQnZU12YGAc0FIC7pNb U5Mrn3qbmg2CwDAfYmg6aUN61qS/oiA5H3+VdGAaM5fowvSE+DGnD8oVN0OggBN59Vf2 w3nA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=E89nW/zbiaC6f3L/yPugJBT28Z9/vrZkYwI78yCPi60=; b=U4G+ZTGLUycasgfdYp0TiGJNMTSzCQYVgOEhi0TEGx+Z8wmVIre8EDBq9xHKijDL10 ONPVquejTdBq0jlep4UO82npmzrNZ+0wg2EmULspoGPo9LmT2cg/yHxGzSobnS19IpmF 0rzOfE6nfnLFqiHFRGmxYpJQZzeWpOTqdTHgjOXTvpIYc5AYXBktdkigQ+3Q/5Jpya3z XA7ep+BrzsILcuTlfwK7ZyvRby0GPFb+/sAWOA+JCYAYWsZr9wQUnOheLa9rSQS00gov AoayKfz9lhdODBD7sx8FaKln1XesDFWTSytnxg0rjTePHmIs7+VsPAcRTX1fro4Aub9H SnXQ== X-Gm-Message-State: APjAAAVP3Zs2wVZaaYUz2RXtqtg0oVjlsWCm8DmEbQIDwU46mBQXKsdN Ce4cnynEW+vl3jrjCqjdAwj4QkPY8Ta1KlfyCdJBEilyOGYHSECSGXvghwFJ277C974Rr7NiIyS uHT58O9DpwHZa67iyqKWFN/bnnqsCurhMLKwCYoHIzu2pveiBFANIPTQYr9sS X-Google-Smtp-Source: APXvYqxgbr+nQqZYUNNm+vaKrBek/8RPN3Tds3pAA81ahdVwc1CJd806LiBXJgLAUBq+2uPgByN+U8uxVpY= X-Received: by 2002:a5d:6685:: with SMTP id l5mr3412033wru.44.1571244126426; Wed, 16 Oct 2019 09:42:06 -0700 (PDT) Date: Wed, 16 Oct 2019 19:41:39 +0300 In-Reply-To: <20191016164145.115898-1-sameid@google.com> Message-Id: <20191016164145.115898-4-sameid@google.com> Mime-Version: 1.0 References: <20191016164145.115898-1-sameid@google.com> X-Mailer: git-send-email 2.23.0.700.g56cf767bdb-goog Subject: [PATCH v8 2/8] block: Support providing LCHS from user From: Sam Eiderman To: qemu-devel@nongnu.org Cc: arbel.moshe@oracle.com, karl.heubaum@oracle.com, kevin@koconnor.net, kraxel@redhat.com, kwolf@redhat.com, liran.alon@oracle.com, qemu-block@nongnu.org, sameid@google.com, seabios@seabios.org, lersek@redhat.com, philmd@redhat.com, jsnow@redhat.com, Sam Eiderman X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::449 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @google.com) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Sam Eiderman Add logical geometry variables to BlockConf. A user can now supply "lcyls", "lheads" & "lsecs" for any HD device that supports CHS ("cyls", "heads", "secs"). These devices include: * ide-hd * scsi-hd * virtio-blk-pci In future commits we will use the provided LCHS and pass it to the BIOS through fw_cfg to be supplied using INT13 routines. Reviewed-by: Karl Heubaum Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman Signed-off-by: Sam Eiderman Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/block/block.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/hw/block/block.h b/include/hw/block/block.h index fd55a30bca..d7246f3862 100644 --- a/include/hw/block/block.h +++ b/include/hw/block/block.h @@ -26,6 +26,7 @@ typedef struct BlockConf { uint32_t discard_granularity; /* geometry, not all devices use this */ uint32_t cyls, heads, secs; + uint32_t lcyls, lheads, lsecs; OnOffAuto wce; bool share_rw; BlockdevOnError rerror; @@ -65,7 +66,10 @@ static inline unsigned int get_physical_block_exp(BlockC= onf *conf) #define DEFINE_BLOCK_CHS_PROPERTIES(_state, _conf) \ DEFINE_PROP_UINT32("cyls", _state, _conf.cyls, 0), \ DEFINE_PROP_UINT32("heads", _state, _conf.heads, 0), \ - DEFINE_PROP_UINT32("secs", _state, _conf.secs, 0) + DEFINE_PROP_UINT32("secs", _state, _conf.secs, 0), \ + DEFINE_PROP_UINT32("lcyls", _state, _conf.lcyls, 0), \ + DEFINE_PROP_UINT32("lheads", _state, _conf.lheads, 0), \ + DEFINE_PROP_UINT32("lsecs", _state, _conf.lsecs, 0) =20 #define DEFINE_BLOCK_ERROR_PROPERTIES(_state, _conf) \ DEFINE_PROP_BLOCKDEV_ON_ERROR("rerror", _state, _conf.rerror, \ --=20 2.23.0.700.g56cf767bdb-goog