Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp606426pxb; Thu, 30 Sep 2021 12:57:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxL4M/F8IjWMF0q8v6GSMW0CS3AFLRmH4bLl0s2ODMpE5Ybl3oTZycgXSzsC2LkiPmv8EfB X-Received: by 2002:a17:906:2ed1:: with SMTP id s17mr1358999eji.261.1633031876072; Thu, 30 Sep 2021 12:57:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633031876; cv=none; d=google.com; s=arc-20160816; b=vL8k3JOAP0d76vpNIr5k0kewsx5oLhfHhi+y0JAEO8TMZKv8V+EW+uFXOlZRUQ41ND b1YVANEE81vGodHcPIbKwHK3uy4zRZwCPrQ/qNNcsq4bQRh5VT8J2axJ8Y3+wjqXfB5K DCqq62e0liHd4d1ufJe/DQNdleljrNlGTkhT0vtubskokOchsmLJCkg4jHB1MRj0jyEY rYvBgefh58XeLr0NCLb4IQElEiYjcIgAFTCz8+IGAGRJXXW1lij6J1qM+wrevsWxq+5b Df5fXlsyKKSE5Qb0kXz0nl/xAZu1wSOFpQYdENFvgu7oLx8lWGF74dfpIgV4c+ha7mt0 Xdeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=AIdCSYbm8ik7U+N6WK8d0kVM6bR1OsN7ZyYesBKBQCM=; b=Sc/0C0P/82eWyYT6URV3L6bNNy6jInx9qAkzDCU0fWG9h9D4ZZPF5Ict6OmPFI5DAq OwZ9H79mF51nDdA5RaQRqLmOz78VEts76r2Jld0R9oDHPfQBs+GUSErX1wcyKfang0n+ G+tBBs2NTddX1xR9ilkoxMIR2Ghps1B/U4/MTiAe4FLEM/FQeJa3rYH0AxKPNidtczVt rxBm/k/ebfUyU6oa2KFa8GJqIbVfXgWy/W7WkuKOvJBmWnggnkfscJQu54c+eAA5yL6f feB3TFqfNy5i0qja8g8vYi1/8YcDdOZ5HLTNxmz43chk4nU+K1cWdlTcP/cM3I+bY1A3 +2aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=LZSN5dm7; dkim=neutral (no key) header.i=@linutronix.de header.b=rJPlIqbk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p22si4008816ejm.526.2021.09.30.12.57.29; Thu, 30 Sep 2021 12:57:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=LZSN5dm7; dkim=neutral (no key) header.i=@linutronix.de header.b=rJPlIqbk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240433AbhI3TbW (ORCPT + 99 others); Thu, 30 Sep 2021 15:31:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229600AbhI3TbS (ORCPT ); Thu, 30 Sep 2021 15:31:18 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78994C06176A; Thu, 30 Sep 2021 12:29:35 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1633030173; 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=AIdCSYbm8ik7U+N6WK8d0kVM6bR1OsN7ZyYesBKBQCM=; b=LZSN5dm7wppSXaxVXLB/LjNGJetLP/IT5oWLaUEObCWihxjRDlRB9NJPIWatWaMwqQPx7W jw3rD5dj736d4lWN3WDUDiWguPq5kEfQUJIA3z8i+vUs+KkalFhtATH8fB+e7s1RCll0ZW KGuRUrl4h+GHw1eszR99Vihp01mPzvQuuyYaU/NJWoc6tv9sq8tibPBmrFKXTF20EXWSB3 3cfUmk1RwpApIHHRclMAz+6gPLcRF0jit8LOn6QZLcnmBYZ17bXcwtIdI7DaGIXd9NQSpF m/yLUIV5hDHoWLvh7rEpd8env6CUg5v6LPHDYUbKEJPqF1c4flLqUYyRIaTA2A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1633030173; 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=AIdCSYbm8ik7U+N6WK8d0kVM6bR1OsN7ZyYesBKBQCM=; b=rJPlIqbkUDGzGH6aIb23aL/mCDYZZ7u09DaDe2jY8HBzsD/KRAYer52sgY3urDo5GHIpt/ axkXkL5JtfpUXjDA== To: Andy Lutomirski , Sohil Mehta , the arch/x86 maintainers Cc: Tony Luck , Dave Hansen , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Jens Axboe , Christian Brauner , "Peter Zijlstra (Intel)" , Shuah Khan , Arnd Bergmann , Jonathan Corbet , Raj Ashok , Jacob Pan , Gayatri Kammela , Zeng Guang , "Williams, Dan J" , Randy E Witt , "Shankar, Ravi V" , Ramesh Thomas , Linux API , linux-arch@vger.kernel.org, Linux Kernel Mailing List , linux-kselftest@vger.kernel.org Subject: Re: [RFC PATCH 11/13] x86/uintr: Introduce uintr_wait() syscall In-Reply-To: References: <20210913200132.3396598-1-sohil.mehta@intel.com> <20210913200132.3396598-12-sohil.mehta@intel.com> Date: Thu, 30 Sep 2021 21:29:32 +0200 Message-ID: <877dex7tgj.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 30 2021 at 11:08, Andy Lutomirski wrote: > On Tue, Sep 28, 2021, at 9:56 PM, Sohil Mehta wrote: > I think we have three choices: > > Use a fancy wrapper around SENDUIPI. This is probably a bad idea. > > Treat the NV-2 as a real interrupt and honor affinity settings. This > will be annoying and slow, I think, if it's even workable at all. We can make it a real interrupt in form of a per CPU interrupt, but affinity settings are not really feasible because the affinity is in the UPID.ndst field. So, yes we can target it to some CPU, but that's racy. > Handle this case with faults instead of interrupts. We could set a > reserved bit in UPID so that SENDUIPI results in #GP, decode it, and > process it. This puts the onus on the actual task causing trouble, > which is nice, and it lets us find the UPID and target directly > instead of walking all of them. I don't know how well it would play > with hypothetical future hardware-initiated uintrs, though. I thought about that as well and dismissed it due to the hardware initiated ones but thinking more about it, those need some translation unit (e.g. irq remapping) anyway, so it might be doable to catch those as well. So we could just ignore them for now and go for the #GP trick and deal with the device initiated ones later when they come around :) But even with that we still need to keep track of the armed ones per CPU so we can handle CPU hotunplug correctly. Sigh... Thanks, tglx