Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1087866pxb; Wed, 6 Apr 2022 08:25:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzPdTDjD+OZMLZ+EmEHwLcwoiZ6YaHtehHkr2wcjenIKImmofqSK5hSJD8XwZfMibmKK0Ab X-Received: by 2002:a17:90a:7:b0:1c7:c286:abc2 with SMTP id 7-20020a17090a000700b001c7c286abc2mr10583026pja.65.1649258745308; Wed, 06 Apr 2022 08:25:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649258745; cv=none; d=google.com; s=arc-20160816; b=aSR3egi1Pt1A9dE4FzeCe/gW/uWXFJTMjo2n//1TkayR5DSY6oKINOeeOGxsNYREtm Eus7ZxfL1sLFLC9JgkKmJbip3CDZALvLlsLoPV5Prdz8m8Zpj9l1H/Y0pghZpPCFydWt S9kTuFt113oU7RLBfFMnTenedSlRe9UmwubnCSHDDf4mkDIxFKWR28kmPMBGaOqlKHLQ ESqsCdmfYGfm8aIhqtJa/QnjHhKiNKZBe7RXJm1ZpK6oVYRaDhBl1jilbrkpkHE50N9o gNk1ojRBuW4Kzhwj5mJVBnjK+LR/TiA+M+TMRwHZfhMoJ95Ua5MemxZrxNhNIoShl4LG 0YWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=3vKQ/ZVzxfXbePR2//ZrAeMd9kL5Wm3IAoof07rWBI0=; b=Uglw5C3NU0Cgh+96a84L56bXrhsaMXuHQat59CcGZGrIfC6aGTj6NrkZWE6w1T+w82 W7nqUdVByWXRHw5jKTWl+qA26X4Bd/Se7n1YE+Gq1hOd7zIA+8wGPgsQXJP31ElVLznj PdkQ/H5VmzbDzm0kZ+TAVBOALn7mVxTGhDSxVV7GiL6GwKzKq5fF7KvYZ+jjjrTZEjWk 6iLqjdUzjq7lWS1ith/G9+3QAlwoMCh6wP9PtluggLXyD60Z3OSW1WXtFspIeQXy6+8n j1uevEaoer3w2t0zFJ3rw0Lnm7IhCWDiccVrUOeagjN4skXRDZsVnphoyQes/qPbp9mh P1iw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id f5-20020a6547c5000000b003816cf17c43si16180947pgs.554.2022.04.06.08.25.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 08:25:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 52AA62993CA; Wed, 6 Apr 2022 06:31:21 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233527AbiDFNdO (ORCPT + 99 others); Wed, 6 Apr 2022 09:33:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230203AbiDFNcH (ORCPT ); Wed, 6 Apr 2022 09:32:07 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8748A6799A4 for ; Wed, 6 Apr 2022 03:31:49 -0700 (PDT) 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 5C97C23A; Wed, 6 Apr 2022 03:22:13 -0700 (PDT) Received: from FVFF77S0Q05N (unknown [10.57.10.98]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1A93D3F718; Wed, 6 Apr 2022 03:22:10 -0700 (PDT) Date: Wed, 6 Apr 2022 11:22:07 +0100 From: Mark Rutland To: Tong Tiangen Cc: Andrew Morton , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , Catalin Marinas , Will Deacon , Alexander Viro , x86@kernel.org, "H. Peter Anvin" , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Vincenzo Frascino Subject: Re: [RFC PATCH -next V2 2/7] arm64: fix page_address return value in copy_highpage Message-ID: References: <20220406091311.3354723-1-tongtiangen@huawei.com> <20220406091311.3354723-3-tongtiangen@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220406091311.3354723-3-tongtiangen@huawei.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 06, 2022 at 09:13:06AM +0000, Tong Tiangen wrote: > Function page_address return void, fix it. > > Signed-off-by: Tong Tiangen This looks like a sensible cleanup, but the commit title and message aren't that clear. Can you please make this: | arm64: fix types in copy_highpage() | | In copy_highpage() the `kto` and `kfrom` local variables are pointers to | struct page, but these are used to hold arbitrary pointers to kernel memory. | Each call to page_address() returns a void pointer to memory associated with | the relevant page, and copy_page() expects void pointers to this memory. | | This inconsistency was introduced in commit: | | 2563776b41c31908 ("arm64: mte: Tags-aware copy_{user_,}highpage() implementations") | | ... and while this doesn't appear to be harmful in practice it is clearly wrong. | | Correct this by making `kto` and `kfrom` void pointers. | | Fixes: 2563776b41c31908 ("arm64: mte: Tags-aware copy_{user_,}highpage() implementations") With that: Acked-by: Mark Rutland Thanks, Mark. > --- > arch/arm64/mm/copypage.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/arm64/mm/copypage.c b/arch/arm64/mm/copypage.c > index b5447e53cd73..0dea80bf6de4 100644 > --- a/arch/arm64/mm/copypage.c > +++ b/arch/arm64/mm/copypage.c > @@ -16,8 +16,8 @@ > > void copy_highpage(struct page *to, struct page *from) > { > - struct page *kto = page_address(to); > - struct page *kfrom = page_address(from); > + void *kto = page_address(to); > + void *kfrom = page_address(from); > > copy_page(kto, kfrom); > > -- > 2.18.0.huawei.25 > > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel