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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 92F4BC61DA3 for ; Thu, 26 Jan 2023 20:39:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E12606B0074; Thu, 26 Jan 2023 15:39:07 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D9B458E0001; Thu, 26 Jan 2023 15:39:07 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C3C056B0078; Thu, 26 Jan 2023 15:39:07 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id AD9906B0074 for ; Thu, 26 Jan 2023 15:39:07 -0500 (EST) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 6DFA0C0F90 for ; Thu, 26 Jan 2023 20:39:07 +0000 (UTC) X-FDA: 80398114734.12.A839823 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf21.hostedemail.com (Postfix) with ESMTP id 207CC1C0008 for ; Thu, 26 Jan 2023 20:39:04 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b="03/Rs4Nq"; dmarc=none; spf=pass (imf21.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1674765545; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ranIpOYEIR5yFVJoKsghUbEA2XNGpvuR19ZOhESK5Ds=; b=agsK8jkgO4y8jZYyHp+kE9vhBoJdgS5egf4jckCspiHPI8QMUqhxzU+3TYy5nxRBZCHFXy 51bK73APYsq09z1umYAq3dgh3rrWOGfT4QfIwlbO7eFNzlUeJHpM1KjnmaLFbjA/4D+QOL NnOKH0HFRZamD8t3EUfdXFierIF7S/o= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b="03/Rs4Nq"; dmarc=none; spf=pass (imf21.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1674765545; a=rsa-sha256; cv=none; b=uZ0ib79/VGa4YV36/R8MFppEvYhWeHO2vuljw2Es0Cs+p+2Ok5XD39IYg5BruHn0+vmwD4 gPtaP9541VKoawTVC0eWbl1GYXwfl1Mz9o3TPHTVdHqr0rE75cAQLxeykQr2VZ/+jrOT4f do1Z0dOjpI+1D3ORKGNI7+SkuWAeLfs= Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id A288DCE2595; Thu, 26 Jan 2023 20:39:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7F90FC433EF; Thu, 26 Jan 2023 20:38:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1674765539; bh=eqCm1yGf+yfktl0RDMe042s02iMXVNx/WsE1kqwweJk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=03/Rs4NqdOvG8k51Xy1Ddo7iNB2UHGqimSa4IDuaWsW575lmMkFEMbLJBaEfSvP3B PTvunZQwaQObaUNpWnAlq5lZtYduS054WH38K4VA0JnA90K9DRovq+BUiq/bClvkxi 7j2hYHNmCb4nC0hMitC7HDb0s5t2s0n5MpaGXKJo= Date: Thu, 26 Jan 2023 12:38:58 -0800 From: Andrew Morton To: "Fabio M. De Francesco" Cc: Ira Weiny , Sebastian Andrzej Siewior , Alexander Potapenko , Andrey Konovalov , Tony Luck , Bagas Sanjaya , David Sterba , Kees Cook , "Matthew Wilcox (Oracle)" , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Thomas Gleixner , Al Viro , Helge Deller Subject: Re: [PATCH] mm/highmem: Align-down to page the address for kunmap_flush_on_unmap() Message-Id: <20230126123858.42d9377ad6e352a58c81668b@linux-foundation.org> In-Reply-To: <20230126143346.12086-1-fmdefrancesco@gmail.com> References: <20230126143346.12086-1-fmdefrancesco@gmail.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 207CC1C0008 X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: roquexfigjawgusuxkzpi5nyedzcuq6d X-HE-Tag: 1674765544-998493 X-HE-Meta: U2FsdGVkX1/VBgAXjLVAzmfaW1MbYKg5qCJ6FX9mKiV0r8/QS/7w1hRf3Gb5iUV9ERDPCmayatjkTFctGnazuGvEwmu9XXddDUtTV9l0BukNvA9cQd0Kw034JWwSGaCr8eXHj9nH1Hp5TENu/crvPTx4wFp0xWf5gxqIUoXhpkLkiWwq1MZA/xzu/V6Iob/dmoI4/5Abuv5b8OTCbYoY/w4Pb7mlqKI9CRw4IvpdtyQ3ScCyzTYs0zUzok4zv1OwPfvV1h0avZwwRoE7rZopxZr8sPfrWc5fMlqBY47BOTEpbul/mTnP8BWsjXf69irPAayN3FZCugaiZ6NX6OGi+uakctqK7h1wMtAfx1af5fskrgapfNwvs5l+4fO++ekM1IX0sekbqs5YQ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FsLXDDaIQVLQgSunItbDH03MZlOX3lpS5N6TKlbbocBv5tY4J1RG3y6L9xDM8drUzrA+ex/j/S8g== 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 Thu, 26 Jan 2023 15:33:46 +0100 "Fabio M. De Francesco" wrote: > If ARCH_HAS_FLUSH_ON_KUNMAP is defined (PA-RISC case), __kunmap_local() > calls kunmap_flush_on_unmap(). The latter currently flushes the wrong > address (as confirmed by Matthew Wilcox and Helge Deller). Al Viro > proposed to call kunmap_flush_on_unmap() on an aligned-down to page > address in order to fix this issue. Consensus has been reached on this > solution. What are the user-visible runtime effects of this flaw? > Therefore, if ARCH_HAS_FLUSH_ON_KUNMAP is defined, call > kunmap_flush_on_unmap() on an aligned-down to page address computed with > the PTR_ALIGN_DOWN() macro. > > Cc: Ira Weiny > Cc: Thomas Gleixner > Suggested-by: Al Viro > Confirmed-by: Helge Deller > Confirmed-by: Matthew Wilcox > Fixes: f3ba3c710ac5 ("mm/highmem: Provide kmap_local*") > Signed-off-by: Fabio M. De Francesco > --- > > I have (at least) two problems with this patch... > > 1) checkpatch.pl complains about the use of the non-standard > "Confirmed-by" tags. I don't know how else I can give credit to Helge > and Matthew. However, this is not the first time that I see non-standard > tags in patches applied upstream (I too had a non-standard > "Analysed-by" tag in patch which fixes a SAC bug). Any objections? Add a paragraph "this was confirmed by X and Y", then add Cc:X, Cc:y? This gives you an opportunity to tell us what "confirmed" actually means! Did they confirm that it's a bug? Or that the fix is correct? I dunno. > 2) I'm not sure whether or not the "Fixes" tag is appropriate in this > patch. Can someone either confirm or deny it? > > include/linux/highmem-internal.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/linux/highmem-internal.h b/include/linux/highmem-internal.h > index 034b1106d022..e247c9ac4583 100644 > --- a/include/linux/highmem-internal.h > +++ b/include/linux/highmem-internal.h > @@ -200,7 +200,7 @@ static inline void *kmap_local_pfn(unsigned long pfn) > static inline void __kunmap_local(const void *addr) > { > #ifdef ARCH_HAS_FLUSH_ON_KUNMAP > - kunmap_flush_on_unmap(addr); > + kunmap_flush_on_unmap(PTR_ALIGN_DOWN(addr, PAGE_SIZE)); > #endif > } > > -- > 2.39.0