Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp686215rdb; Mon, 29 Jan 2024 15:17:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IGgkN7p+RbvCRyLKcyCk5OEgFenICQ0F/XRYJ9YhKahzzEBIGGXsq3T2yjvsMxy3+5grw6K X-Received: by 2002:a05:651c:d6:b0:2cd:690d:5d37 with SMTP id 22-20020a05651c00d600b002cd690d5d37mr5599904ljr.29.1706570246987; Mon, 29 Jan 2024 15:17:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706570246; cv=pass; d=google.com; s=arc-20160816; b=VVqvRBKgnU/ye4mD6m78odcq+UNDqVNDF5mK3pCc8KJDdOoFDxJrLZbbrnpIDPJKJj 6OBStEjNJg7CeK1fhrCCMu82OfO5yoiRpTrpm3l/bze/HXm4Zs8n4QGBJfC9gx+zOpHU Kp5OxqR4g6tX7UiVRp2+CzsZUkETW0kcDOCFNvO1nSc+7ElPKfyqrVNZZuvW44Y4VZ1z Ye1BzIC7vOIgBMvfOwADFMOBmlUvIP7ud2xnoFHopSl5snMeXI4KFdNwwcqee9qMV1pg 5YsbgFlTENGbTAboPcDusd7pc9a9zbdj4BuAt93IojbdSjSPAQDwzeSCqN+7XXnOso82 aQ2A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:dkim-signature:date; bh=WLuRlRCwuI6asqqMQ9nqwhi3i/dMRQr3XJD+CfB0Xy4=; fh=YM+TSl7LBENJyGDRywQAEXSjII4s7z/y3aQN2wCwd18=; b=Oaq6XUsg564ADDvtW6v0tgRqGAlcvrIjxHU7kuZDh1m1SAGxM7RT0RiDfZm8wFQb/b 7Vy1OuliZoxnoWHoIPHG3BUhM6KtL7yo1DqeVyfXXiIRKIBrpoPQ4jB5FIkNDebNed2O I6NnKboBDgN5siHmvvU3dxPojFRVKdZ/TLR4jKzEt2I/K8E1QEd7cY72Uckhvp6p7dnY EBhmtbeJgqNj+NXCGTCiAcA3F7EWhUFafsZ4ELtu4AbgGURL+V65Dd1GXmec3GJmis0c dSHhS1N3M5PdYY/RvbmooM70IOMuL5D/fs1mO/fnGF13xQzpG849E3Sujgq2PXxg8cig JY5A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=admD522d; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-43613-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-43613-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id j8-20020a50ed08000000b0055cfdb0dfb2si4017042eds.512.2024.01.29.15.17.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 15:17:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-43613-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=admD522d; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-43613-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-43613-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev 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 am.mirrors.kernel.org (Postfix) with ESMTPS id B515E1F23D2C for ; Mon, 29 Jan 2024 23:17:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 20D4753802; Mon, 29 Jan 2024 23:17:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="admD522d" Received: from out-174.mta1.migadu.com (out-174.mta1.migadu.com [95.215.58.174]) (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 5EFF64C3D4 for ; Mon, 29 Jan 2024 23:17:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706570235; cv=none; b=XfB5ZaT7GOtbW29nEke1UsqovR4KLM7/iVjoX5gDe35J7SFZdodntpBmlEgd4+WQCUqCJ+xCa1L4eG993mCYlbeg6A0YvvC02z7OFeqKooQKGPrIpfhkEtVKV0tlGTH4uS9m9+kI5HpsBfwiJGKLsOtHpDmvuHC9ZBPf/R6186s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706570235; c=relaxed/simple; bh=w/QfgsSmE5DAFlEeJou+7szSE6ht1mKclUNhYbABw6A=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=IMceTkRIcIY2E1qxRlugKzmb2biMwi9tfL2ZWrJaegA+XfSz93XCJn3hkRo8K4G9IiJnW5pR+eaY3paQAxEF0ws8Zuuvo9xnUm+zsMMUVC9aQiPkGcpQbsQfrlHFh9IIrR+k/iamZ04VP5PstqDxfWa1HJlYHZBb0/vuQn0s6ek= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=admD522d; arc=none smtp.client-ip=95.215.58.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Date: Mon, 29 Jan 2024 23:17:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1706570231; 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=WLuRlRCwuI6asqqMQ9nqwhi3i/dMRQr3XJD+CfB0Xy4=; b=admD522d8Nl6IR0vun3fAoB/CzcnGnamlNUcMKTFhvtQQykH72MoRtbwWmbwRbNv//uele plUr+qqVTK36LEGYcFj9OCElFiDiG5pC6pTG/5pCGLPP790dCQqnv52d2zejGFImLx8lKv HfyseVmIXjQ+Y4HHjuc+7ZrcDXW1U24= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: Colton Lewis Cc: kvm@vger.kernel.org, Marc Zyngier , James Morse , Suzuki K Poulose , Zenghui Yu , Catalin Marinas , Will Deacon , Paolo Bonzini , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] KVM: arm64: Add capability for unconditional WFx passthrough Message-ID: References: <20240129213918.3124494-1-coltonlewis@google.com> 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-Disposition: inline In-Reply-To: <20240129213918.3124494-1-coltonlewis@google.com> X-Migadu-Flow: FLOW_OUT Hi Colton, On Mon, Jan 29, 2024 at 09:39:17PM +0000, Colton Lewis wrote: > Add KVM_CAP_ARM_WFX_PASSTHROUGH capability to always allow WFE/WFI > instructions to run without trapping. Current behavior is to only > allow this if the vcpu is the only task running. This commit keeps the > old behavior when the capability is not set. > > This allows userspace to set deterministic behavior and increase > efficiency for platforms with direct interrupt injection support. Marc and I actually had an offlist conversation (shame on us!) about this very topic since there are users asking for the _opposite_ of this patch (unconditionally trap) [*]. I had originally wanted something like this, but Marc made the very good point that (1) the behavior of WFx traps is in no way user-visible and (2) it is entirely an IMP DEF behavior. The architecture only requires the traps be effective if the instruction does not complete in finite time. We need to think of an interface that doesn't depend on implementation-specific behavior, such as a control based on runqueue depth. [*] https://lore.kernel.org/kvmarm/a481ef04-ddd2-dfc1-41b1-d2ec45c6a3b5@huawei.com/ -- Thanks, Oliver