Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3124767rwb; Mon, 15 Aug 2022 18:44:46 -0700 (PDT) X-Google-Smtp-Source: AA6agR6q/U2xkA8qtCmiHChbeqkNWMddhnsvxhMT4OwrrZMAxBjtDZz9wtIOaeF/GYxYOzwxT6NM X-Received: by 2002:a63:494a:0:b0:41c:f29e:2a2e with SMTP id y10-20020a63494a000000b0041cf29e2a2emr16044213pgk.477.1660614286425; Mon, 15 Aug 2022 18:44:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660614286; cv=none; d=google.com; s=arc-20160816; b=dAQ5L9LvW9RDRiIFq9Fe0RkCZaJzp1xy++zo8q5voKwvPQYXNjcSYiHz+WlEqMb78e BvwKMc/lRWGcf3uBvtG4uvqt41QzQHoR4ChowlHOZWjzOnXcvVMdaZE5TXWMD2KJlXlX IbpN6pAGH8ZfcmDEt0i9Ys7brPi2uZxJ+hiW5sD8mKrwj5dclVAj/lHvwLGj1gxtH9qU X2GIzH7PONaDprmd7Jb66WA9FPZLY7kWyNwrmKSYXb76DPl25o4j854xpTDyZAoN2lqQ G9wHWi4VvYyEKYIJ/O+vxVXvGcnOgNL1TtQMStkpgOTP2OxYda2Pl9KG/ppGjr6a6asI F+Zw== 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=saNdwcUi8e8ffcdYgJafKwGi/PvIWgkw/fWGRZ1PrFOWuIJHO4yLfjAHlfkOfs43Fi qaEdKo+FlHzG0bJx2odWGixRopzuolNtDpZx6/OOHLq1URWpIn3xqQWQMMSBfCnYpyuy l2A1VAQDl2Z3Sb1/fCx/oM7obWWgS1c2yqZtwb1hNKMcGMv/G5cSWBJMIwCvfjT0JKHP IjYT49BKuQFsoJBCDB5XZo5Eje8MJsaUKhjrVv0po8Key3Zg08aOxB69OyQhCeDuPgdz Q/ci0kLhGaSvTPAMUR9L3VBJR5jway/tVjudK0ge64VwWQGhcYseVo7FjJ7CkDT86JMx royg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iZ36c4wP; 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 137-20020a62198f000000b005251a325ea0si7463568pfz.269.2022.08.15.18.44.36; Mon, 15 Aug 2022 18:44:46 -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=iZ36c4wP; 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 S236861AbiHPApT (ORCPT + 99 others); Mon, 15 Aug 2022 20:45:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345911AbiHPAnN (ORCPT ); Mon, 15 Aug 2022 20:43:13 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59E1ED4198; Mon, 15 Aug 2022 13:40:18 -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 ams.source.kernel.org (Postfix) with ESMTPS id B6B4FB8113E; Mon, 15 Aug 2022 20:40:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 01238C433D6; Mon, 15 Aug 2022 20:40:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660596015; bh=qV18CXrqDsPNUqyyYXpbc7vK2XRoYEx8HCVgIpmxHzs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iZ36c4wPjYJKo9k/mi7jvIavSowe9ttlx1hxb7olUWcsCFV96nCGxTzuwIg8kqOtp 3k1/zEGe/6rEyUTiJFS6QfqT7hckTskZsyZrA7QqfGXYaQYgGpyS0Ij/V1OIusHucA fTSHQ5/R7tLCh9Czr/VW0DvoTFvObXPNVq37PUZY= 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.19 0947/1157] MIPS: vdso: Utilize __pa() for gic_pfn Date: Mon, 15 Aug 2022 20:05:03 +0200 Message-Id: <20220815180517.440734427@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@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