Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp952943ybm; Wed, 27 May 2020 12:03:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyAXDrirf3R2sSJDZ7h5aXmwzt0O0sHL8+9hYNTO/we2mFmbEDOgv7kbAY02tqW4aLWY+qB X-Received: by 2002:a17:906:9243:: with SMTP id c3mr2848382ejx.400.1590606190507; Wed, 27 May 2020 12:03:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590606190; cv=none; d=google.com; s=arc-20160816; b=c5mw5SLaL7b9zDrvXhBNvqNSzClRfsR162LMnHxalmod7yktofPlIJvY0o/0kEyJS/ 9iukCL0LO9uM38WDIyAZS62XXv8nqzhD2dWCirwHgcfHvw3y9pjehaM9ILnk45y247qF HWGOMF+e012ADVTITdXScpLpVk5sWOgmPaBLug5TQSNSiHkAYlAMsPU2rpA9xeKRYEAg O5OLl1LN0C+AU0IyTjkG32j7tfsbD4Gp6A2HkNHmXFmmxCjpAbW9w2eWpQOr+TFYG7dh Cn6yi3Shsb95L4iAy4z4JLpAUzVOQQvEU+KdE/0mHBf4WQXvj0LG0ojPDSJm1A0KkBm3 +ZpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=tvCKL61qCBKMqeavUVHwNQpmt23pRd+wlyHXaav6dc0=; b=MSQ3+mCv/73pW6EmDgYl3l3DZu8TRfH1pibaSpmIZ67eAWxF2w86/KVg8Rm5LGYSjm Utp/+6HNKEJI3fiA3eTvtZ/L43hFOcBt3qMmDS0xdI8Mc4FeaM10PLUSpq5f26STQL4y gQ5uR+Hk0qSOha+2Os4BTKbTAd8tKRwKQpNEGr9hShtLdCmr82Cso7caTHfbpzCT45xE 1lwJy1cvnmsrrjggilhzjH+gEBfCXNpt5ArIHslaZ4fNNVztYIS4lf+ZexR2+HlmK93k r/cGXI3LyGY6OY8lXfKEVuJ2XCK+WWrVLm4tGaMfYJNC652TIgOFiYVhpCFvn5/qzOw8 cRIg== 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 bc15si2210930edb.334.2020.05.27.12.02.48; Wed, 27 May 2020 12:03:10 -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 S2390684AbgE0Pzb (ORCPT + 98 others); Wed, 27 May 2020 11:55:31 -0400 Received: from foss.arm.com ([217.140.110.172]:40716 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390665AbgE0Pza (ORCPT ); Wed, 27 May 2020 11:55:30 -0400 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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