Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1028904rdb; Mon, 19 Feb 2024 01:39:53 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUcmMCO0UFc1s0nB1wjYwlISobVOseeGPdnzKEUyiQtvHjOX9af9LZ4TIfnNRyf4JPTU1Gr1CCaKGapRiExkHFi8ChaU45Aa2idXbBIMg== X-Google-Smtp-Source: AGHT+IH6MEma3lxsTEHjZBkSEpzsh0e7PWzEIF6E+oDL49DaPAzKuxH3xqWri4qhHEP2rmThKvnD X-Received: by 2002:a05:6808:308b:b0:3c1:5f2c:c01b with SMTP id bl11-20020a056808308b00b003c15f2cc01bmr792275oib.39.1708335593212; Mon, 19 Feb 2024 01:39:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708335593; cv=pass; d=google.com; s=arc-20160816; b=sylv2t+eFGbCHNXt95G4B+gps3PeKJ3EDX97dNqeqhgguOY7uvtLJLhJpxjusgj1jw 84ERwZ+e98GlyAHfmoptNpVfuHhHYaGd4N4JYIAe6dFrXFwQmHu4bc+OrFO8OvrRetNK pdjsuW4zoH+J7pZdDnrq3Na72sQY4wxiXKIsPxppDy6UXqk5w2xR7owb4Sd/xXrqnnaE uBlbKK96TE5JSW5OCWgP0H8TkbmTUwDext/OC+mYw+TZnibns19KreVQi38I6CjMUS7Y cNMFoOhWwrl2XWXj/kHw5jmzT4LW4Ggb0QIo2NWrhJubKLy0jOptZuCByr4smjKVIJYm s0Vw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=ZsEBPDeANi8zcUICt28sLBdu1A7ltEwE6ksEcz4Ao2M=; fh=PXd3Iy5HgFXrF/Qi0/oaEArI9yebPf1Hi5jOqE89bMc=; b=T0ECxC8NhjmV24OZPX8PnttSTpvQeMHwMbTINUdUYKOfjhDJI2oaahvu24mChmdFdZ uMp8Grwu+S+uQba74xODgNTMnyy59TkZi2XoSm8AR4HSN5CjxghCSUFLETOqytAignKL y2dMu3o+6W/4mqKHlTGGT8C80GcUEi118WA4+9w0HwhR69aw6/z8i2GrUSqGyQwNGeJr 0fJxq7rQvdlzdR83Jp2PE9dyi/ftpTxLbvWBQjh38hqHqCEsP27Qo9PTYkV9pwHDbJo7 ZJzbB5grRl2V/CUtdNUOt0AD8m9ZDh3oa2XdJiDQnZuZ121gVthNtZuE9IYeUyhrd1GX qxCQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-71044-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71044-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id h28-20020a056a00001c00b006dfec00f49fsi4122576pfk.231.2024.02.19.01.39.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 01:39:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-71044-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-71044-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71044-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 75D26B21659 for ; Mon, 19 Feb 2024 09:38:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A750C2556D; Mon, 19 Feb 2024 09:38:50 +0000 (UTC) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) (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 629CA25556 for ; Mon, 19 Feb 2024 09:38:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.188 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708335530; cv=none; b=uUHgy7CgQW6wRMjyC975WIDA9oU3GPKm5oMnNDkQ/4LRppzvlv/cO4/Lm4JRDzHk372CzlRFmecJWWOO1YQyI+HSFnjWXxWj7YJg7INNyZ70VcKTffNL44jFQGgH1vBWZ9N4TrE2iRGUVKMSyskUC37Bzqf3NexQbARRvauln/I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708335530; c=relaxed/simple; bh=beV3HkcCobjEE+8GR3pJ/U2oTxy49Di4rABAON7noqk=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=lj1LdBukcZpCcJBCF8kQhByfFKhrvizPJGa99acgaoYnMpHRolI5IJq1Swb60iLCLCj9T2zjmvmrvA6Tbbdgf9Zpb86rgfSCarz1JHaz+AC7V15FPyliw/NtOJeqgzTUJkJ5n/0PRa6KCNxbbPyeFuWN4Igy+b7wmLQey15c07k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.188 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.48]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Tdcr055lpzXhDH; Mon, 19 Feb 2024 17:36:48 +0800 (CST) Received: from dggpeml500004.china.huawei.com (unknown [7.185.36.140]) by mail.maildlp.com (Postfix) with ESMTPS id 13CFF18007A; Mon, 19 Feb 2024 17:38:40 +0800 (CST) Received: from [10.174.186.25] (10.174.186.25) by dggpeml500004.china.huawei.com (7.185.36.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 19 Feb 2024 17:38:39 +0800 Message-ID: Date: Mon, 19 Feb 2024 17:38:15 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH] KVM: arm64: Add capability for unconditional WFx passthrough Content-Language: en-US To: Oliver Upton , Marc Zyngier CC: James Morse , Suzuki K Poulose , Zenghui Yu , Catalin Marinas , Will Deacon , Paolo Bonzini , , , , Colton Lewis , References: <20240129213918.3124494-1-coltonlewis@google.com> From: "sundongxu (A)" In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpeml500004.china.huawei.com (7.185.36.140) Hi Marc, Oliver, On 2024/1/30 7:17, Oliver Upton wrote: > 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. If I understand correctly, this run queue belongs to the scheduler, right? And I will be appreciated if you can share any more detail information about this. > > [*] https://lore.kernel.org/kvmarm/a481ef04-ddd2-dfc1-41b1-d2ec45c6a3b5@huawei.com/ > Thanks, Dongxu