Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933343AbdDFIsi (ORCPT ); Thu, 6 Apr 2017 04:48:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49526 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933213AbdDFIsU (ORCPT ); Thu, 6 Apr 2017 04:48:20 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C42D083F38 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=dhowells@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com C42D083F38 Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: References: <149142326734.5101.4596394505987813763.stgit@warthog.procyon.org.uk> <149142327748.5101.9712540392655343615.stgit@warthog.procyon.org.uk> To: Ard Biesheuvel Cc: dhowells@redhat.com, "linux-kernel@vger.kernel.org" , One Thousand Gnomes , "linux-efi@vger.kernel.org" , Matthew Garrett , "gregkh@linuxfoundation.org" , linux-security-module , keyrings@vger.kernel.org, Josh Boyer Subject: Re: [PATCH 01/24] efi: Add EFI_SECURE_BOOT bit MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <15225.1491468497.1@warthog.procyon.org.uk> Date: Thu, 06 Apr 2017 09:48:17 +0100 Message-ID: <15226.1491468497@warthog.procyon.org.uk> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 06 Apr 2017 08:48:20 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1363 Lines: 38 Ard Biesheuvel wrote: > > @@ -1184,6 +1184,7 @@ void __init setup_arch(char **cmdline_p) > > pr_info("Secure boot disabled\n"); > > break; > > case efi_secureboot_mode_enabled: > > + set_bit(EFI_SECURE_BOOT, &efi.flags); > > pr_info("Secure boot enabled\n"); > > break; > > default: > > Like I asked when this patch was sent round the last time: is there > any reason for this not to live in generic code? It's interpreting the x86 boot_params at this point. I suppose I could move the following piece: if (efi_enabled(EFI_BOOT)) { switch (boot_params.secure_boot) { case efi_secureboot_mode_disabled: pr_info("Secure boot disabled\n"); break; case efi_secureboot_mode_enabled: pr_info("Secure boot enabled\n"); break; default: pr_info("Secure boot could not be determined\n"); break; } } into generic code and pass in boot_params.secure_boot as an argument (since that's x86-specific I believe. Any suggestions as to where? The same file as efi_get_secureboot() would seem to be the wrong place since that gets linked into the bootwrapper. I could put it into drivers/firmware/efi/secure_boot.c and make that conditional in the Makefile. David