Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1230526ybi; Fri, 21 Jun 2019 16:56:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqxz+OcSa6mY40KkU+l9vPAjPdBhKUnUAClfnpnP6g4fovZfHif8V++maI3Q1J5V+ezxvTRK X-Received: by 2002:a17:90a:d34f:: with SMTP id i15mr9941872pjx.1.1561161390545; Fri, 21 Jun 2019 16:56:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561161390; cv=none; d=google.com; s=arc-20160816; b=B4aBINfSZicCGz9HYovvT418Hw7I9X0U/taYUf57zSM8iboMgnr/VReLLvzsD3XEwd wH5IRwu7bC2PEeFUp8CX9N4amxo28TIkhM5tpJ+E+cdiInWwNy27vh64uKXzcJH40NXr HI1rOXjYU7CdngQBh9C5IOi2csdUhZnX8xMAVafYIv8KLC+s4qnGF8L6yJQn0AA7Z0eH brREiJw0sjgmzuimR9BxfrjZjuC0pJ6V4MILVmixu7eRXpuUarVLx7zKI0LgimpW/hUP iS5o1fHENDvxLRbXMpMDSyU7Ui8tZDafID+KQFalYHooAFLgcONKWQS0w6MRKgD6tiz3 ocwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=vMzr2Qq0e1mJNLTkKeclYC2Pw1XZc0Ux7Uk9KQ9zv+Q=; b=gS0YRnLMpTAPCvcTbkmLNdHZp9BSlc5Y2NmxH+vVkqgS9l8TF3Dk7rYwYX/0Lt9aAU AS8Y3iGr8fie5jm/UU8xi+mqWo062ufq/GqD1ho+NlgLU1/OO1cI3eCEsgRIDKWgOGHE M1Wp0RIULowDRQZLgxyJ9G1a1/W6n4EsPVv9xyfUArZa7jxVD9+x4fFzAUKuTaeOU5oV a2uAheymQVInAXK+D26V6X/vMJ+zWUdMWsLp/hWyAWT3VzH8bF3R6cQ2Xma6w6zmSwQH yleVM1qd3RUedu1j4u/MgVIgG/h7sRer7pBIUnNOXJBd/r5Pr0dc0kCficEX5FQ9QamQ dhMQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t10si3635551pgh.494.2019.06.21.16.56.15; Fri, 21 Jun 2019 16:56:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726254AbfFUX4F (ORCPT + 99 others); Fri, 21 Jun 2019 19:56:05 -0400 Received: from mga04.intel.com ([192.55.52.120]:29688 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726045AbfFUX4E (ORCPT ); Fri, 21 Jun 2019 19:56:04 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Jun 2019 16:56:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,402,1557212400"; d="scan'208";a="162822624" Received: from ranerica-svr.sc.intel.com ([172.25.110.23]) by fmsmga007.fm.intel.com with ESMTP; 21 Jun 2019 16:56:03 -0700 Date: Fri, 21 Jun 2019 16:55:41 -0700 From: Ricardo Neri To: Thomas Gleixner Cc: Jacob Pan , Kate Stewart , Peter Zijlstra , Jan Kiszka , Ricardo Neri , Stephane Eranian , Ingo Molnar , Wincy Van , Ashok Raj , x86 , Andi Kleen , Borislav Petkov , "Eric W. Biederman" , "Ravi V. Shankar" , Bjorn Helgaas , Juergen Gross , Tony Luck , Randy Dunlap , LKML , iommu@lists.linux-foundation.org, Philippe Ombredanne Subject: Re: [RFC PATCH v4 20/21] iommu/vt-d: hpet: Reserve an interrupt remampping table entry for watchdog Message-ID: <20190621235541.GA25773@ranerica-svr.sc.intel.com> References: <1558660583-28561-21-git-send-email-ricardo.neri-calderon@linux.intel.com> <20190619084316.71ce5477@jacob-builder> <20190621103126.585ca6d3@jacob-builder> <20190621113938.1679f329@jacob-builder> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 21, 2019 at 10:05:01PM +0200, Thomas Gleixner wrote: > On Fri, 21 Jun 2019, Jacob Pan wrote: > > On Fri, 21 Jun 2019 10:31:26 -0700 > > Jacob Pan wrote: > > > > > On Fri, 21 Jun 2019 17:33:28 +0200 (CEST) > > > Thomas Gleixner wrote: > > > > > > > On Wed, 19 Jun 2019, Jacob Pan wrote: > > > > > On Tue, 18 Jun 2019 01:08:06 +0200 (CEST) > > > > > Thomas Gleixner wrote: > > > > > > > > > > > > Unless this problem is not solved and I doubt it can be solved > > > > > > after talking to IOMMU people and studying manuals, > > > > > > > > > > I agree. modify irte might be done with cmpxchg_double() but the > > > > > queued invalidation interface for IRTE cache flush is shared with > > > > > DMA and requires holding a spinlock for enque descriptors, QI tail > > > > > update etc. > > > > > > > > > > Also, reserving & manipulating IRTE slot for hpet via backdoor > > > > > might not be needed if the HPET PCI BDF (found in ACPI) can be > > > > > utilized. But it might need more work to add a fake PCI device for > > > > > HPET. > > > > > > > > What would PCI/BDF solve? > > > I was thinking if HPET is a PCI device then it can naturally > > > gain slots in IOMMU remapping table IRTEs via PCI MSI code. Then > > > perhaps it can use the IRQ subsystem to set affinity etc. w/o > > > directly adding additional helper functions in IRQ remapping code. I > > > have not followed all the discussions, just a thought. > > > > > I looked at the code again, seems the per cpu HPET code already taken > > care of HPET MSI management. Why can't we use IR-HPET-MSI chip and > > domain to allocate and set affinity etc.? > > Most APIC timer has ARAT not enough per cpu HPET, so per cpu HPET is > > not used mostly. > > Sure, we can use that, but that does not allow to move the affinity from > NMI context either. Same issue with the IOMMU as with the other hack. If I understand Thomas' point correctly, the problem is having to take lock in NMI context to update the IRTE for the HPET; both as in my hack and in the generic irq code. The problem is worse when using the generic irq code as there are several layers and several locks that need to be handled. Thanks and BR, Ricardo