Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2883642rwb; Mon, 15 Aug 2022 13:15:56 -0700 (PDT) X-Google-Smtp-Source: AA6agR7HuVfih4oD60BCOzziwQkt/gfArhrzkaq2dltMVD864N+zHUMix3S38Hc5Spx4D+zrbY0C X-Received: by 2002:a17:907:d07:b0:72e:ec79:ad0f with SMTP id gn7-20020a1709070d0700b0072eec79ad0fmr11607816ejc.296.1660594555829; Mon, 15 Aug 2022 13:15:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660594555; cv=none; d=google.com; s=arc-20160816; b=Af0gXtg7KBGjsyvvR6hFdjudS+wN2DjtWCwOKD8+JenWg0ed6MzuGA3ssvdA3s2vFS 51TCT7AME1gbVWuONN5/Zo9vvScuc1IXr2P8gp1WFDULgD80jlvilGyiojDshmLiIS1/ xd4oujgQ3Pcwm7he0Wohbt5NCE7fSXk+aKb4MaSSyknF+y0VzoxEOBONlI5+h4VZQHsY wK3oe06nNW37+PJc99WLIkoRjOigc99yNis1mwO6WT1dLY3/7DChXhsQOyy4sRXIhi3q vKP2YE3uY6rataA9RNtW24JH3rS2iKvPWd846t+7M4A+aVKSBUlwgupXwRq5br1yCRyj ZOnQ== 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=XqqQt8Z7rrCD5asLU5ZOfLSJ3YQ/AzAE/1rBP4PBgkFBJ8pLW2s+Xk/7Nzz8Ndfuq2 XtM1b2dBCV2goIk8TIGnBI0v8ETI7QUlwAw3Y2jJjM8rbPEydU9k15Bi2ei4D3QkXFZx KdgPXLDcNdjqOBNMcoXeWMqEYWn929FHoPgUgWLqkP8MwOaVHKRpjDLMTHj61bSaTNYm P3X2g77YAotY+yTFng4X44kGo4VjDRShsiYuBU0ltatGba/MudJdX6NqBdQ+ZHfftQCc Xnk67mgso1GBu+ww3h518nuEWKyxfJWuIWTYksj59emZgR6rlmFV2eIaH1XxRH5kt505 fy2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iyiik0wi; 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 hr40-20020a1709073fa800b007386f4ab2a2si1274650ejc.638.2022.08.15.13.15.29; Mon, 15 Aug 2022 13:15:55 -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=iyiik0wi; 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 S1343555AbiHOTjf (ORCPT + 99 others); Mon, 15 Aug 2022 15:39:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344344AbiHOTgf (ORCPT ); Mon, 15 Aug 2022 15:36:35 -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 811CC642E3; Mon, 15 Aug 2022 11:45:55 -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 73100611EF; Mon, 15 Aug 2022 18:45:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60131C433C1; Mon, 15 Aug 2022 18:45:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660589154; bh=qV18CXrqDsPNUqyyYXpbc7vK2XRoYEx8HCVgIpmxHzs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iyiik0wiZaOIDPtmZkWwzVDpiwkhY0nTpdFg+peaLCiO76vNhCnVW84ipjP9fd7Oq gtSTiF4/78P3ETVJVGmWNoSgMTvuFW0MhbguI4iNZ6eG5ZzhGQrOzf/I2AwMPrSfkf j7cT0q8/7516NjxAlMXmS0ERotObBEcvueEuVPmQ= 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.15 599/779] MIPS: vdso: Utilize __pa() for gic_pfn Date: Mon, 15 Aug 2022 20:04:03 +0200 Message-Id: <20220815180402.958097458@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@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