Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1845303lqp; Mon, 15 Apr 2024 21:58:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVD8Yw7wL0cdhSd9FSzZGxAx/apFrFfvJaOZVulcXqFD8F2HdLZrSzGXX80e3+zAb6YoS+6Y9aZc6g0x9wcFnuuSOk5wt5zq5vhR0f0jQ== X-Google-Smtp-Source: AGHT+IEJBHe3Zp29SuXxXU9qDH2dKLQNoV1VJOZcjPlkh+MP1m/BrEhI4uUB4aIEbRSe5fdDmrmc X-Received: by 2002:a9d:61c7:0:b0:6eb:8338:dd20 with SMTP id h7-20020a9d61c7000000b006eb8338dd20mr3672293otk.34.1713243520605; Mon, 15 Apr 2024 21:58:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713243520; cv=pass; d=google.com; s=arc-20160816; b=xDDJbIqHRw6zdYEpuXZowbrS1f/KlkPy91hqSlQeKhq0lUDgPKSmyHcy4v0FwvkjiG /6+K+NV6lmTg0Bb6StzDbQfgPgUiAscoCN+XHRW0ETm5T7UbHvywWIA73XNFdrsep3xe tISv3SBBL9Iw2uvcUexDMyydM/AlQOzi6Nlr9i03Ni1Nw25zEmn9F0pmYPWwnJxfc3wD WfBasPlwC80JS+Y6tneAgKdlSo3b16DhkAO/v8ptR/p0zH/1yNz4KnV5pCzN0S0CjCAU ScDZp3VFANKLuzqBWElj77ft0QfiRQ24M9bpfmnP0Fm4gDHy0cH+5oB59vw39HuGab3r yeiw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:organization:references :in-reply-to:message-id:subject:cc:to:from:date:dkim-signature; bh=vH5JpKm0IVO5MTNAIB8ZdTsGG99p2/W5uhH+IghDYAk=; fh=iIbByhqKpdfyTItIciddKFOP4nvaIKAiExEaeTuP1mM=; b=iHpvON4wp1x6biK0N/3yMLPpvS0xfFEMUU0ND6u4AzblU4KhpkdHAnX6KRVSNWp00e 34LuTWIxSZjp+/gQ0+3IT4HnCHDMUnmpT7dmTfK3YoIIQfoRjN/y00xelYpKzUCI0xjB RdcDCrqjHN0jSJJH/oiGznbbDqyC5NGXsojRk4zaLEst3P8DxNgft3mnAs/OsdZVemXH hd+7GG3YvN9s8OWUUBxDMw35D8gNHBTKeKRCcydln/jNhiErdMltl/sjkpIn2DWciyRY 5ahCV3H3Oyu2bonLKW1BmMgOmP/TkwOP3zUFbEO5FsSMpCaasCGmTJRZiLvMMx18uRqs O+1A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=i2AKXiXY; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-145997-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145997-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id e1-20020a631e01000000b005cd811e2ffesi9286363pge.18.2024.04.15.21.58.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 21:58:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-145997-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=i2AKXiXY; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-145997-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145997-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id EC8E2B21A71 for ; Mon, 15 Apr 2024 23:16:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 58935158DC9; Mon, 15 Apr 2024 23:16:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="i2AKXiXY" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 42E60158D61; Mon, 15 Apr 2024 23:16:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.9 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713222976; cv=none; b=sxx1ZGEceozDM7QaOdegXJ1x/IXk1kLT0GtCOanUc3Y1qXaq9vV/3+VSGEMYqUtgO4E3GTOboIBMKJ+kVSaNX8etQL8FsuFjlIHHjPYjuMbF0c16liOmYnl0976/HdT/slFweOkmxZrLHohvw6Hmau+hc+x2ZSSWhHAEhcvmUsQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713222976; c=relaxed/simple; bh=7B0+vlNEjkd3v4+xOWiFJOgf2HlzQA09AZVPsetgOhM=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ezU6EMd3boOBtl5OGF1CxY9znKBhrT7JXHSq9EqfuXSimdAU4CcooXxnD1EtkD6Rp+HNRZ27g1w9dOzv9Q9Xj+DT3c2uHqpvl1lZIlMIiGlL31P4osOSUAxaTt0Ht3w2YaeFAF9T2/Rmk9N01/vPT3XFE2BKk6Uor802AkPb0c8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=i2AKXiXY; arc=none smtp.client-ip=198.175.65.9 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1713222976; x=1744758976; h=date:from:to:cc:subject:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=7B0+vlNEjkd3v4+xOWiFJOgf2HlzQA09AZVPsetgOhM=; b=i2AKXiXYx9qF4XDQapP335mvoJx1a7SgU9uPs49KkIQ/QHlUzTo6P33W g/zmzRypm87QEB2ul2QfmkALBd+05RB+oUbwKa4J/XXkpTa6Tti8clcv2 51PJZwZvOnUSjo+wQSZI5WbAzHbchfZSJnlxFWkKOYRc8P+IDodatx4F2 Tcdwz60biPPkQO4w5eC0HyzC/hAVwezrkUTCdlRPOiNNB5wcBXrE+ob2E igQLAy4MfFS9DmNv662s5lzw1bALsy9Ak3CDdAo8dMBaUpat1ofKBu7SZ jkkJfXy7efasSWUKWlj/F2Z7H9k4e9F5J4l7a29HlYxiJ9WFY1eUU6m79 A==; X-CSE-ConnectionGUID: 2KY2Dg9fS3ywDfHAiCGXdQ== X-CSE-MsgGUID: rsHupaCDQkKm/rUuhLsWjA== X-IronPort-AV: E=McAfee;i="6600,9927,11045"; a="31114734" X-IronPort-AV: E=Sophos;i="6.07,204,1708416000"; d="scan'208";a="31114734" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Apr 2024 16:16:15 -0700 X-CSE-ConnectionGUID: NpTcH9BFTF29RrltnUwZBQ== X-CSE-MsgGUID: tvdyeOlsQYe8ENzM5LFtLQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,204,1708416000"; d="scan'208";a="21963487" Received: from jacob-builder.jf.intel.com (HELO jacob-builder) ([10.54.39.125]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Apr 2024 16:16:14 -0700 Date: Mon, 15 Apr 2024 16:20:47 -0700 From: Jacob Pan To: "Tian, Kevin" Cc: LKML , X86 Kernel , Peter Zijlstra , "iommu@lists.linux.dev" , Thomas Gleixner , Lu Baolu , "kvm@vger.kernel.org" , "Hansen, Dave" , Joerg Roedel , "H. Peter Anvin" , Borislav Petkov , Ingo Molnar , "Luse, Paul E" , "Williams, Dan J" , Jens Axboe , "Raj, Ashok" , "maz@kernel.org" , "seanjc@google.com" , Robin Murphy , "jim.harris@samsung.com" , "a.manzanares@samsung.com" , Bjorn Helgaas , "Zeng, Guang" , "robert.hoo.linux@gmail.com" , jacob.jun.pan@linux.intel.com Subject: Re: [PATCH v2 11/13] iommu/vt-d: Make posted MSI an opt-in cmdline option Message-ID: <20240415162047.34f19b0f@jacob-builder> In-Reply-To: References: <20240405223110.1609888-1-jacob.jun.pan@linux.intel.com> <20240405223110.1609888-12-jacob.jun.pan@linux.intel.com> Organization: OTC X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Hi Kevin, On Fri, 12 Apr 2024 09:31:32 +0000, "Tian, Kevin" wrote: > > From: Jacob Pan > > Sent: Saturday, April 6, 2024 6:31 AM > > > > +#ifdef CONFIG_X86_POSTED_MSI > > + else if (!strncmp(str, "posted_msi", 10)) { > > + if (disable_irq_post || disable_irq_remap) > > + pr_warn("Posted MSI not enabled due to > > conflicting options!"); > > + else > > + enable_posted_msi = 1; > > + } > > +#endif > > the check of disable_irq_remap is unnecessary. It's unlikely to have > a configuration with disable_irq_post=0 while disable_irq_remap=1 > given the latter has bigger scope. > > but thinking more do we really need a check here? there is no order > guarantee that "posted_msi" is parsed after the parameters deciding > the value of two disable variables. > > it probably makes more sense to just set enable_posted_msi here > and then do all required checks when picking up the irqchip in > intel_irq_remapping_alloc(). Makes sense, I have a helper function posted_msi_supported() called in intel_irq_remapping_alloc() already. My intention was to alert negligent users, but is is not really necessary as you said. Thanks, Jacob