Message ID | 20240112095000.8952-4-tzimmermann@suse.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-24523-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2614:b0:101:6a76:bbe3 with SMTP id mm20csp67361dyc; Fri, 12 Jan 2024 01:56:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IGMCF6fgpDdPcUFNufdF5lvWRBr3rM9H84nVeT2f2i8N+wNX92AYPezAxBli6UeTIvvK/Gr X-Received: by 2002:a05:6a20:c122:b0:199:995d:e88c with SMTP id bh34-20020a056a20c12200b00199995de88cmr864614pzb.24.1705053385648; Fri, 12 Jan 2024 01:56:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705053385; cv=none; d=google.com; s=arc-20160816; b=PL3yXePpXl+c6xa/SXWosLUoCCvmdptjS7OyIJfhcSeQZjwVJ8diVyVLCXfTHa617s tCYK2p9y3Q+ZGw54fZsdD8PAUlDIK4QdNcUXwXPgqKqLWQp9yR+vtpvph4cCvvB0ZbXX fvjDqRaBe+BJUTviTVt3DAYDU5k131iNC8EPUaCcVbkZ/kLcs4g1HMyw0GmtXRMLfBFd 5dZ1vx+xBDQtTmfx6boXZIcizIiz+cPsC/YuGsmOMktgq5wPoeLHQ2WCkrWtsPlVvy0W 3pjjo9r8hpDAGphFS3DMNs5z+4wBe2rSEREdsKz6N268cjEP4reg6bZ4ew8n+75GMQx4 BTRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:dkim-signature :dkim-signature:dkim-signature; bh=+9cuiaFBoH53rifqhpcKmv1PSCTBZIUqSH8muwBZX6s=; fh=tD5dgxUbWvdi0McAUIWhxlBA+uRQgHDVvZj/iKgkEtQ=; b=dKJWfleE/I3dUojRdBAwzSslzk8SVHPKiH//eLHRVrTfaUo3h1sXLmMjc7q/O4QzG0 vQNLmAyTLEEamYi6EX3b2hyfr2qSNB6e7ixVh7ct+7GZv/CBs4dQut9wDpGlHJX1KOQk GDYTPW3W6answIc/xsOj52lBq4s/Opn3ClNHjW5h/swLGwv2R9uaxA2EphKOpadsRkJa fWkpUv9fOH/DM/xng2UO6wNlS0uJnf7sTvRy+bJfHS9Nli/QzHTdH8X+z5zlZe/DbKIR TRU+W4GAKZM/whIVtC+1pyftwm/CshqE+COWsWy6Zj5eHurQiQAHx3saDGzPr/CwxEzj uOzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=j+BsR9iy; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b="mk/3nm62"; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=cwoZj0Mo; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel+bounces-24523-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24523-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id a4-20020a62d404000000b006d9bdca5d75si2810301pfh.362.2024.01.12.01.56.25 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jan 2024 01:56:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-24523-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=j+BsR9iy; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b="mk/3nm62"; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=cwoZj0Mo; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel+bounces-24523-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24523-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id B34DBB25A8A for <ouuuleilei@gmail.com>; Fri, 12 Jan 2024 09:53:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 84CB760BB4; Fri, 12 Jan 2024 09:50:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="j+BsR9iy"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="mk/3nm62"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="cwoZj0Mo"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="pddCMPLm" Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DECA95EE68; Fri, 12 Jan 2024 09:50:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id EEBB721E35; Fri, 12 Jan 2024 09:50:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1705053005; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+9cuiaFBoH53rifqhpcKmv1PSCTBZIUqSH8muwBZX6s=; b=j+BsR9iyg49q923nvujno/zOi3cl1WICdMdV51hqEFmgX2Tzyti+eMMMojLvRN4gO5CnKu JW8tJdTiFRWeRByLLJ3th/dQPZZN9OSsbeSDNhBXnf7cOZjnVO8FkT2ffTy/pEDrQzY0sG SUEJ/7YJT1fDnghNgsSZhcU9+X9DKKw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1705053005; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+9cuiaFBoH53rifqhpcKmv1PSCTBZIUqSH8muwBZX6s=; b=mk/3nm62pQU4PfejH1xpzkMvDSW0jNmO+YnDQ8tKofjWkwXn1pdXEehMNSrdQdNzBhcF+r +Mg+O1I9YKhhUwBg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1705053004; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+9cuiaFBoH53rifqhpcKmv1PSCTBZIUqSH8muwBZX6s=; b=cwoZj0MomxWw5pTNr0Mnd1y2n7VkebTedmgCW+xV+uui8F6TuJbPVFt7cwrTwcFiOltlOc rjb8trG3f1hww8zc3QxHBa/mQqJVwM9G01aWeLEorqTc8G5e8g+hq+teR+P09+X1+pwkiL OH6vXBPfYSI4suoZJs1exnUpAEgMQ8o= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1705053004; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+9cuiaFBoH53rifqhpcKmv1PSCTBZIUqSH8muwBZX6s=; b=pddCMPLmTc4ekiqlkpOQpkEs/jHK5lJ6kNg6AVikMyUD9tLvNlH7SK/L91vvO5/HIZBfrD ctizaQ/H76EQ3sAw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 56EAD139A1; Fri, 12 Jan 2024 09:50:04 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id eILsE0wLoWVmOgAAD6G6ig (envelope-from <tzimmermann@suse.de>); Fri, 12 Jan 2024 09:50:04 +0000 From: Thomas Zimmermann <tzimmermann@suse.de> To: ardb@kernel.org, nathan@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, bhelgaas@google.com, arnd@arndb.de, zohar@linux.ibm.com, dmitry.kasatkin@gmail.com, paul@paul-moore.com, jmorris@namei.org, serge@hallyn.com, javierm@redhat.com Cc: linux-arch@vger.kernel.org, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, Thomas Zimmermann <tzimmermann@suse.de> Subject: [PATCH v5 3/4] arch/x86: Implement arch_ima_efi_boot_mode() in source file Date: Fri, 12 Jan 2024 10:44:38 +0100 Message-ID: <20240112095000.8952-4-tzimmermann@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240112095000.8952-1-tzimmermann@suse.de> References: <20240112095000.8952-1-tzimmermann@suse.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Authentication-Results: smtp-out1.suse.de; none X-Spam-Level: ***** X-Spam-Score: 5.20 X-Spamd-Result: default: False [5.20 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; BAYES_HAM(-0.00)[23.80%]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_MISSING_CHARSET(2.50)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; BROKEN_CONTENT_TYPE(1.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_RATELIMIT(0.00)[to_ip_from(RLf6fmkuiuubj71hj5sz5bt3qt)]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; RCPT_COUNT_TWELVE(0.00)[23]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email]; FREEMAIL_TO(0.00)[kernel.org,linutronix.de,redhat.com,alien8.de,linux.intel.com,zytor.com,google.com,arndb.de,linux.ibm.com,gmail.com,paul-moore.com,namei.org,hallyn.com]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; SUSPICIOUS_RECIPS(1.50)[] X-Spam-Flag: NO X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787878058587060041 X-GMAIL-MSGID: 1787878058587060041 |
Series |
arch/x86: Remove unnecessary dependencies on bootparam.h
|
|
Commit Message
Thomas Zimmermann
Jan. 12, 2024, 9:44 a.m. UTC
The x86 implementation of arch_ima_efi_boot_mode() uses the global
boot_param state. Move it into a source file to clean up the header.
Avoid potential rebuilds of unrelated source files if boot_params
changes.
Suggested-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
arch/x86/include/asm/efi.h | 5 +++--
arch/x86/platform/efi/efi.c | 5 +++++
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h index a5d7a83e4c2a..1dc600fa3ba5 100644 --- a/arch/x86/include/asm/efi.h +++ b/arch/x86/include/asm/efi.h @@ -409,8 +409,9 @@ extern int __init efi_memmap_split_count(efi_memory_desc_t *md, extern void __init efi_memmap_insert(struct efi_memory_map *old_memmap, void *buf, struct efi_mem_range *mem); -#define arch_ima_efi_boot_mode \ - ({ extern struct boot_params boot_params; boot_params.secure_boot; }) +extern enum efi_secureboot_mode __x86_ima_efi_boot_mode(void); + +#define arch_ima_efi_boot_mode __x86_ima_efi_boot_mode() #ifdef CONFIG_EFI_RUNTIME_MAP int efi_get_runtime_map_size(void); diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c index e9f99c56f3ce..f090ec972d7b 100644 --- a/arch/x86/platform/efi/efi.c +++ b/arch/x86/platform/efi/efi.c @@ -950,3 +950,8 @@ umode_t efi_attr_is_visible(struct kobject *kobj, struct attribute *attr, int n) } return attr->mode; } + +enum efi_secureboot_mode __x86_ima_efi_boot_mode(void) +{ + return boot_params.secure_boot; +}