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=-10.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,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 79B23C2B9F7 for ; Wed, 26 May 2021 04:23:56 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E0A5A61438 for ; Wed, 26 May 2021 04:23:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E0A5A61438 Authentication-Results: mail.kernel.org; dmarc=fail (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 28E9A6B0036; Wed, 26 May 2021 00:23:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 23E946B006E; Wed, 26 May 2021 00:23:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0DF516B0070; Wed, 26 May 2021 00:23:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0058.hostedemail.com [216.40.44.58]) by kanga.kvack.org (Postfix) with ESMTP id D00146B0036 for ; Wed, 26 May 2021 00:23:54 -0400 (EDT) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id D9058181AEF32 for ; Wed, 26 May 2021 04:23:52 +0000 (UTC) X-FDA: 78182089104.03.BE16D35 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf04.hostedemail.com (Postfix) with ESMTP id C590A2C2 for ; Wed, 26 May 2021 04:23:48 +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 6607A1516; Tue, 25 May 2021 21:23:51 -0700 (PDT) Received: from [10.163.81.152] (unknown [10.163.81.152]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4560D3F73D; Tue, 25 May 2021 21:23:49 -0700 (PDT) Subject: Re: [PATCH 0/1] mm/debug_vm_pgtable: fix alignment for pmd/pud_advanced_tests() To: Gerald Schaefer , Andrew Morton Cc: linux-mm , LKML , linux-arch , linux-sparc , linux-s390 References: <20210525130043.186290-1-gerald.schaefer@linux.ibm.com> From: Anshuman Khandual Message-ID: Date: Wed, 26 May 2021 09:54:32 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20210525130043.186290-1-gerald.schaefer@linux.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Authentication-Results: imf04.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf04.hostedemail.com: domain of anshuman.khandual@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=anshuman.khandual@arm.com X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: C590A2C2 X-Stat-Signature: qnws8ndk4p7kp65naspwyexc47hmsodi X-HE-Tag: 1622003028-72415 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 5/25/21 6:30 PM, Gerald Schaefer wrote: > We sometimes see a "BUG task_struct (Not tainted): Padding overwritten" > on s390, directly after running debug_vm_pgtable. This is because of > wrong vaddr alignment in pmd/pud_advanced_tests(), leading to memory > corruption at least on s390, see patch description. > > At first glance, other architectures do not seem to care about vaddr in > their xxx_get_and_clear() implementations, so they should not be affected. IIRC, alignment (regardless up or down) is the only requirement on certain platforms. Probably it should not affect other platforms as this change just aligns the virtual address down. > One exception is sparc, where the addr is passed over to some tlb_batch > code, but I'm not sure what implication the wrongly aligned vaddr would > have in this case. > > Also adding linux-arch, just to make sure. Right. Not sure if this test gets to run on sparc platform for not being currently supported. But we could take a look if there are any reported problems because of vaddr. > > Gerald Schaefer (1): > mm/debug_vm_pgtable: fix alignment for pmd/pud_advanced_tests() > > mm/debug_vm_pgtable.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >