Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1097129yba; Tue, 2 Apr 2019 02:08:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqyQc4vE/UlGAjc31Yhd/i/YusBVunXMnJ5MLfCuOaRSBEsu8Hh6L7uVqcuG6Vh03noSHMAy X-Received: by 2002:a17:902:b715:: with SMTP id d21mr40520287pls.103.1554196099795; Tue, 02 Apr 2019 02:08:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554196099; cv=none; d=google.com; s=arc-20160816; b=g4YvluHsV9NGMoNmxmdDOFY5T3USja0K7DWcQgt7HcN8x8OfgPLLS8lZ2PokkfKf3E wKf+r01vzj5dynBfh13wtX2/Akd+/UN7cEJAaMWI7A3UL7kmNrR7qNxTfYHYRSlAhB1o SABLpal3VoY49s+G5zMb5LaDUYsPDOTB0RRJFxUruI//oL5racvjWbUI1cKaK89MGawp cTDIMDXlg2TwholwnpuGi7JwOHf/NRu4rZrNb6xL8LwvX3SKcr1BVa1p1/WEKeTQ92oJ Z5e4cJOXqIx7atTOOaqaPesOUsQ4tZl9SzNiHNcNU9+EwWny5nQO47ZYFWn9Xz4E8TaG XQ+Q== 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=YbPunoNThQtG8DbuRb2C7sAqGNV3Jbburn+zBS+foUQ=; b=Y3G62U9yVVju11Ot+k7fBJ7q0GYjRo9j9E2E1gM+W3yzEx++yHMh131HfjHzut/Dtj 0Sl4/aFlnPipW/94ztZdIDahg82XqHXoBsWveTjxwZhAL+djukJjRObx4FZ49gsKLO9r XW1akmhJeR3PSuUsr31ul7OfR35JmrYgf4maV2EGgPRDWU9RrVVM7RMurprgDgno1WRA q4+FdNLZkjOfQExL7bv9lfNVeNTWQgfvSSfDx9PBLqV61upKqdWCUVu+1hyEBmGFOBif ZOYJoTr3mMVfsb6P4LSpkevc63epStYo2xrqJQr7GO9FXr8pnsOyjJUemuzuDE69kL0O 4tHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=C45T7SLO; 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 a23si10427349pls.188.2019.04.02.02.08.04; Tue, 02 Apr 2019 02:08:19 -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=C45T7SLO; 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 S1729765AbfDBJG7 (ORCPT + 99 others); Tue, 2 Apr 2019 05:06:59 -0400 Received: from mail.skyhub.de ([5.9.137.197]:52760 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726790AbfDBJG6 (ORCPT ); Tue, 2 Apr 2019 05:06:58 -0400 Received: from zn.tnic (p200300EC2F148A00329C23FFFEA6A903.dip0.t-ipconnect.de [IPv6:2003:ec:2f14:8a00:329c:23ff:fea6:a903]) (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 5571A1EC0669; Tue, 2 Apr 2019 11:06:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1554196017; 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=YbPunoNThQtG8DbuRb2C7sAqGNV3Jbburn+zBS+foUQ=; b=C45T7SLOKAqeIb0bWTxHNbJhUrukMenLFT81UeEXubzZ4m3y6Ix0LSdAHrXv55jZcPPcrm 6A3pxZPumCqW9DgfR28uUedfNAdC1zbdho5QAAbWT02E7ysww3t4Ewxg/wDASam9jDsp9D 3ydXSC4jUziHunXwYEAMd4b2jWNO7io= Date: Tue, 2 Apr 2019 11:06:52 +0200 From: Borislav Petkov To: Lianbo Jiang Cc: linux-kernel@vger.kernel.org, kexec@lists.infradead.org, tglx@linutronix.de, mingo@redhat.com, akpm@linux-foundation.org, dave.hansen@linux.intel.com, luto@kernel.org, peterz@infradead.org, x86@kernel.org, hpa@zytor.com, dyoung@redhat.com, bhe@redhat.com, Thomas.Lendacky@amd.com Subject: Re: [PATCH 1/2 RESEND v10] x86/mm, resource: add a new I/O resource descriptor 'IORES_DESC_RESERVED' Message-ID: <20190402090652.GD6826@zn.tnic> References: <20190329123914.20939-1-lijiang@redhat.com> <20190329123914.20939-2-lijiang@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190329123914.20939-2-lijiang@redhat.com> 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 Fri, Mar 29, 2019 at 08:39:13PM +0800, Lianbo Jiang wrote: > -static int __ioremap_check_desc_other(struct resource *res) > +/* > + * Originally, these areas described as IORES_DESC_NONE are not mapped > + * as encrypted when using ioremap(), for example, E820_TYPE_{RESERVED, > + * RESERVED_KERN,RAM,UNUSABLE}, etc. It checks for a resource that is > + * not described as IORES_DESC_NONE, which can make sure the reserved > + * areas are not mapped as encrypted when using ioremap(). > + * > + * Now IORES_DESC_RESERVED has been created for the reserved areas so > + * the check needs to be expanded so that these areas are not mapped > + * encrypted when using ioremap(). > + */ > +static int __ioremap_check_desc_none_and_reserved(struct resource *res) > { > - return (res->desc != IORES_DESC_NONE); > + return ((res->desc != IORES_DESC_NONE) && Why is this still checking IORES_DESC_NONE when the idea is to have this specific IORES_DESC_RESERVED for all marked as *reserved* regions in e820 which should not be mapped encrypted? IOW, which regions are still marked as IORES_DESC_NONE and should not be mapped encrypted? -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.