From mboxrd@z Thu Jan 1 00:00:00 1970 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 849886BFCE for ; Tue, 31 Mar 2026 13:21:36 +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=1774963296; cv=none; b=aM/k7FsUvm7vAXnzLrGITAYKhrw4qTt3/5iqMK5v64D1an5t0Co6rTDZftm0Pnpx/9eLPvm53teZI6BZNwdokxW+auEn1mD/IGl96KE1gWIFBCJCEwWnNrOvJDl5fsblUmNePH61PuMn/WacHVqEfft2W2kumgIkmPPM/pTNQyI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774963296; c=relaxed/simple; bh=AmZKtmIPdRH0V6yIdQYCT7pQzI2mN5j+QGH/A3xkUO4=; h=MIME-Version:Date:From:To:Cc:Message-Id:In-Reply-To:References: Subject:Content-Type; b=CMHc1cZEOAtoP1r8ewVLxwHw1KKhc5GPB53IQYC+81ZsopQZGgLy3gL3ff730rJtrwDBYkD3S7MOnUYR9fnJvXZt5+F1thHjCz2SVIV7vpXFN6mtjmL2qy0IUDFdhQmF9pXU88WBCKpkw25OMYBDeZhrt1M55MsBYm+9vD2Y+mM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oX1NY74X; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="oX1NY74X" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1228C19423; Tue, 31 Mar 2026 13:21:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1774963296; bh=AmZKtmIPdRH0V6yIdQYCT7pQzI2mN5j+QGH/A3xkUO4=; h=Date:From:To:Cc:In-Reply-To:References:Subject:From; b=oX1NY74X2CMO1iZ6OH6oDrey83j+/tsCGE4XAvg/zF1Or2bHF31qDFRl+40OFXKoi +OvJcBDMmSUPBX9dIWD7KGzJKNjttENXZwi8qDrVuxBvMJDVpOE9Ncruc3e86XOXoj XbcXyCRpaxqt5TPsjB97WUssajSTNij32nGxzmpFcLN8lBO6eUfu6aKpUxnUkxq25c KZF4hGamSqdJoRHzxxtT6ux+hpj6MkSgTkeGSbzNla/RMOAiIeTSKgas1ODB432SBO QrEvyGFNmIIaERD96InBcQUkgEm2c2SAyevpZ42lcdyjx7e7xbG4J+dg5zPsazBhKt oYHvrBFqx996w== Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfauth.phl.internal (Postfix) with ESMTP id F1CB4F4006E; Tue, 31 Mar 2026 09:21:34 -0400 (EDT) Received: from phl-imap-02 ([10.202.2.81]) by phl-compute-01.internal (MEProxy); Tue, 31 Mar 2026 09:21:34 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgdeftdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegrihhl ohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpe foggffhffvvefkjghfufgtgfesthejredtredttdenucfhrhhomhepfdetrhguuceuihgv shhhvghuvhgvlhdfuceorghruggssehkvghrnhgvlhdrohhrgheqnecuggftrfgrthhtvg hrnhepvdeuheeitdevtdelkeduudetgffftdelteefteevjeevjeeiheefhfejieejfedu necuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpehmrghilhhfrhhomheprghrug domhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqudeijedthedttdejledqfeef vdduieegudehqdgrrhgusgeppehkvghrnhgvlhdrohhrghesfihorhhkohhfrghrugdrtg homhdpnhgspghrtghpthhtohepjedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohep sghpsegrlhhivghnkedruggvpdhrtghpthhtoheprghikhesrghmugdrtghomhdprhgtph htthhopehthhhomhgrshdrlhgvnhgurggtkhihsegrmhgurdgtohhmpdhrtghpthhtohep rghruggsodhgihhtsehgohhoghhlvgdrtghomhdprhgtphhtthhopegvsghighhgvghrsh eskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepgiekieeskhgvrhhnvghlrdhorhhgpdhr tghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: ice86485a:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id D223D700065; Tue, 31 Mar 2026 09:21:34 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ThreadId: ATwkRWXiqgow Date: Tue, 31 Mar 2026 15:21:14 +0200 From: "Ard Biesheuvel" To: "Borislav Petkov" , "Ard Biesheuvel" , "Alexey Kardashevskiy" , "Eric Biggers" Cc: linux-kernel@vger.kernel.org, x86@kernel.org, "Tom Lendacky" Message-Id: In-Reply-To: <991d5e3b-171d-4391-8a1d-b0ca4608ae32@app.fastmail.com> References: <20251010151036.42241-2-ardb+git@google.com> <20260331131655.GAacvJR18jz5J30F8p@fat_crate.local> <991d5e3b-171d-4391-8a1d-b0ca4608ae32@app.fastmail.com> Subject: Re: [PATCH] x86/sev: Remove bogus virtual address check Content-Type: text/plain Content-Transfer-Encoding: 7bit (add Eric back to cc) Please keep Eric on cc - I added him for a reason, thanks. On Tue, 31 Mar 2026, at 15:18, Ard Biesheuvel wrote: > On Tue, 31 Mar 2026, at 15:16, Borislav Petkov wrote: >> On Fri, Oct 10, 2025 at 05:10:37PM +0200, Ard Biesheuvel wrote: >>> From: Ard Biesheuvel >>> >>> The AES-GCM crypto library operates strictly on virtual addresses, and >>> never performs any H/W offload, and so calling virt_addr_valid() is not >>> needed. >>> >>> Cc: Borislav Petkov (AMD) >>> Cc: Tom Lendacky >>> Signed-off-by: Ard Biesheuvel >>> --- >>> arch/x86/coco/sev/core.c | 9 --------- >>> 1 file changed, 9 deletions(-) >>> >>> diff --git a/arch/x86/coco/sev/core.c b/arch/x86/coco/sev/core.c >>> index 9ae3b11754e6..c4e2de3687a9 100644 >>> --- a/arch/x86/coco/sev/core.c >>> +++ b/arch/x86/coco/sev/core.c >>> @@ -2249,15 +2249,6 @@ int snp_send_guest_request(struct snp_msg_desc *mdesc, struct snp_guest_req *req >>> u64 seqno; >>> int rc; >>> >>> - /* >>> - * enc_payload() calls aesgcm_encrypt(), which can potentially offload to HW. >>> - * The offload's DMA SG list of data to encrypt has to be in linear mapping. >>> - */ >>> - if (!virt_addr_valid(req->req_buf) || !virt_addr_valid(req->resp_buf)) { >>> - pr_warn("AES-GSM buffers must be in linear mapping"); >>> - return -EINVAL; >>> - } >>> - >>> guard(mutex)(&snp_cmd_mutex); >>> >>> /* Check if the VMPCK is not empty */ >>> -- >> >> This came from: >> >> 7ffeb2fc2670 ("x86/sev: Document requirement for linear mapping of >> guest request buffers") >> >> and there was some speculation about the potential of using a crypto >> accelerator which wants addresses in linear mapping... >> > > Sure, but that speculation was entirely misguided, so we can remove this again.