Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1725105ybi; Sun, 16 Jun 2019 11:43:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqzEwRVfto5ulwnizDbgpExRv9ZGRMc50gWWBgTRsLKaUMX0fsPUWMkIqvtUnElaQTPx9MjE X-Received: by 2002:a63:2ace:: with SMTP id q197mr45140255pgq.102.1560710623879; Sun, 16 Jun 2019 11:43:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560710623; cv=none; d=google.com; s=arc-20160816; b=nI0LIwd2vKPjk5YD2zJIpvQoi2Mt/+eClpc5YUqlNoq8vNPoRW32Q0Uh2FTh6P6IoE uEMO/qtnxQtrXTnETvgTfWa/TqZUnneMfQz8d2QbNUUrKziNSuNamfIMgtV2K1j25w9D xwJxiLYnu6nc+so4Sz9MYRZGb1I7wi+ZcqzZCknMiafY/wkPEns0nC0axeCZaKCdt0sN 81MzbbICTTwHq2bu8+W11c3na9/afqpWH1TkLtw7LQe828+OjuTfiR3QaaTxYXyfxOfQ wVSzpuV65oa58r4/0lNwuo4CmN9ElWRgDYxeiL3lfJ0kDpowOApy4GnAzO084QEDWS8Q llJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=2Vnv3xA0SCrWwBRpHaZyWFxhBhAM13EgW/Hvi/TWLeI=; b=A8g2QDqSu8tcDHyZUNOhvDjON4t3zzJOGnAtEeVQBsxgVap3ymh7NgeVG+AdBovY6L 6Ap4NX3Tefh4eC/jYKcJ+PLCXbS/LPrXplo00CBjJhMMtO8zGG1UzEKK96IYzYHDAsIJ bvVPjcT0myLtDyMsJc0PzEzcwE353GxrxPwdEyQM/pModfHbxz6rab+ke/v9l5O5gXyc AMGMRiayXFLYnicW8wXF9mPwBgeuOSX0/MoNh3qnNArKxNBxA9stt/iYN9Lnr2O+5OCG URvH3dJ8z71j/ZyhzKt152OEzmWdzn//8BKchESL5iH5JL5ZEqHkl1iVT4V+dhoAsAJH qynQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u18si8020686plq.311.2019.06.16.11.43.29; Sun, 16 Jun 2019 11:43:43 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727329AbfFPSml (ORCPT + 99 others); Sun, 16 Jun 2019 14:42:41 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:41993 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725947AbfFPSmk (ORCPT ); Sun, 16 Jun 2019 14:42:40 -0400 Received: from p5b06daab.dip0.t-ipconnect.de ([91.6.218.171] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1hca6i-0002sP-VE; Sun, 16 Jun 2019 20:42:25 +0200 Date: Sun, 16 Jun 2019 20:42:23 +0200 (CEST) From: Thomas Gleixner To: Ricardo Neri cc: Ingo Molnar , Borislav Petkov , Ashok Raj , Joerg Roedel , Andi Kleen , Peter Zijlstra , Suravee Suthikulpanit , Stephane Eranian , "Ravi V. Shankar" , Randy Dunlap , x86@kernel.org, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, Ricardo Neri , Tony Luck , Jacob Pan , Juergen Gross , Bjorn Helgaas , Wincy Van , Kate Stewart , Philippe Ombredanne , "Eric W. Biederman" , Baoquan He , Jan Kiszka , Lu Baolu Subject: Re: [RFC PATCH v4 20/21] iommu/vt-d: hpet: Reserve an interrupt remampping table entry for watchdog In-Reply-To: <1558660583-28561-21-git-send-email-ricardo.neri-calderon@linux.intel.com> Message-ID: References: <1558660583-28561-1-git-send-email-ricardo.neri-calderon@linux.intel.com> <1558660583-28561-21-git-send-email-ricardo.neri-calderon@linux.intel.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 23 May 2019, Ricardo Neri wrote: > When interrupt remapping is enabled, MSI interrupt messages must follow a > special format that the IOMMU can understand. Hence, when the HPET hard > lockup detector is used with interrupt remapping, it must also follow this > special format. > > The IOMMU, given the information about a particular interrupt, already > knows how to populate the MSI message with this special format and the > corresponding entry in the interrupt remapping table. Given that this is a > special interrupt case, we want to avoid the interrupt subsystem. Add two > functions to create an entry for the HPET hard lockup detector. Perform > this process in two steps as described below. > > When initializing the lockup detector, the function > hld_hpet_intremap_alloc_irq() permanently allocates a new entry in the > interrupt remapping table and populates it with the information the > IOMMU driver needs. In order to populate the table, the IOMMU needs to > know the HPET block ID as described in the ACPI table. Hence, add such > ID to the data of the hardlockup detector. > > When the hardlockup detector is enabled, the function > hld_hpet_intremapactivate_irq() activates the recently created entry > in the interrupt remapping table via the modify_irte() functions. While > doing this, it specifies which CPU the interrupt must target via its APIC > ID. This function can be called every time the destination iD of the > interrupt needs to be updated; there is no need to allocate or remove > entries in the interrupt remapping table. And except for a few details all of this functionality exists today. There is no need to hack HPET NMI specific knowledge into the irq remapping driver. And of course to unbreak AMD you'd have to copy the same hackery into the AMD interrupt remapping code. More lines of duplicated duct tape code are better to maintain, right? Sigh. tglx