From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.9 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,T_DKIMWL_WL_HIGH,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5946BC04A6B for ; Mon, 6 May 2019 16:44:52 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2AB6F20578 for ; Mon, 6 May 2019 16:44:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Z91oZziq"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="Gta2PKbj"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="ZSFHbQPv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2AB6F20578 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:From:Subject:References:Mime-Version :Message-Id:In-Reply-To:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=K0rztoPO83vEZaw77NqB0mDQ2vbcKw7Ml9Hg0rqrzyU=; b=Z91oZziqi4OTp5 hzOMYqiToP8u2HJLKo+O7T/Kf4CAv3C43MyTtrkPUfDJ+u/OnZAirkIkcx66VD5XSPdh+QUO8qrq7 n/8HsIwhcQng1EnY0j6Gfz0xElIPOvhq8kAJ/tmEYILOTif+PwDJHILRd2Sqc7XrY4i6tOBfEaT/P 51L4ZVBkzRj3P7M3foqyGFame+iPw/l7YZIGuAZq97bBVWpCXDn28//LEcM/pH9mUukWuyt6QviF0 tFhEahp/latHuTf/Qf+pvnz2s5QqlqXGXWLmiauXGsAMDoRUoS6as0SZYofZQ6qMpA+x0M9Cw9pzE ZHBbjKxEKaqpfhBFyyQw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hNgjT-0006UZ-JS; Mon, 06 May 2019 16:44:51 +0000 Received: from merlin.infradead.org ([205.233.59.134]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hNgWs-0007Tj-Qb for linux-arm-kernel@bombadil.infradead.org; Mon, 06 May 2019 16:31:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Type:Cc:To:From:Subject: References:Mime-Version:Message-Id:In-Reply-To:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=eYbhxmTmdaiTVlq2aRmj2n9QkL6CX4/S4opJ9oDHFhE=; b=Gta2PKbjFfzh7TKDCrYRTM9VU Zc9j6wpVH74o10cYb/Pg7AvkLnWjI5UAUs0yFtpiNT4dSTxWX2XmUpLuqLAsAimOloKsieMHuG5Sq ykbncJn8OfIao7qR0lXPtFMX931JyjR17nL9QkgC9OAU4kRYrocP09EIhZ1uwGdh2KRxuRubBvfYR 6OKMRNoTqZgkOTkRylZuItP+l5x7MQRhftAPbs2NxM3qUzWwqExvz1+jdl/5KvtZ7NLZRS/Tvy+Wn 9mG2XHAaGrZxyMdkOKVX1LPeJP/9PRzjVumx1JhTOLEmtdNPDPDfhfQR7DFqSbSBOKpKcEb9s10bH 8vOIpnpPw==; Received: from mail-ot1-x349.google.com ([2607:f8b0:4864:20::349]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hNgWr-00065I-Dx for linux-arm-kernel@lists.infradead.org; Mon, 06 May 2019 16:31:50 +0000 Received: by mail-ot1-x349.google.com with SMTP id f11so7743679otl.20 for ; Mon, 06 May 2019 09:31:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=eYbhxmTmdaiTVlq2aRmj2n9QkL6CX4/S4opJ9oDHFhE=; b=ZSFHbQPvMQhkrf29+rXmES4x80rxWQfO3CRg3EirSkEvMHaN6TChbsHuGqG8tqYPqI EOCA65HA1vwG2VBAq4EN+A4OM16jXXWhM8t5gUCVAGxaFpj7A96cWjckSSXVB9ifgUBP JPRXtbLz3WvjXz6TEKimgkTZH4CSKnvPcLkcG+UwjiKkw5OJqJ0dywa/iWl3MUEMoYLx yX/R0TAlH28V7Dy/lDpZ2CQKiEy+5rLrSQMyM1Z1SBWcw4VX+lOfzjflOLQGIDoNcKIy Lw+nu7cdx5CVE6SIyoKDCFcQFHBzYbom0atBI7FulTuqD2oMzEvZRTJLiB0pdkfBeBX2 irnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=eYbhxmTmdaiTVlq2aRmj2n9QkL6CX4/S4opJ9oDHFhE=; b=EwAgygOrwo103yaEMMUcEtAh//kIRYaMBgQx3ST6b51oXUUPrA2z4Rnz5d1xpn8xRZ pEhnhM9hc0PhVh77OItw2fylKgjNXgSGBS3beof+2nDHe1sBhPioQ4hCt8VoSrz2X4mV YnIESFnERcQgSq/syiCZP9ak+8Hem/W7jv+AzvD6onyQ2/Vr1a3ea2zI+NxEI03nYZI1 3MaJbiENVW7J3RaSUEQ6TRK1c/SYwKQgJy6BbXkPIt3JtcXFcYuxwfcSvMzK8M8s2CAK V/XUQg56LdjSVi5N2u2yMfT2PZjZM2/7AGFj4KDvxOnEAR02tw/2JMVZZWZT32kzg+S4 Iztg== X-Gm-Message-State: APjAAAVIcfCurON5lH1CamsBybEMlh1ABxDUMT5vFj54jS5lIitpdo79 GPwrkrkAateePfkxrR25cDBof1yvQA4kWhJ+NdgK7iIPNXvVFtGQCPNhQlOr5Y+YhEBUNp0QMfg uNcNyS/9jSgyiiti5ermRZUb9wgJjtWlVfpg1d4kRl4m+uhi1X6qjKJBQtYSoHPEJujcO1sin0J WSyyACrS5Zypxl6ac= X-Google-Smtp-Source: APXvYqzdzQlfaHkw0Qwo4QQtxGeWhxSSS13Ps1SOtj6ReWwWjESZwRkhi/LnnldOgTKgizVRLfncWXFiUgbgbiQx X-Received: by 2002:a9d:7d04:: with SMTP id v4mr16958653otn.185.1557160304159; Mon, 06 May 2019 09:31:44 -0700 (PDT) Date: Mon, 6 May 2019 18:30:58 +0200 In-Reply-To: Message-Id: <03fe9d923db75cf72678f3ce103838e67390751a.1557160186.git.andreyknvl@google.com> Mime-Version: 1.0 References: X-Mailer: git-send-email 2.21.0.1020.gf2820cf01a-goog Subject: [PATCH v15 12/17] drm/radeon, arm64: untag user pointers in radeon_gem_userptr_ioctl From: Andrey Konovalov To: linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-rdma@vger.kernel.org, linux-media@vger.kernel.org, kvm@vger.kernel.org, linux-kselftest@vger.kernel.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190506_123149_495778_18D9C056 X-CRM114-Status: GOOD ( 14.82 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Szabolcs Nagy , Catalin Marinas , Will Deacon , Kostya Serebryany , Felix Kuehling , Vincenzo Frascino , Jacob Bramley , Leon Romanovsky , Dave Martin , Evgeniy Stepanov , Kevin Brodsky , Kees Cook , Ruben Ayrapetyan , Andrey Konovalov , Lee Smith , Alex Williamson , Mauro Carvalho Chehab , Dmitry Vyukov , Greg Kroah-Hartman , Yishai Hadas , Jens Wiklander , Ramana Radhakrishnan , Alexander Deucher , Andrew Morton , Robin Murphy , Christian Koenig , Luc Van Oostenryck Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org This patch is a part of a series that extends arm64 kernel ABI to allow to pass tagged user pointers (with the top byte set to something else other than 0x00) as syscall arguments. In radeon_gem_userptr_ioctl() an MMU notifier is set up with a (tagged) userspace pointer. The untagged address should be used so that MMU notifiers for the untagged address get correctly matched up with the right BO. This funcation also calls radeon_ttm_tt_pin_userptr(), which uses provided user pointers for vma lookups, which can only by done with untagged pointers. This patch untags user pointers in radeon_gem_userptr_ioctl(). Signed-off-by: Andrey Konovalov --- drivers/gpu/drm/radeon/radeon_gem.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/radeon/radeon_gem.c b/drivers/gpu/drm/radeon/radeon_gem.c index 44617dec8183..90eb78fb5eb2 100644 --- a/drivers/gpu/drm/radeon/radeon_gem.c +++ b/drivers/gpu/drm/radeon/radeon_gem.c @@ -291,6 +291,8 @@ int radeon_gem_userptr_ioctl(struct drm_device *dev, void *data, uint32_t handle; int r; + args->addr = untagged_addr(args->addr); + if (offset_in_page(args->addr | args->size)) return -EINVAL; -- 2.21.0.1020.gf2820cf01a-goog _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel