From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9A4DC433DF for ; Wed, 27 May 2020 15:15:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C8F8C2078C for ; Wed, 27 May 2020 15:15:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389414AbgE0PPW (ORCPT ); Wed, 27 May 2020 11:15:22 -0400 Received: from mx2.suse.de ([195.135.220.15]:34918 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388922AbgE0PPW (ORCPT ); Wed, 27 May 2020 11:15:22 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 2574CAE91; Wed, 27 May 2020 15:15:23 +0000 (UTC) Subject: Re: [PATCH 1/2] x86: mm: ptdump: Calculate effective permissions correctly To: Steven Price Cc: Andrew Morton , Andy Lutomirski , Borislav Petkov , Dave Hansen , Ingo Molnar , Peter Zijlstra , Thomas Gleixner , x86@kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org References: <20200521152308.33096-1-steven.price@arm.com> <20200521152308.33096-2-steven.price@arm.com> From: Jan Beulich Message-ID: <5a7fc0d5-14c5-d263-daf1-bf81da30d91e@suse.com> Date: Wed, 27 May 2020 17:15:17 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200521152308.33096-2-steven.price@arm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21.05.2020 17:23, Steven Price wrote: > By switching the x86 page table dump code to use the generic code the > effective permissions are no longer calculated correctly because the > note_page() function is only called for *leaf* entries. To calculate the > actual effective permissions it is necessary to observe the full > hierarchy of the page tree. > > Introduce a new callback for ptdump which is called for every entry and > can therefore update the prot_levels array correctly. note_page() can > then simply access the appropriate element in the array. > > Reported-by: Jan Beulich > Fixes: 2ae27137b2db ("x86: mm: convert dump_pagetables to use walk_page_range") > Signed-off-by: Steven Price This (with the later correction) and the 2nd patch Tested-by: Jan Beulich It allowed me to go and finally find why under Xen there was still a single W+X mapping left - another bug, another patch. Thanks, Jan