Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1067415pxu; Thu, 8 Oct 2020 02:23:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCYnjiFkee53WuT4S26dUrXEiQAtHues299t1REs6OGMWTiyvMNJ4KSN3YLyu6URoSe2i+ X-Received: by 2002:a50:9b1d:: with SMTP id o29mr8131324edi.56.1602148980253; Thu, 08 Oct 2020 02:23:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602148980; cv=none; d=google.com; s=arc-20160816; b=o2EJXnyeQJMLfM6ylrevhmw/tSzc93jTJlm3i6n+32VJ3q4bzZaQ11ZnKgt4GgEKx5 4XnEmOOaeDtenve/P4bGL6GGjkrK5ZISgkl1C/MqesxjNp3HvRnaCi4oH6jM6fN5Fu9y jCBzHisC1u6Dfs8dYCkQErittXtTgHwLUot/yUw7EHq69vm5uZwEBRu4Bq8V9nivSuCd hyNcwJh3gXvEcG+UKiiU98WTjmncfRs6k3muCFENc9wd2CZtxAsM50SlR2xql4v4CivX 5E6gpsYFBZgzBClwGhKJ0Vs9SMoneKBP6EFLH2Xu5PRwcLtGPrgLvDutPof2LtXimJ/s 8wZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=KScU1yL/dR2kF7uRJhDCzhpcuA4ocy/ZA+Ns2Fgvd9U=; b=BWTyetV7q3AEGE/HuGe9HUnGkRoR1ylt3lkJ8mTbOewcl4A2742Oh+bF3ZjWg4qwZP +u8dMo/Kas3Ai6vU43NBSvyfM7jimI4Fp7JehoGugES60v6Kk/Go/jfc9x628ISISfGl ZoowxoEdu0JDyFA+PEbNrXO+VbFnGbdt9AudCPnZa7oSfRL0eIuLj2fjlixXlXepGKbF Jbffx/woPMfBL1f+X9Xx3xYlZb8PV7JP44WTVGdzPXhoRKmpdk4FLdxQ74mKMXInGzXe j6YqmGsvtXgcHyzz+ro/wCbgz8Nm0teLgonDt4rOwG5ogm86WJ5BJxXuqjNEKr5wI7DO ekxw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h12si1356067edn.339.2020.10.08.02.22.36; Thu, 08 Oct 2020 02:23:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728944AbgJHJOP (ORCPT + 99 others); Thu, 8 Oct 2020 05:14:15 -0400 Received: from mx2.suse.de ([195.135.220.15]:41406 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725845AbgJHJOO (ORCPT ); Thu, 8 Oct 2020 05:14:14 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id A7253ACB8; Thu, 8 Oct 2020 09:14:13 +0000 (UTC) Date: Thu, 8 Oct 2020 11:14:12 +0200 From: Joerg Roedel To: Arvind Sankar Cc: x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/5] x86/boot/64: Change add_identity_map() to take size for ease of use Message-ID: <20201008091412.GF3209@suse.de> References: <20201007195351.776555-1-nivedita@alum.mit.edu> <20201007195351.776555-4-nivedita@alum.mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201007195351.776555-4-nivedita@alum.mit.edu> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 07, 2020 at 03:53:49PM -0400, Arvind Sankar wrote: > Change back the arguments of add_identity_map() to (start, size) instead > of (start, end). This reverts > > 21cf2372618e ("x86/boot/compressed/64: Change add_identity_map() to take start and end") > > since we will soon have more callers that know the size rather than the > end address. > > This also makes the #PF handler print the original CR2 value in case of > error, instead of after aligning to PMD_SIZE. > > Signed-off-by: Arvind Sankar > --- > arch/x86/boot/compressed/ident_map_64.c | 11 ++++------- > 1 file changed, 4 insertions(+), 7 deletions(-) > > diff --git a/arch/x86/boot/compressed/ident_map_64.c b/arch/x86/boot/compressed/ident_map_64.c > index 063a60edcf99..070cda70aef3 100644 > --- a/arch/x86/boot/compressed/ident_map_64.c > +++ b/arch/x86/boot/compressed/ident_map_64.c > @@ -90,8 +90,9 @@ static struct x86_mapping_info mapping_info; > /* > * Adds the specified range to the identity mappings. > */ > -static void add_identity_map(unsigned long start, unsigned long end) > +static void add_identity_map(unsigned long start, unsigned long size) > { > + unsigned long end = start + size; This has been discussed during the SEV-ES patch-review already and we settled on making add_identity_map() take start and end as parameter, as that is what kernel_ident_mapping_init() also takes as parameters. So please keep it that way :) Regards, Joerg