Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1474407rwr; Wed, 26 Apr 2023 16:01:34 -0700 (PDT) X-Google-Smtp-Source: AKy350ZX0kgYMpEZopdJZmUO0cJWZtiP2jJHHyfk4+5w+YQE3x+7UGQSyoKLiPjyj+0gMJTgmVrR X-Received: by 2002:a05:6a20:a111:b0:f6:15f3:ca36 with SMTP id q17-20020a056a20a11100b000f615f3ca36mr9917736pzk.50.1682550094114; Wed, 26 Apr 2023 16:01:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682550094; cv=none; d=google.com; s=arc-20160816; b=Y56TCMghCM5zzVr7FuUPHJ8obBoZBZMu/eiwXTYIUci241LMBmJzbQd8J4w8e32kfn 3IR6dVKeiin5H94JBNhh6W/81v4eQc0srD48tNyLVYCcLFQoU/v27qnVz6MFDETKN1Ej /yBudDDVe0Fuk2goZkjyWb8kKF8PgXRPdwJc2U8k7zjkAvSZJWNLQDgOoB0jXzCGXD6r aCRQXRPb61esMiM1TmSTVlqmz9U+VZLRRpnf1QQEaUGSygn3Wpgtnot5DE5RytER8XZG AuoZ378kjuB2mxayQ9tOLp5tNeEDkoNWI1QUbb+UaQPWpzaM/sxQYLeIG2pNXA0+tLDC yy/Q== 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 :message-id:date:references:in-reply-to:subject:cc:to:from :dkim-signature; bh=9hSAAAKNZdoaKCo/vqVSwb9UYrU/fz0nvs4rfK4bbMs=; b=OXyE2qKz02uosCgP1spyr4zztxUnIpj7Bk/JzUvZ/ZmyB13hrgF+u4ehith+HIIR7m DJ64ca9riS+K7yeJhrSy8AN3TbSdm01muc2ekQ+GpNGyWXQTDicChVS8W14G688tt26D GUV86fj5PU6I+8lGawbM0x8L28OLLWI+8tYIM6dFOpQEgkqozuOUNB7X6fyt0tlVMeKr uyXfIvsRPiVbe+RmzMVreZYAxgdFC+PG4nFoRmoGW2COQ8R9B0KqkSaf3iP/4Yr0BMZs fT4MPx9VR8XVxQspMKEwyx71w8ATgrb2q3Mi3P43/Dnnj9VAAlI19D2B4ik80+x4pzSv Zldw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=K+NoNO4J; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d28-20020a631d5c000000b00519e8003677si17185794pgm.664.2023.04.26.16.00.28; Wed, 26 Apr 2023 16:01:34 -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=@ellerman.id.au header.s=201909 header.b=K+NoNO4J; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240421AbjDZWt3 (ORCPT + 99 others); Wed, 26 Apr 2023 18:49:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240197AbjDZWt2 (ORCPT ); Wed, 26 Apr 2023 18:49:28 -0400 Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1613D7 for ; Wed, 26 Apr 2023 15:49:25 -0700 (PDT) Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4Q6DZQ106hz4x5c; Thu, 27 Apr 2023 08:49:18 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1682549359; bh=9hSAAAKNZdoaKCo/vqVSwb9UYrU/fz0nvs4rfK4bbMs=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=K+NoNO4JJ70Ezbh3yN9FVpVO2zylLPQ++7YyOumIvLCa6LOGt9SHrbwhE4kKduC+l LkVuDoZLPJ99pUzfN+8PhhRasUbMxhGcCzByls1V1HIGCQijlG0w1zoed1iVHYLtHH mmC4U4i3ZiQsM1GAfaGcS1lEkZohWk5wcFA6Fzqhp0XzoZuVmPqO4WVe7xXVDKjlDK OD62pJ1AUEOHDniD21RNDWYihq2qLext6tmSnUWif7TlNOdXOf9bplHwsciRdwSEvy h8oVqqk1XD4xETjvQ5KZOanNC6qnxjEpZb3uQ1MdVGeb9OY9d4hWnqZaxUpDzb+cKO lh5cNNgP+H2ww== From: Michael Ellerman To: Linus Torvalds , "Sudip Mukherjee (Codethink)" Cc: Thomas =?utf-8?Q?Hellstr=C3=B6m?= , Christian Koenig , Huang Rui , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: mainline build failure due to 322458c2bb1a ("drm/ttm: Reduce the number of used allocation orders for TTM pages") In-Reply-To: References: Date: Thu, 27 Apr 2023 08:49:11 +1000 Message-ID: <871qk6z2c8.fsf@mail.concordia> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Linus Torvalds writes: > On Wed, Apr 26, 2023 at 10:44=E2=80=AFAM Sudip Mukherjee (Codethink) > wrote: >> >> drivers/gpu/drm/ttm/ttm_pool.c:73:29: error: variably modified 'global_w= rite_combined' at file scope >> 73 | static struct ttm_pool_type global_write_combined[TTM_DIM_ORDER]; >> | ^~~~~~~~~~~~~~~~~~~~~ > > Ugh. > > This is because we have > > #define TTM_DIM_ORDER (__TTM_DIM_ORDER <=3D MAX_ORDER ? > __TTM_DIM_ORDER : MAX_ORDER) > > which looks perfectly fine as a constant ("pick the smaller of > MAX_ORDER and __TTM_DIM_ORDER"). > > But: > > #define __TTM_DIM_ORDER (TTM_MAX_ORDER + 1) > #define TTM_MAX_ORDER (PMD_SHIFT - PAGE_SHIFT) > > which still _looks_ fine, but on 64-bit powerpc, we then have > > #define PTE_INDEX_SIZE __pte_index_size > > so that __TTM_DIM_ORDER constant isn't actually a constant at all. .. > > It's a bit sad how that macro that _looks_ like a constant (and is one > pretty much everywhere else) isn't actually constant on powerpc, but > looking around it looks fairly unavoidable. Yeah, it allows us to build a single kernel that can choose at runtime whether it uses the HPT or Radix MMU. The page table geometry is different between the MMUs because they support a different sized huge page for THP. cheers