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=unavailable 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 3B328C433DF for ; Wed, 27 May 2020 16:45:54 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id ED1BC20873 for ; Wed, 27 May 2020 16:45:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ED1BC20873 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 84A50800B6; Wed, 27 May 2020 12:45:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7FA1680010; Wed, 27 May 2020 12:45:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6E89C800B6; Wed, 27 May 2020 12:45:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0103.hostedemail.com [216.40.44.103]) by kanga.kvack.org (Postfix) with ESMTP id 55FB480010 for ; Wed, 27 May 2020 12:45:53 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 1BD541840401D for ; Wed, 27 May 2020 16:45:53 +0000 (UTC) X-FDA: 76863075786.04.quill01_620895e26d53 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin04.hostedemail.com (Postfix) with ESMTP id 06D76820494B for ; Wed, 27 May 2020 15:55:31 +0000 (UTC) X-HE-Tag: quill01_620895e26d53 X-Filterd-Recvd-Size: 2736 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf41.hostedemail.com (Postfix) with ESMTP for ; Wed, 27 May 2020 15:55:30 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7EFE430E; Wed, 27 May 2020 08:55:29 -0700 (PDT) Received: from [192.168.1.84] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E51693F52E; Wed, 27 May 2020 08:55:27 -0700 (PDT) Subject: Re: [PATCH 1/2] x86: mm: ptdump: Calculate effective permissions correctly To: Jan Beulich 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> <5a7fc0d5-14c5-d263-daf1-bf81da30d91e@suse.com> From: Steven Price Message-ID: <9aafccf1-0995-bea5-c814-c8cd9d719d12@arm.com> Date: Wed, 27 May 2020 16:55:26 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <5a7fc0d5-14c5-d263-daf1-bf81da30d91e@suse.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 06D76820494B X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 27/05/2020 16:15, Jan Beulich wrote: > 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 > Thanks for testing (and sorry for breaking it in the first place)! Steve