Received: by 2002:ab2:3319:0:b0:1ef:7a0f:c32d with SMTP id i25csp490539lqc; Fri, 8 Mar 2024 03:46:33 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX/TfWLx5RnNRSS8FEBQGQ9dBtX6OJEFeYAH9Qkl6GjbtOvjr0f9k2JL9BjeZ3uSmj+38kw7rYkjERPxewRXNZ4FPIueWItI+20emuQIg== X-Google-Smtp-Source: AGHT+IF3AVGY26TKgM2BVx6VnQBG24QD7kdmn0OOUBMg3ijuGyhY9LVKdF5CmdL6QYvhYtKxY9er X-Received: by 2002:a05:6e02:1b04:b0:365:ca58:6e84 with SMTP id i4-20020a056e021b0400b00365ca586e84mr23409960ilv.18.1709898392859; Fri, 08 Mar 2024 03:46:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709898392; cv=pass; d=google.com; s=arc-20160816; b=fjLPsMeFuA6iP1lNxJ0ylrPH7cvee5+S8rIrbu+TW7w56Yx5sjiqN5U6I256LSi0b2 FOAENgh2rwYAUJneXd3Bac+6Kj5ISkj7rQloB5WWoM7GA+O3MZ2P47ZQit3M3Cxg4tYc VrUWUOoy0UHhnLW+74uTL/mcqzxPiJ+oYBNfwu8IfcF4DJYWH8jXPbJ6ajUYFxAOHba3 5Y/iFGmkSrXu6du4rSO7ik5h8CqHTsSINZnL8N5iIUXmn0UCeOT1iMd9hT33Zbp+/g5j NFBEN9cFu5JYk/yl0ZaAU1wOlhqAh7RvqgdvYlrR6agjHwijefOGkVRWHsLlco2HWfPM UN8A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=CxjBuQ5Hr5iUjbFpoFLi1FU9ld23HU7MWmtx29TkFOs=; fh=tp5J9VBLFY273ZS3ahzZzT9F8YsNoasQ/8zIqkEaHKU=; b=XUKX7hC2Y9BteUVFmxPFrgzJlOxRkdH3N50Y1mOZPZpfRSR67dogNAebRNNc0R1Zwd YXXBVgaJOCYb6qoPHZsRsr8B/rGIT6x7oJex5J93wndoqhDSgLljG1hLxjvslEh+3uiu rNpd7jL8JySqaiahcPzIViVbExPECRCVYFaoh040CdUtA4FrvbxqrQylcRhc7p3ieLMZ 9Owj/RV90mrk7+EY40sX/2URryEJ+hAtKdU9tzwm2vzjgJfMaR7UD5MZvN+veHNHeBYd CXPdg3sdsIWAmUAF7ljwuJ2ez2nrLmdH2tCmUZDwhrFhqCJmQyYCm6tO3slQa8uMkC4+ YQsg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ciJIhD9m; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-96955-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-96955-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id o8-20020a63f148000000b005d8c0f44e73si15343293pgk.262.2024.03.08.03.46.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Mar 2024 03:46:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-96955-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ciJIhD9m; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-96955-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-96955-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 85AF7282AAA for ; Fri, 8 Mar 2024 11:46:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E74895D741; Fri, 8 Mar 2024 11:44:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ciJIhD9m" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 187515D471 for ; Fri, 8 Mar 2024 11:44:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709898285; cv=none; b=NkStQoMwHZDyIWh+8WtiujJEbZ7guRPL3vXp6GwGE8B0e3e3Ufag5fO06Y1SmZfQ7b9EUrNcKN8/vW8s5tztw6HPwGixuPpC0SCKQJ8f9DFHsPFScsNI5bvNZyJsrZjEytm4qENBOUxTK3/BqXrWtvU8eXLQ0xl2CpnnEW4Z9UQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709898285; c=relaxed/simple; bh=RRURGp4C9zLE/LmAZUrJtURGA0DnojIeM4tTmOPbNYc=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=OgMT/PR2KTFai9uVOTHWQYf+MuyNPklZzNy+l+oPIE1lkTt3AqZKFzkG2MawhReHcOuzM01oOYiRjsGMzE68sA7Qp17H6kvf/u0MjRDkD0ou1rQg851cy5TZ6SNhhsg26R2TS+z5K9qBHeb5GTC7hfvBrWhb5IC7DljeFJY2KcA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ciJIhD9m; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A366DC43609 for ; Fri, 8 Mar 2024 11:44:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709898284; bh=RRURGp4C9zLE/LmAZUrJtURGA0DnojIeM4tTmOPbNYc=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=ciJIhD9mBzNWZmHVsYvntxdR+Epmfa/2epb1aoiVZcmrOvaGcxSH1PjwRC2c2YXKD yhDTBn6rKzxgQxIPh3oBAkSoNZ8p7O1WkcWAp+mMzl02PPVsp9pBvw3pRbA//xgiCa 2NEMCV0aJLKiX7RtieSpSiXn3f1qi4XXVM2bAAj7vyHMNJ1xH6kKHfDxdqr2NHw5Ke u5cj18Rvy0HYxXpoc+bOG8gF93OvYltvQbJpMPhYVX3cd5duSoCgSbSM0Cs9MnmHfE YDmSg6GPm8eFmVqwTzt9Xh3Kh6m54wOIm8eJC1P+52rZBkXSYveT60tl/0j22uinpc ukOPTI19staYg== Received: by mail-lf1-f45.google.com with SMTP id 2adb3069b0e04-512ed314881so1875645e87.2 for ; Fri, 08 Mar 2024 03:44:44 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVEaal0GUwu/cORJroZkiOiNd9J+3AaG56Dx5h2H6HFpqp+JQh4H2aE3A4Rx9TRb8hqpr7QhkDlrrXJ7bC0I+841tWrB24SpnwHKY4o X-Gm-Message-State: AOJu0YzxXxc6l07NbRXm7cP1gOOiVZAOxxXq1TQ9iLONXQAFxE5sqLUZ WQjBQXB2oN7D3UYj62136FfCTzZaJnE1O/h9wGidECLEOcIwfoJLpveV5vvO/ce2II4kDsP67ak a29pnd5aO/Ye8g6vMPu6eRYIMcrc= X-Received: by 2002:a05:6512:39cd:b0:513:27d7:400e with SMTP id k13-20020a05651239cd00b0051327d7400emr4624052lfu.29.1709898282755; Fri, 08 Mar 2024 03:44:42 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240222202404.36206-1-kevinloughlin@google.com> <20240308110043.GEZerv21Qj10Q7-8p5@fat_crate.local> In-Reply-To: <20240308110043.GEZerv21Qj10Q7-8p5@fat_crate.local> From: Ard Biesheuvel Date: Fri, 8 Mar 2024 12:44:31 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] x86/kernel: skip ROM range scans and validation for SEV-SNP guests To: Borislav Petkov Cc: Kevin Loughlin , acdunlap@google.com, alexander.shishkin@linux.intel.com, andrisaar@google.com, bhe@redhat.com, brijesh.singh@amd.com, dave.hansen@linux.intel.com, dionnaglaze@google.com, grobler@google.com, hpa@zytor.com, jacobhxu@google.com, jpoimboe@kernel.org, kai.huang@intel.com, linux-kernel@vger.kernel.org, michael.roth@amd.com, mingo@redhat.com, peterz@infradead.org, pgonda@google.com, ross.lagerwall@citrix.com, sidtelang@google.com, tglx@linutronix.de, thomas.lendacky@amd.com, x86@kernel.org, ytcoode@gmail.com Content-Type: text/plain; charset="UTF-8" On Fri, 8 Mar 2024 at 12:01, Borislav Petkov wrote: > > On Fri, Mar 08, 2024 at 11:30:50AM +0100, Ard Biesheuvel wrote: > > Agree with the analysis and the conclusion. However, this will need to > > be split into generic and x86 specific changes, given that the DMI > > code is shared between all architectures, and explicitly checking for > > SEV-SNP support in generic code is not appropriate. > > > > So what we will need is: > > I was actually thinking of: > > x86_init.resources.probe_roms = snp_probe_roms; > > and snp_probe_roms() is an empty stub. > > Problem solved without ugly sprinkling of checks everywhere. > Indeed. Setting the override could be done in init_hypervisor_platform(), which is called right before from setup_arch().