From patchwork Thu Sep 2 02:01:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 12470723 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=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 293B6C432BE for ; Thu, 2 Sep 2021 02:01:40 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 AF7E7610A4 for ; Thu, 2 Sep 2021 02:01:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org AF7E7610A4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C6C4B8994D; Thu, 2 Sep 2021 02:01:38 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6C7A28994D for ; Thu, 2 Sep 2021 02:01:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-ID:Content-Description:In-Reply-To:References; bh=8jUKRG59iHwqmgF692omQt7SzopfyVzzs32Eyg39CYc=; b=p/3AJPXNQIzMu4hHzTQ/0BqHeF Q/y0Voyy9tAQjHJo/Kzd9mssQ3kcm8Nj6bqq+ZRk+zWGRr2HX+MMeHY2QIZqsynhkW0NZeVYB0fq/ lNiwIQajkL5mWQ4sg7jDVLkQZohi/vTdnAGSsOd0mSbH+vXlfMoX7LFhIHy21JD2hsy7YVVzPMQ/L 1D9+0PoIpTzBaYRUmycGv9XzPcXi1RIj8HC6g748muedfld69/dTZPL7HwOj3PVI3uqC1RwO+JiBB bewGXMmBm+JPhnK45PQpVXqtJ13TYqY0LcUZFruM6NE9w84JlqhhQ8Fe31wF3b7u9wR3IHcmZNuLL Yid+JlZA==; Received: from [2601:1c0:6280:3f0:e65e:37ff:febd:ee53] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mLc2k-0089k8-Rs; Thu, 02 Sep 2021 02:01:30 +0000 From: Randy Dunlap To: linux-kernel@vger.kernel.org Cc: Randy Dunlap , =?utf-8?q?Thomas_Hellstr=C3=B6m?= , =?utf-8?q?Christian_K=C3=B6nig?= , Huang Rui , dri-devel@lists.freedesktop.org, Jeff Dike , Richard Weinberger , Anton Ivanov , linux-um@lists.infradead.org, David Airlie , Daniel Vetter Subject: [PATCH] drm/ttm: provide default page protection for UML Date: Wed, 1 Sep 2021 19:01:29 -0700 Message-Id: <20210902020129.25952-1-rdunlap@infradead.org> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" boot_cpu_data [struct cpuinfo_um (on UML)] does not have a struct member named 'x86', so provide a default page protection mode for CONFIG_UML. Mends this build error: ../drivers/gpu/drm/ttm/ttm_module.c: In function ‘ttm_prot_from_caching’: ../drivers/gpu/drm/ttm/ttm_module.c:59:24: error: ‘struct cpuinfo_um’ has no member named ‘x86’ else if (boot_cpu_data.x86 > 3) ^ Fixes: 3bf3710e3718 ("drm/ttm: Add a generic TTM memcpy move for page-based iomem") Signed-off-by: Randy Dunlap Cc: Thomas Hellström Cc: Christian König Cc: Huang Rui Cc: dri-devel@lists.freedesktop.org Cc: Jeff Dike Cc: Richard Weinberger Cc: Anton Ivanov Cc: linux-um@lists.infradead.org Cc: David Airlie Cc: Daniel Vetter --- drivers/gpu/drm/ttm/ttm_module.c | 4 ++++ 1 file changed, 4 insertions(+) --- linux-next-20210901.orig/drivers/gpu/drm/ttm/ttm_module.c +++ linux-next-20210901/drivers/gpu/drm/ttm/ttm_module.c @@ -53,6 +53,9 @@ pgprot_t ttm_prot_from_caching(enum ttm_ if (caching == ttm_cached) return tmp; +#ifdef CONFIG_UML + tmp = pgprot_noncached(tmp); +#else #if defined(__i386__) || defined(__x86_64__) if (caching == ttm_write_combined) tmp = pgprot_writecombine(tmp); @@ -69,6 +72,7 @@ pgprot_t ttm_prot_from_caching(enum ttm_ #if defined(__sparc__) tmp = pgprot_noncached(tmp); #endif +#endif return tmp; }