Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp4927406iog; Wed, 22 Jun 2022 08:27:32 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ulKvn1FcErWU7brSk7yuEEz8ANoeUTOitWJPRf3CpAlP+fiEq5EH+9pfsFUin/7DEV0dPI X-Received: by 2002:a05:6a00:cd5:b0:525:5211:7d96 with SMTP id b21-20020a056a000cd500b0052552117d96mr380163pfv.56.1655911651952; Wed, 22 Jun 2022 08:27:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655911651; cv=none; d=google.com; s=arc-20160816; b=O9qVZkzS65S3qDS93rg9L2XU7K8R0Lw8tbflLouYcg8PJmL5Lp87Lb9qZM549rR4G0 HPyCIMYVDOIfIJKuVTrrlPR5QMRPzXlvGyi8XYDpnQoaow9BBeSBwdgEn92/WDUuL5vV /qu/x7NxccUf4ezuvzhXvm264TYZbU5ApvxWft+zQ0OVPw/UnZSoQysnflmwrnAxsTmC VGfgpeAmdzuKrvvcTp8flKtuaO9jpp7EDKLj2WKU84DfbVE1F+ULMfYC+80s+FMhMenz BND3QUYfenmpvs0AUUmVa5RysTk4hgO5R4a+Pf8qzA+3kgInIa9skP+0kICbP2gTPcFH tkzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=jndzfVF++R7TsK3TV+yk+0zpm8yMa0Qnb1v8H83vdVo=; b=j/k9nQcjgBm8BIJUL2EKz/57kxD0fb5i0MVdkGU5Mpk2u9JQH/GqJSeR8L1tw6vOF9 HBSpV9fBEZ20Kz44MH7dI+ctZaZmkk3kIrqlolBaNYTLUPEzScGh8TWoFESZO80QqRvd tJi+oywNAvuy9UeLPR4bo11LqwwddEE1zW8rRIyhmiCA91Z0xfDC4XjC6ubB4g7r9E7m tw19GiCZVWq9+489HsIGLZiVc3hPbCOvOF3ZTCdbhrY4sC33trEV5z6WbYcwPt/Apa9b SNF8C0jSW2M6yCxz9+6d3T2hYTlyYPERgqQ/oPUbQibDfZYVVWD4hl8eaIj+01DhcQSh 9xaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=H0cdfvo8; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s137-20020a632c8f000000b003fcb3adf3cbsi22221712pgs.809.2022.06.22.08.27.19; Wed, 22 Jun 2022 08:27:31 -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=@redhat.com header.s=mimecast20190719 header.b=H0cdfvo8; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358987AbiFVPFy (ORCPT + 99 others); Wed, 22 Jun 2022 11:05:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358934AbiFVPFr (ORCPT ); Wed, 22 Jun 2022 11:05:47 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 978E23EA9E for ; Wed, 22 Jun 2022 08:05:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1655910340; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=jndzfVF++R7TsK3TV+yk+0zpm8yMa0Qnb1v8H83vdVo=; b=H0cdfvo8huFhRnoSl9tTIo+ev6YZEsVj3/QUMxHLNP+Mo/YHyIPPpuZoKVL7nOgS+7ygZL iGjPU238ZJuCxvtUEr3UIMeDMry1T/rHfJI44B4FrguG6hu36NPSs0X+HtEzsYm2Q4Z8nr 5Rixfm9t1UD+nebvl2v106rNOtvgmaA= Received: from mail-vk1-f200.google.com (mail-vk1-f200.google.com [209.85.221.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-460-4ro_6ZUQPzKLcCf9ta8v8w-1; Wed, 22 Jun 2022 11:05:39 -0400 X-MC-Unique: 4ro_6ZUQPzKLcCf9ta8v8w-1 Received: by mail-vk1-f200.google.com with SMTP id p185-20020a1fd8c2000000b0036c453f2ea4so1264709vkg.18 for ; Wed, 22 Jun 2022 08:05:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=jndzfVF++R7TsK3TV+yk+0zpm8yMa0Qnb1v8H83vdVo=; b=1yGCjGR2+7nVMpDgC434mWFOYp3bJWd9S/hU0NL02mqv5G8bczJDCvK4/FTqbAZv6C 4xGZjp08bCqfxgb/4DHwHnpKjGOBY3Vsiz2/quwiHQl5NjycM7KaucQbkRe6NQAF0aW8 bJh5jUDo2Pc1CrKfewZnEBFGD10IM8anC8FavYOY3umG3Ez3s6tHYCDREc5uMf0eZw6m HMSJmDdrc6LbVRByXd9ACZ54e6V/wzWGKxqy5NLZrvon1nqx2musPQ2tBMVr20Xjp9QS pcBi8AAvkOrUigljAZPq48P14kP72ncVQEY8LJYMPHMsptzhRBgx+oJe1I1CxEtu0V8r 7jbA== X-Gm-Message-State: AJIora/88qSxOoOfK+3TcQp2VagFcR6YcM/xf4hOFGSfOP0G0frWm+mm v+thZxMpZZQrrTl53adggRQ3ChLtudDdK59bWgbq9VyIUsBWKBKWOGnYLtKp/jJcWIk6uiUj/AG FXxf7SVCJvOGyFVJkPE5CU2DLOFew2kRi6TtpKDvd X-Received: by 2002:a67:ba09:0:b0:354:5d45:67ed with SMTP id l9-20020a67ba09000000b003545d4567edmr1745709vsn.18.1655910338974; Wed, 22 Jun 2022 08:05:38 -0700 (PDT) X-Received: by 2002:a67:ba09:0:b0:354:5d45:67ed with SMTP id l9-20020a67ba09000000b003545d4567edmr1745672vsn.18.1655910338758; Wed, 22 Jun 2022 08:05:38 -0700 (PDT) MIME-Version: 1.0 References: <9d6177ac-802f-eb11-4307-b0e49d8126b5@linux.intel.com> <20220615183650.32075-1-steve.wahl@hpe.com> <96984350-3a04-812a-60f1-a09138014fac@linux.intel.com> In-Reply-To: <96984350-3a04-812a-60f1-a09138014fac@linux.intel.com> From: Jerry Snitselaar Date: Wed, 22 Jun 2022 08:05:12 -0700 Message-ID: Subject: Re: [PATCH v3] iommu/vt-d: Make DMAR_UNITS_SUPPORTED a config setting To: Baolu Lu Cc: Steve Wahl , Joerg Roedel , Kyung Min Park , David Woodhouse , Will Deacon , iommu , Kevin Tian , Mike Travis , Dimitri Sivanich , Russ Anderson , Linux List Kernel Mailing Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE,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 On Wed, Jun 22, 2022 at 7:52 AM Baolu Lu wrote: > > On 2022/6/16 02:36, Steve Wahl wrote: > > To support up to 64 sockets with 10 DMAR units each (640), make the > > value of DMAR_UNITS_SUPPORTED adjustable by a config variable, > > CONFIG_DMAR_UNITS_SUPPORTED, and make it's default 1024 when MAXSMP is > > set. > > > > If the available hardware exceeds DMAR_UNITS_SUPPORTED (previously set > > to MAX_IO_APICS, or 128), it causes these messages: "DMAR: Failed to > > allocate seq_id", "DMAR: Parse DMAR table failure.", and "x2apic: IRQ > > remapping doesn't support X2APIC mode x2apic disabled"; and the system > > fails to boot properly. > > > > Signed-off-by: Steve Wahl > > Reviewed-by: Kevin Tian > > --- > > > > Note that we could not find a reason for connecting > > DMAR_UNITS_SUPPORTED to MAX_IO_APICS as was done previously. Perhaps > > it seemed like the two would continue to match on earlier processors. > > There doesn't appear to be kernel code that assumes that the value of > > one is related to the other. > > > > v2: Make this value a config option, rather than a fixed constant. The default > > values should match previous configuration except in the MAXSMP case. Keeping the > > value at a power of two was requested by Kevin Tian. > > > > v3: Make the config option dependent upon DMAR_TABLE, as it is not used without this. > > > > drivers/iommu/intel/Kconfig | 7 +++++++ > > include/linux/dmar.h | 6 +----- > > 2 files changed, 8 insertions(+), 5 deletions(-) > > > > diff --git a/drivers/iommu/intel/Kconfig b/drivers/iommu/intel/Kconfig > > index 39a06d245f12..07aaebcb581d 100644 > > --- a/drivers/iommu/intel/Kconfig > > +++ b/drivers/iommu/intel/Kconfig > > @@ -9,6 +9,13 @@ config DMAR_PERF > > config DMAR_DEBUG > > bool > > > > +config DMAR_UNITS_SUPPORTED > > + int "Number of DMA Remapping Units supported" > > + depends on DMAR_TABLE > > + default 1024 if MAXSMP > > + default 128 if X86_64 > > + default 64 > > With this patch applied, the IOMMU configuration looks like: > > [*] AMD IOMMU support > AMD IOMMU Version 2 driver > [*] Enable AMD IOMMU internals in DebugFS > (1024) Number of DMA Remapping Units supported <<<< NEW > [*] Support for Intel IOMMU using DMA Remapping Devices > [*] Export Intel IOMMU internals in Debugfs > [*] Support for Shared Virtual Memory with Intel IOMMU > [*] Enable Intel DMA Remapping Devices by default > [*] Enable Intel IOMMU scalable mode by default > [*] Support for Interrupt Remapping > [*] OMAP IOMMU Support > [*] Export OMAP IOMMU internals in DebugFS > [*] Rockchip IOMMU Support > > The NEW item looks confusing. It looks to be a generic configurable > value though it's actually Intel DMAR specific. Any thoughts? > > Best regards, > baolu > Would moving it under INTEL_IOMMU at least have it show up below "Support for Intel IOMMU using DMA Remapping Devices"? I'm not sure it can be better than that, because IRQ_REMAP selects DMAR_TABLE, so we can't stick it in the if INTEL_IOMMU section. Regards, Jerry