From patchwork Mon Feb 6 11:22:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 93408 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1661003qgi; Mon, 6 Feb 2017 03:24:02 -0800 (PST) X-Received: by 10.99.170.70 with SMTP id x6mr12743340pgo.14.1486380242419; Mon, 06 Feb 2017 03:24:02 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1si422082plk.2.2017.02.06.03.24.02; Mon, 06 Feb 2017 03:24:02 -0800 (PST) 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=@linaro.org; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751886AbdBFLX7 (ORCPT + 25 others); Mon, 6 Feb 2017 06:23:59 -0500 Received: from mail-wr0-f175.google.com ([209.85.128.175]:32885 "EHLO mail-wr0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751835AbdBFLXy (ORCPT ); Mon, 6 Feb 2017 06:23:54 -0500 Received: by mail-wr0-f175.google.com with SMTP id i10so21674367wrb.0 for ; Mon, 06 Feb 2017 03:23:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=EmRSFp6mb6gijgTtlCf5PaFVQv2uUQtrHfzPHXTSw9E=; b=Gi9c/m7+Ax+lm0/DZb6ueiAQ1w+w3fhAeA7FPWaVLY+F1/flTil9I8cSP0dPhv2TZm UrVDBDIdmj6qsUsHH0n1Cby6kDa/xcy7N9fpiAN3rnnaFnXCd78g0Klk9p5yRXIISSpb toQDeC27DsgQeV3LJh/sMn4kzDROZjFZf84J0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=EmRSFp6mb6gijgTtlCf5PaFVQv2uUQtrHfzPHXTSw9E=; b=qewwkbCvebLpHblraIc4+bcwcx8f9JHuQLinGV0D6MHK385OVvTypPBeJAoO59GV8B xfsMxhJ3P8sOBx2lMQtLET4xFoad60Myqpb8AP0WRQ+SE9CEP14oKvH1g6ayd3vtemh/ DX//qlhjqwBqrEJJvwYMJLraLV96owunCUm5lqJx7H+hrLBrJYEVA9y0NBn73bClwTnN BXMqGu4ScdEWl/7HCFHVsDqavo3TVJnMR4JOxjOd4K8PPmwFcT4QvCqTmYSpXNKNpnVF Jc6kfQ7xVu/G1d59uZyO4KjJlO/pseTHvx7IBZEeS2YlJXouIbsiPwhwWFj53SZJlz9M ZTGQ== X-Gm-Message-State: AIkVDXJ0Q+YwF+xNGFGjWsiGX8vyDI/Cxh4hrCkeBUitbi84FDZ01qQKe26w76dlOYAB/LPh X-Received: by 10.223.172.210 with SMTP id o76mr8741508wrc.21.1486380231236; Mon, 06 Feb 2017 03:23:51 -0800 (PST) Received: from localhost.localdomain ([160.169.163.122]) by smtp.gmail.com with ESMTPSA id o70sm903698wrc.20.2017.02.06.03.23.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 06 Feb 2017 03:23:50 -0800 (PST) From: Ard Biesheuvel To: matt@codeblueprint.co.uk, Ingo Molnar , Thomas Gleixner , "H . Peter Anvin" Cc: David Howells , Ard Biesheuvel , linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org Subject: [PATCH 6/7] efi: Print the secure boot status in x86 setup_arch() Date: Mon, 6 Feb 2017 11:22:45 +0000 Message-Id: <1486380166-31868-7-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1486380166-31868-1-git-send-email-ard.biesheuvel@linaro.org> References: <1486380166-31868-1-git-send-email-ard.biesheuvel@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: David Howells Print the secure boot status in the x86 setup_arch() but otherwise do nothing more for now. More functionality will be added later, but this at least allows for testing. Signed-off-by: David Howells Cc: Matt Fleming [ardb: use efi_enabled() instead of IS_ENABLED(CONFIG_EFI)] Signed-off-by: Ard Biesheuvel --- arch/x86/kernel/setup.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) -- 2.7.4 diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 4cfba947d774..69780edf0dde 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -1176,6 +1176,20 @@ void __init setup_arch(char **cmdline_p) /* Allocate bigger log buffer */ setup_log_buf(1); + 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; + } + } + reserve_initrd(); acpi_table_upgrade();