Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1754789ybi; Sun, 16 Jun 2019 12:27:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqwgd3a8kaV66j1q6ZKe2+cwD+if3/mVt1JlFG5LvZw3dtj0kU4Kc2iXoYcbiuKTEirj1/XA X-Received: by 2002:a17:90a:a407:: with SMTP id y7mr22471753pjp.97.1560713230650; Sun, 16 Jun 2019 12:27:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560713230; cv=none; d=google.com; s=arc-20160816; b=GZSaaYZdT1OZvp4yYsum6PZIb7OOGeUpPjDayMVu45NPn6ljCfRxJgzOjAF0PSyUfK wn2dSQ5LZx64hNltEoXb3m1BLFZr5WffsqJuqHUMBqvfQsMAqomateW8n7aDypKiDJEO VkordOfT7QnIJRCOFz0TBfElxY01XKHuX9RiNmz1TiutKE8xJ58k/Vx5IW+Dy9SfW3g5 lYa+7PAkVWwIZNX/lnwGVBR4Bik0yevFoe/BC1trJOQbqLasHKP8dr7fj4fLGD6xpXZa rkejAcMOfG4KVv+RoBh5RXwZOhtORGnqlgZ9IntYtCKy/T3ttgYcsEq9zXxQvkxNt8fl oKPw== 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=ciNCIh7+ZJmz2koAFco/QDPKaLyQk98QXbG48YwwtvY=; b=eCBW1/wHPFkxOreZSs4f53MGaBEOz0RPiSWsU1F79PI/T5GE06UgPb+loo0zG9bJk8 sXDlVOVgx3L2owGhcge74CGPSFRKY4dRNjpYv5Ykqeyb/YzqdveQ/tshNyHZU+9cCkAY c4fICbz0UXPkTFsvLEnmHJqiGzZUeA4oOBNkkzGl0yPSAQJ2qwl1buElQNdPWEjS51mx AAfIWBJVrQbT2rUff5YzEQ3zKqM8XX/jVwXTuDGl/Bs2wXd17/hst+OWRgl3SngjufnC NQzEFWiM+ZbIRWWVUmUBbJ5HTz9NuGak63GNKjEupWFrxjVx343JSUpSGI2EkuGiQGDF hc8g== 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 i3si7642596pjt.82.2019.06.16.12.26.44; Sun, 16 Jun 2019 12:27:10 -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 S1727351AbfFPTWA (ORCPT + 99 others); Sun, 16 Jun 2019 15:22:00 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:42022 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726085AbfFPTWA (ORCPT ); Sun, 16 Jun 2019 15:22:00 -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 1hcaip-0004SH-H1; Sun, 16 Jun 2019 21:21:47 +0200 Date: Sun, 16 Jun 2019 21:21:46 +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 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. Brilliant. > +int hld_hpet_intremap_activate_irq(struct hpet_hld_data *hdata) > +{ > + u32 destid = apic->calc_dest_apicid(hdata->handling_cpu); > + struct intel_ir_data *data; > + > + data = (struct intel_ir_data *)hdata->intremap_data; > + data->irte_entry.dest_id = IRTE_DEST(destid); > + return modify_irte(&data->irq_2_iommu, &data->irte_entry); This calls modify_irte() which does at the very beginning: raw_spin_lock_irqsave(&irq_2_ir_lock, flags); How is that supposed to work from NMI context? Not to talk about the other spinlocks which are taken in the subsequent call chain. You cannot call in any of that code from NMI context. The only reason why this never deadlocked in your testing is that nothing else touched that particular iommu where the HPET hangs off concurrently. But that's just pure luck and not design. Thanks, tglx