Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp863317ybh; Tue, 10 Mar 2020 09:38:45 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuaQLpNcqbBcp2zhCpUNnyd3MJBsCOt0gAPyZnO4aXDbNwIJrjFmpDqlryLvNbKrW0E+YO2 X-Received: by 2002:aca:a94a:: with SMTP id s71mr1743338oie.152.1583858325756; Tue, 10 Mar 2020 09:38:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583858325; cv=none; d=google.com; s=arc-20160816; b=KlmW7OknT0JXpzm2ESTi5AYpzQguIJP9cjV9YvGcJ4LlBxtyrLXrSRJ4crNu1N0Smy k4gIATVP7Wg8bQGhGT0Kux8xh1zBeCcLZWRey8CZGCslkOM5Wa0mDQHqLoGBa5hTrgEe kY+gSUEJKahEgKGK0Zf4HFHZEFtr6cxrkmZ0d0bI7el8dEdxIbvcolxInTB3oobv2Bzw f3l0yoxC2r4wYYvWCJl/o/PqU8HvllbOk8CWU3PKyLeStRGRC3LKHf4ZORUnzwOBam19 1xiUfBv9E7aeJt/qbldeXhbPL6H+rlKswU6KAk42aZKPjVhXJY1B/pqqWLyPohaZ46XD f/yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=6WsP7J52kSHVDsNtaPW0KbXpQ88k9vu03UTfCPSXnlY=; b=D+HaZiOtO3ZZuJG4tpmkrpy//6YgzIZ7gOaCsu7UUnmK5H7xkpRyWEKOTzYDO8Qz7n zU07BtJFPmEEttGb0EF1CPJFjqqGdGd7LZDboPm9w6/90Uhk9LR4XCxaT4gtInJRV7hd c5U3nORzyQQyXuPwrLhdnx3r/7AiBwUCKFyIBswdSXgjm3J/vBxVXoziD8J/RjcpNdKJ RoOgehiD6lx0krK97IQdnb2a6Ej04/uflMe6cl8uEk/JPb4wBQfOG8FZc916zKE3crn7 NeOYRs235HT3NfinSklxxrNCC4MNtkLnrRUG3Af0t17tTgiTe6RnWIGsulim2QNhHPyr DNiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=FtqB4s91; 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=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c23si7588227oto.22.2020.03.10.09.38.31; Tue, 10 Mar 2020 09:38:45 -0700 (PDT) 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=@alien8.de header.s=dkim header.b=FtqB4s91; 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=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726861AbgCJQhj (ORCPT + 99 others); Tue, 10 Mar 2020 12:37:39 -0400 Received: from mail.skyhub.de ([5.9.137.197]:50720 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726271AbgCJQhj (ORCPT ); Tue, 10 Mar 2020 12:37:39 -0400 Received: from zn.tnic (p200300EC2F09B400F44F66F0FEFB445E.dip0.t-ipconnect.de [IPv6:2003:ec:2f09:b400:f44f:66f0:fefb:445e]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 737C71EC0CDF; Tue, 10 Mar 2020 17:37:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1583858257; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=6WsP7J52kSHVDsNtaPW0KbXpQ88k9vu03UTfCPSXnlY=; b=FtqB4s91xzciK1Uf1CxdIJS3/K5xtCbH77hWu11JcqrUUnB/e1VC2QUtv6qnVsDmJxonHq eOZzPTjIhx9TZCQjcc0ZRAzDlfoxt1orycRlfUI8MG3m1lwHn+nI0QXMeXivioKxwHtQZM qJESkKgoNV2OT9hlc2Jfs8iaEpG7XAM= Date: Tue, 10 Mar 2020 17:37:38 +0100 From: Borislav Petkov To: Joerg Roedel Cc: Tom Lendacky , linux-kernel@vger.kernel.org, x86@kernel.org, Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Bruce Rogers Subject: Re: [PATCH] x86/ioremap: Map EFI runtime services data as encrypted for SEV Message-ID: <20200310163738.GF29372@zn.tnic> References: <2d9e16eb5b53dc82665c95c6764b7407719df7a0.1582645327.git.thomas.lendacky@amd.com> <20200310124003.GE29372@zn.tnic> <20200310130321.GH7028@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200310130321.GH7028@suse.de> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 10, 2020 at 02:03:21PM +0100, Joerg Roedel wrote: > See the comment added in the patch, walk_mem_res() does not iterate over > the resource which contains EFI_RUNTIME_SERVICES_DATA, so > __ioremap_check_encrypted() will not be called on that resource. > > walk_system_ram_range() might do the job, but calling it only for > EFI_RUNTIME_SERVICES_DATA has some overhead. Ok, then. Let's wrap this in a new function which is called at the end of __ioremap_check_mem() instead of trying to map EFI_RUNTIME_SERVICES_DATA to IORES_DESC types and match the flags just so that we can preserve the flow. And add a comment above it why we're doing this. As you said on IRC, none of the IO resource ranges covers the EFI_RUNTIME_SERVICES_DATA. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette