Received: from list by lists.gnu.org with archive (Exim 4.71) id 1e1Wgz-0006ne-HT for mharc-grub-devel@gnu.org; Mon, 09 Oct 2017 07:57:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36961) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e1Wgx-0006mm-RU for grub-devel@gnu.org; Mon, 09 Oct 2017 07:57:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e1Wgu-0006fU-Qd for grub-devel@gnu.org; Mon, 09 Oct 2017 07:57:51 -0400 Received: from boksu.net-space.pl ([185.15.1.105]:37751) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.71) (envelope-from ) id 1e1Wgu-0006eA-F8 for grub-devel@gnu.org; Mon, 09 Oct 2017 07:57:48 -0400 Received: (from localhost user: 'dkiper' uid#4000 fake: STDIN (dkiper@boksu.net-space.pl)) by router-fw-old.local.net-space.pl id S1810188AbdJIL5m (ORCPT ); Mon, 9 Oct 2017 13:57:42 +0200 Date: Mon, 9 Oct 2017 13:57:42 +0200 From: Daniel Kiper To: Eric Snowberg Cc: Daniel Kiper , The development of GNU GRUB , phcoder@gmail.com Subject: Re: [PATCH v2] sparc64: Add blocklist GPT support for SPARC Message-ID: <20171009115742.GA1111@router-fw-old.local.net-space.pl> References: <1494552324-191766-1-git-send-email-eric.snowberg@oracle.com> <20171006140421.GA2075@router-fw-old.local.net-space.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.28i X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 185.15.1.105 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 11:57:52 -0000 On Fri, Oct 06, 2017 at 02:58:30PM -0600, Eric Snowberg wrote: > > On Oct 6, 2017, at 8:04 AM, Daniel Kiper wrote: > > On Thu, May 11, 2017 at 06:25:24PM -0700, Eric Snowberg wrote: > >> Add block-list GPT support for SPARC. The OBP "load" and "boot" methods > >> are partition aware and neither command can see the partition table. Also > >> neither command can address the entire physical disk. When the install > >> happens, grub generates the block-list entries based on the beginning of the > >> physical disk, not the beginning of the parition. This patch fixes the > >> block-list entries so they match what OBP expects during boot for a GPT > >> disk. > >> > >> T5 and above now supports GPT as well as VTOC. > >> > >> This patch has been tested on T5-2 and newer SPARC systems. > >> > >> Signed-off-by: Eric Snowberg > >> --- > >> Changes in v2: > >> Do all GPT offset calculations in setup > >> --- > >> util/setup.c | 26 +++++++++++++++++++++++--- > >> 1 files changed, 23 insertions(+), 3 deletions(-) > >> > >> diff --git a/util/setup.c b/util/setup.c > >> index 8aa5a39..8036307 100644 > >> --- a/util/setup.c > >> +++ b/util/setup.c > >> @@ -138,6 +138,9 @@ struct blocklists > >> #ifdef GRUB_SETUP_BIOS > >> grub_uint16_t current_segment; > >> #endif > >> +#ifdef GRUB_SETUP_SPARC64 > >> + grub_uint64_t gpt_offset; > >> +#endif > > > > This does not seem to be used below??? > > After looking into this further, I don???t see a problem... Sorry, it is a problem. It declares the gpt_offset variable here... > >> grub_uint16_t last_length; > >> grub_disk_addr_t first_sector; > >> }; > >> @@ -151,6 +154,10 @@ save_blocklists (grub_disk_addr_t sector, unsigned offset, unsigned length, > >> struct grub_boot_blocklist *prev = bl->block + 1; > >> grub_uint64_t seclen; > >> > >> +#ifdef GRUB_SETUP_SPARC64 > >> + sector -= bl->gpt_offset; > > It is used here ...and you reference here and below struct member using the same name. So, it is different thing. Hence, we do not need declaration above. Daniel