Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3020905rwb; Mon, 15 Aug 2022 16:18:03 -0700 (PDT) X-Google-Smtp-Source: AA6agR4BIEb78g/emQa5fCczabgT5ie6tCCefyFFCzQtUnxANecqAbFTaj0INm2VwqCxvUQ4qHUc X-Received: by 2002:a63:54c:0:b0:41b:ff8a:e035 with SMTP id 73-20020a63054c000000b0041bff8ae035mr14964188pgf.504.1660605483338; Mon, 15 Aug 2022 16:18:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660605483; cv=none; d=google.com; s=arc-20160816; b=yZJWQcSbpycfphycDH+jXZyV866SbSZF5FmRBbn3C5Lpug3fD4Cc5AauUXz2JhLcQH DXdduHSUKuCEx489fYfDe+r/hwZo9TnZlnK7ehkfWYl0zuypIdjYfoUmvYHMrzcnPt5t a81f8Gd1JDX3gW8jqUo9kV02io6YoiU6DRDgcOi009XV3WXAozLI5Xz6lGqlVj2WykFM OKFElhUkVJaMObhk8pr7xtr/XOxLEnzzaz3FJCbxuTafHNiItk6T6PZDtpYl7U7dEJkC zgHrwbvmNhdhrNAAINMoeUZhp2aD9wb0rabFC9YKAYllbHIHGILvQ1cgm+e5DYswoqHB GSdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=mJ6Z7ROElFi0pug3141/cZmt8zb9UmMy3AVBef/xAU4=; b=D1bkAU01KuudcZwK+KzGbvvZO2rW4PXRxrqVnN7k711kPhaungkCJFy1rOCXr9VKx2 h+y6p0MppoUDm39057KV77o5HCCNhBB0OOTDOegcNTlcOR5Olzil6hWOQ+ximVKZw4RH P1UwawN08Agw2JXaFKTvJxX5vuaSFb+PNscN1hoJZbdEkzePtsyqpCndcKb4spKp5AQE yigwkbB3tbmlHQ8ODB14k6jGgYNBQe4mX5arInXjWCtrs/vQtLUl3qBcRE+n8KWjlnCC +p6eM/PMdMm3/TvLtMAwclpMK5pnmGPLBTzd8SDiTrPOSj+4EkALXmZyYmbHhJFsiye7 vdPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Tug0/G+4"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v20-20020a170902f0d400b0016f002733e3si10460801pla.497.2022.08.15.16.17.52; Mon, 15 Aug 2022 16:18:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Tug0/G+4"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351045AbiHOWlN (ORCPT + 99 others); Mon, 15 Aug 2022 18:41:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350689AbiHOWgw (ORCPT ); Mon, 15 Aug 2022 18:36:52 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB9301256CB; Mon, 15 Aug 2022 12:50:26 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id B984960FD8; Mon, 15 Aug 2022 19:49:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AA4EEC433C1; Mon, 15 Aug 2022 19:49:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660592981; bh=qV18CXrqDsPNUqyyYXpbc7vK2XRoYEx8HCVgIpmxHzs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Tug0/G+4FZYzPQwoscaKg/Xj211j7DwQVzy7GEvl0cXB4AawNy6+HJvi/Vjtq7ljN yrDJ/fS6d5X7pxGJ/Qi0ncAY8j6ZlVOJRmU0/4he7ZX1M8MrmjFWdF74ZVXBnw6lcw W8RkfI9S7D4UvMCFSt/nQxzuD4kiVqfA/LvrovLI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Greg Ungerer , Serge Semin , Florian Fainelli , Thomas Bogendoerfer , Sasha Levin Subject: [PATCH 5.18 0875/1095] MIPS: vdso: Utilize __pa() for gic_pfn Date: Mon, 15 Aug 2022 20:04:34 +0200 Message-Id: <20220815180505.557973427@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 From: Florian Fainelli [ Upstream commit 8baa65126e19af5ee9f3c07e7bb53da41c39e4b1 ] The GIC user offset is mapped into every process' virtual address and is therefore part of the hot-path of arch_setup_additional_pages(). Utilize __pa() such that we are more optimal even when CONFIG_DEBUG_VIRTUAL is enabled, and while at it utilize PFN_DOWN() instead of open-coding the right shift by PAGE_SHIFT. Reported-by: Greg Ungerer Suggested-by: Serge Semin Fixes: dfad83cb7193 ("MIPS: Add support for CONFIG_DEBUG_VIRTUAL") Signed-off-by: Florian Fainelli Acked-by: Greg Ungerer Tested-by: Greg Ungerer Signed-off-by: Thomas Bogendoerfer Signed-off-by: Sasha Levin --- arch/mips/kernel/vdso.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/kernel/vdso.c b/arch/mips/kernel/vdso.c index 3d0cf471f2fe..b2cc2c2dd4bf 100644 --- a/arch/mips/kernel/vdso.c +++ b/arch/mips/kernel/vdso.c @@ -159,7 +159,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) /* Map GIC user page. */ if (gic_size) { gic_base = (unsigned long)mips_gic_base + MIPS_GIC_USER_OFS; - gic_pfn = virt_to_phys((void *)gic_base) >> PAGE_SHIFT; + gic_pfn = PFN_DOWN(__pa(gic_base)); ret = io_remap_pfn_range(vma, base, gic_pfn, gic_size, pgprot_noncached(vma->vm_page_prot)); -- 2.35.1