Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp3662034imd; Mon, 29 Oct 2018 10:22:33 -0700 (PDT) X-Google-Smtp-Source: AJdET5d5+bYJ0e3XDhUWM6R6Op9iSDYfaF3gdX/3lhBbcprsX+Gp8EjIRZD402bn4oNPEE7o0ZuL X-Received: by 2002:a63:f91e:: with SMTP id h30-v6mr14690437pgi.154.1540833753319; Mon, 29 Oct 2018 10:22:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540833753; cv=none; d=google.com; s=arc-20160816; b=OBMe9OoXsVcJR+0Y6foyqwaAu96lVP9nfUamYzNisI8k9KFC+D8cyt5iHaCXT6mKXF 73jUG19IrYjDlU0dUZYI73bWOYm585uEXzNQFmzoWC8KgVkxfi9nSL6EwzHgJMRExcX6 R113gi8efPEvICJZUSVG8OlgTpZIdNPoeaAG9452GRgip5dA8C7vlqeRTsGFftJf9qma 3Sgbm9Ax7W70RhuFS8HME2ZjszAEuMjpAsgq4RTT01zW/iionYyaDVglK8tAFhBgV892 uAy4csG0exuaQosAFgYFFbE4MkBr8osejHwqy1azKmJApTjd+eA566qPdnDSCWPjTfxY 7OWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=hSJP+CFRQhsJB51v9d09bqERkDI2pWeRDKKqlbxTffo=; b=WIwyPrnyiGuEgbnEu8ZZ2VEr2QE9h3n+h0Oo0Uk9kWeMPxeujE1hRwTvdFhr4m+kY7 C/WpNL8g+gHMUHFQy1ex8oBlOmO9GP9h/ApS4gBeI6dMk5D2A75CQs90yOcsNl3T5Lsh 5g5HG3vWgvzkd8AwizZ0PqKXJKbX1aSGiusZO/lUFUiAAE9cMX/eFeOzJNCgsMB/TV9e sM0pONDsL1xfZM/HQ0dwFSWG9/ihC1io7V5RZfiso9ZHmuD83VxgSSun7+rODi2rx0fg rHqkCf/yj/T2RA4BA9MzcgVybDWZo7b7cg1MVKzQqT1yAvdkGoJ5QpvgATD0Nl43zZpp mPcQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t2-v6si19706453pge.276.2018.10.29.10.22.14; Mon, 29 Oct 2018 10:22:33 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726721AbeJ3CLT (ORCPT + 99 others); Mon, 29 Oct 2018 22:11:19 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:52446 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726311AbeJ3CLS (ORCPT ); Mon, 29 Oct 2018 22:11:18 -0400 Received: from tmo-115-37.customers.d1-online.com ([80.187.115.37] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1gHBEU-0007lf-QF; Mon, 29 Oct 2018 18:21:43 +0100 Date: Mon, 29 Oct 2018 18:21:41 +0100 (CET) From: Thomas Gleixner To: Sai Praneeth Prakhya cc: linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org, Borislav Petkov , Ingo Molnar , Andy Lutomirski , Dave Hansen , Bhupesh Sharma , Peter Zijlstra , Ard Biesheuvel Subject: Re: [PATCH V2 1/2] x86/efi: Unmap EFI boot services code/data regions from efi_pgd In-Reply-To: Message-ID: References: <20181026213845.28166-1-sai.praneeth.prakhya@intel.com> <20181026213845.28166-2-sai.praneeth.prakhya@intel.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sai, On Mon, 29 Oct 2018, Thomas Gleixner wrote: > On Fri, 26 Oct 2018, Sai Praneeth Prakhya wrote: > > > > +int kernel_unmap_pages_in_pgd(pgd_t *pgd, unsigned long address, > > + unsigned long numpages) > > +{ > > + int retval; > > + > > + /* > > + * The typical sequence for unmapping is to find a pte through > > + * lookup_address_in_pgd() (ideally, it should never return NULL because > > + * the address is already mapped) and change it's protections. > > + * As pfn is the *target* of a mapping, it's not useful while unmapping. > > + */ > > + struct cpa_data cpa = { > > + .vaddr = &address, > > + .pgd = pgd, > > + .numpages = numpages, > > + .mask_set = __pgprot(0), > > + .mask_clr = __pgprot(_PAGE_PRESENT | _PAGE_RW), > > + .flags = 0, > > + }; > > + > > + retval = __change_page_attr_set_clr(&cpa, 0); > > + __flush_tlb_all(); > > So this looks like you copied it from kernel_map_pages_in_pgd() which has > been discussed before to be not sufficient, but it can't be changed right > now due to locking issues. Managed to confuse myself. The place which cannot be changed is a different one, but still for your call site __flush_tlb_all() might not be sufficient. Thanks, tglx