Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2526822imm; Mon, 24 Sep 2018 05:58:29 -0700 (PDT) X-Google-Smtp-Source: ACcGV62eVzb9oC2cDkCl24AFqJS8a/dIDwX/sbAAFsjOHR4HLaCduLeR8Xnn1NePpl++lTh+I+kS X-Received: by 2002:a63:2c01:: with SMTP id s1-v6mr9279413pgs.367.1537793909400; Mon, 24 Sep 2018 05:58:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537793909; cv=none; d=google.com; s=arc-20160816; b=0cTIXYm2x7VBjAb897442h6ttnCfOuk+AWu0bDM3yl9nwbExTFa5peXqVj9skw+rOS a57l5UdnJca3dHcFh8u3ut2/mEm47e4gh0O7Cfeyjm/rOCyXo21Yc+lQhAXENVj+ptb/ GRvRUNhr7H9XTt1W5RtFP9Wfz6a8aFl8CGtWuCGhR2XQMn4I8HknnXNvwjgG68rtYxos uT+Xy8I/mqgXl1qJ5aS7QP2HRUnHKrke5CJoulUW8yZNWVShuAKbjbEZP8NKlhOm7kmm Qzy6G4Bwy4oZp/2BRiV2JwbYUMFbJIkRcR4UYFdIakC8wSDaKT1nkiK5E3p3TSQG+pkz npjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=aBo3HrkN7nqRSyRDV2d5hSIhOwy8LFRkhjG2vLzcmaY=; b=lKAzrqI8OluAT42OXyrDi8NbtfJJgAuhCwF5Lg2yhxM94S6B7gDwIkyUGDJ72mjV9i D9IAlGdmcLcHS1LswOkssoro1JMuesQFI7bV59q9SBLWhT0J53xzKBId2vowagWjeURz CZnKbFXF+3HUOLcv2+DHHO5WaeXXBKe3YY9Uo2A4goarNnD50vNrOBlXHO10jzDbOi27 xHpoH8AYk4h94pXKaBW7RLk9Ew8d9iep6zhVuIt4/c6KPGgRNfq5RcIR/JKBpA1sUoZ3 dtRBIErKHdoVA0meHmPPAju/1EFpJ+pJ29U6nDxl6fXELdajSTGOzIywilugpe6XLg7x WpDA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g19-v6si1350296pgl.657.2018.09.24.05.58.14; Mon, 24 Sep 2018 05:58:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731406AbeIXS7n (ORCPT + 99 others); Mon, 24 Sep 2018 14:59:43 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:54934 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731122AbeIXSNz (ORCPT ); Mon, 24 Sep 2018 14:13:55 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id C074D1088; Mon, 24 Sep 2018 12:12:05 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Paul Burton , Jason Cooper , Marc Zyngier , Thomas Gleixner , linux-mips@linux-mips.org, Ralf Baechle , =?UTF-8?q?SZ=20Lin=20 ?= Subject: [PATCH 4.9 111/111] MIPS: VDSO: Drop gic_get_usm_range() usage Date: Mon, 24 Sep 2018 13:53:18 +0200 Message-Id: <20180924113116.349047480@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180924113103.337261320@linuxfoundation.org> References: <20180924113103.337261320@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Paul Burton commit 00578cd864d45ae4b8fa3f684f8d6f783dd8d15d upstream. We don't really need gic_get_usm_range() to abstract discovery of the address of the GIC user-visible section now that we have access to its base address globally. Switch to calculating it ourselves, which will allow us to stop requiring the irqchip driver to care about a counter exposed to userland for use via the VDSO. Signed-off-by: Paul Burton Cc: Jason Cooper Cc: Marc Zyngier Cc: Thomas Gleixner Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/17040/ Signed-off-by: Ralf Baechle Signed-off-by: SZ Lin (林上智) Signed-off-by: Greg Kroah-Hartman --- arch/mips/kernel/vdso.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) --- a/arch/mips/kernel/vdso.c +++ b/arch/mips/kernel/vdso.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include @@ -21,6 +20,7 @@ #include #include +#include #include #include @@ -101,9 +101,8 @@ int arch_setup_additional_pages(struct l { struct mips_vdso_image *image = current->thread.abi->vdso; struct mm_struct *mm = current->mm; - unsigned long gic_size, vvar_size, size, base, data_addr, vdso_addr; + unsigned long gic_size, vvar_size, size, base, data_addr, vdso_addr, gic_pfn; struct vm_area_struct *vma; - struct resource gic_res; int ret; if (down_write_killable(&mm->mmap_sem)) @@ -127,7 +126,7 @@ int arch_setup_additional_pages(struct l * only map a page even though the total area is 64K, as we only need * the counter registers at the start. */ - gic_size = gic_present ? PAGE_SIZE : 0; + gic_size = mips_gic_present() ? PAGE_SIZE : 0; vvar_size = gic_size + PAGE_SIZE; size = vvar_size + image->size; @@ -168,13 +167,9 @@ int arch_setup_additional_pages(struct l /* Map GIC user page. */ if (gic_size) { - ret = gic_get_usm_range(&gic_res); - if (ret) - goto out; + gic_pfn = virt_to_phys(mips_gic_base + MIPS_GIC_USER_OFS) >> PAGE_SHIFT; - ret = io_remap_pfn_range(vma, base, - gic_res.start >> PAGE_SHIFT, - gic_size, + ret = io_remap_pfn_range(vma, base, gic_pfn, gic_size, pgprot_noncached(PAGE_READONLY)); if (ret) goto out;