Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1132836ybb; Wed, 25 Mar 2020 16:37:15 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuZpjhGYfGxmyvBz5enGkiUPV18kzLhUlDbw6/qev38z3e96Am4QtmUAMU3LjmOApcYBsCw X-Received: by 2002:a9d:7696:: with SMTP id j22mr4593538otl.188.1585179435410; Wed, 25 Mar 2020 16:37:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585179435; cv=none; d=google.com; s=arc-20160816; b=zUjdCrx2hdTjIH+DVHG1Wnay7xlWcJ+NUthzQtSXFZhogQWWaktu7oTIjB+HD2/OqF OuSjT8aRWLDjhKnHqL8ck8j0efwRmeG6nlbN5Q3AYbyT5cb9GA875EtfV9PACIMrrx0b tGEkat2YMzU7HTDGIHOdqqDLhglq+mSUXV8r/Pt5a6Eqoj8oyKWMSN4oerx9t6cq3c3b tg9Th4WLZ9NEiQ4k2DijPcqJZ8F+dXhEsnOtoRpmJXMm2BXoXU+xTJju7sRFNYOauJS5 xu0pt7zfvaiTlCccBNMog90KcH64+mvBo8UtCd1S57vvajmrEwOtWjHsRPHiPpC69rTI 5zSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=tP3+BBY3wz3ItDDZcg7gQ7vURgY6HRBvMh3bjHfXtB0=; b=xISw78w8BSzyNRF38Rj6tqEReuIJhhr4NqfiRS7NVvfKpXxx5RRxdiWPujo3igJAdG NhEWVdsTyT8vzOWbTqkcn+v+3rFqnVoh9SuQM8/ZrI5TK1h+YRBklBwussg9nKcaylHY pUr6GhFPOpYvV/fe5mt4Zla6E+cR2Q0gU4/8MPTQlODMOLL5ZLbwbsSjJC0gZEQlVSmF v7iTF6m/RKRkPIXWzBmkfjFzFC1el7sgJwJyBupwW85XDEZEpP2IenyMmDF0hC5Jlfdq kkiRVpOP5ZihWN9UQdB6qJEpYYSZHzxNuhHQv0tQPvZlcqzq++M2pgdUJmnVudx9m3xT VnBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jWDzNsH6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w11si256596otp.239.2020.03.25.16.37.02; Wed, 25 Mar 2020 16:37:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jWDzNsH6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727525AbgCYXgh (ORCPT + 99 others); Wed, 25 Mar 2020 19:36:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:38496 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726970AbgCYXgh (ORCPT ); Wed, 25 Mar 2020 19:36:37 -0400 Received: from mail-io1-f52.google.com (mail-io1-f52.google.com [209.85.166.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8BD8D2073E; Wed, 25 Mar 2020 23:36:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585179396; bh=ukXAg6nYJ1E268DR5bTQMqn2OedkLGJ7YazVsubImkw=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=jWDzNsH6Tk+blCQ8Em7ZZvBdcbpw1zDwZ6XgEQSajuLvr6mSMsBblvlaKcTqhNqs+ +q9VwwfGKIERVzPW9hEQvcR/X2L1YaR9TK1a+B9nrrIA0usmLKNU45NhxXvJSpsbYN MQ9zBTb//9FmRJvFn8vtNHFvUUNLU1Tan8XKFqcE= Received: by mail-io1-f52.google.com with SMTP id o127so4236630iof.0; Wed, 25 Mar 2020 16:36:36 -0700 (PDT) X-Gm-Message-State: ANhLgQ0Xn5if8iNxiI61TtFQXcjwLzos5eQD9Gt/Lv8q8AGv3e3Z4Z+b 5/i1Au/RMLnwBgVjX2Eq+Al4xm2xypXTtcdvKYA= X-Received: by 2002:a5d:980f:: with SMTP id a15mr5262315iol.203.1585179395943; Wed, 25 Mar 2020 16:36:35 -0700 (PDT) MIME-Version: 1.0 References: <20200319192855.29876-1-nivedita@alum.mit.edu> <20200320020028.1936003-1-nivedita@alum.mit.edu> <20200325221007.GA290267@rani.riverdale.lan> In-Reply-To: <20200325221007.GA290267@rani.riverdale.lan> From: Ard Biesheuvel Date: Thu, 26 Mar 2020 00:36:25 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 00/14] efi/gop: Refactoring + mode-setting feature To: Arvind Sankar Cc: Hans de Goede , linux-efi , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 25 Mar 2020 at 23:10, Arvind Sankar wrote: > > On Wed, Mar 25, 2020 at 05:41:43PM +0100, Ard Biesheuvel wrote: > > On Fri, 20 Mar 2020 at 03:00, Arvind Sankar wrote: > > > > > > This series is against tip:efi/core. > > > > > > Patches 1-9 are small cleanups and refactoring of the code in > > > libstub/gop.c. > > > > > > The rest of the patches add the ability to use a command-line option to > > > switch the gop's display mode. > > > > > > The options supported are: > > > video=efifb:mode=n > > > Choose a specific mode number > > > video=efifb:x[-(rgb|bgr|)] > > > Specify mode by resolution and optionally color depth > > > video=efifb:auto > > > Let the EFI stub choose the highest resolution mode available. > > > > > > The mode-setting additions increase code size of gop.o by about 3k on > > > x86-64 with EFI_MIXED enabled. > > > > > > Changes in v2 (HT lkp@intel.com): > > > - Fix __efistub_global attribute to be after the variable. > > > (NB: bunch of other places should ideally be fixed, those I guess > > > don't matter as they are scalars?) > > > - Silence -Wmaybe-uninitialized warning in set_mode function. > > > > > > > These look good to me. The only question I have is whether it would be > > possible to use the existing next_arg() and parse_option_str() > > functions to replace some of the open code parsing that goes on in > > patches 11 - 14. > > > > I don't think so -- next_arg is for parsing space-separated param=value > pairs, so efi_parse_options can use it, but it doesn't work for the > comma-separated options we'll have within the value. > > parse_option_str would only work for the "auto" option, but it scans the > entire option string and just returns whether it was there or not, so it > wouldn't be too useful either, since we have to check for the other > possibilities anyway. > > It would be nice to have a more generic library for cmdline parsing, > there are a lot of places that have to open-code option parsing like > this. > > There's one thing I noticed while working at this, btw. The Makefile > specifies -ffreestanding, but at least x86 builds without having to > specify that. With -ffreestanding, the compiler doesn't optimize string > functions -- strlen(string literal) into a compile-time constant, for > eg. A couple hundred bytes or so can be saved by removing that option, > if it also works for ARM. Yes, -ffreestanding implies -fno-builtin, which means that the compiler cannot assume it knows (and can optimize away) the behavior of strlen(), memset(), etc.