Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1841749rdb; Wed, 31 Jan 2024 10:38:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IGFnvSa1WrJI3NPwhgS1S1hAbDP1tqf7hLj61ykg1b21i0/y5KlQvgAJ+sC5CTlfaRBmWw5 X-Received: by 2002:a05:620a:94c:b0:784:15d:dfab with SMTP id w12-20020a05620a094c00b00784015ddfabmr130348qkw.34.1706726304269; Wed, 31 Jan 2024 10:38:24 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706726304; cv=pass; d=google.com; s=arc-20160816; b=1GzLnX2kIAVKMcVfQNvW3V6iyLJrEuhE7XWvXoohgbakSoGHda9S+/DOkcYbPWoISS 8IiRTxyGet91pCHSaNW23yh6+i5WR6SS+siHh9f8PHbdYLGG2eGHoRFZGmhL5p/Ea33K AfIc0Y4rrVVFvvxQv8esZYHnch1W86fyiHUuDAWC/U/usJv9ZQu0dqysmbO0vTPb9XRc gCChn/KCJ9Hw3ewKlM2TyBaUU1ozjn97ENANUrwxw3SLoWSpulftIqdJ9VI83T78NTuY lP/fWrfxI7JuLX+70bz/+HCbSb+QjkmiUIUdY5bN3ic2xDXDuneF5YFz8He8MYTE90iR kUHw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:in-reply-to:date:dkim-signature; bh=B+7qh5lgqKvRJ5XTxEYs6sYIXkTaK5rzWchXA2WiWMs=; fh=Mf/doKvZPSIUXNHErWdR0muCR9JlB7gCS/wG+4Rk2X0=; b=GZiT9FKHnw6KHva+ykCRKAS6QCc2mAJBXOuL2CjXlV2p3V8tlyzCxk6f/8CXc4y6Bi o4QyJW7oppAwVDocN7G5wVvJOGEbtAbmrs4VXf8b3EnPcnrhB5PwwpqORNbsue/qemuW VEdL9grAPZRJXysXM12izXdkySr/vLfxHfJDokV5jUV4nej0otoJzvTRa0WyUo0YG6lT FeSbwXPfzgnUPLNspveCV07sQirXGkB+gPVXLZHhuIkY6atolJsnKfscKF2JVNxlPS9M leZXP0rA7+xS73fsN4D3atup+rAlTbwGR0RILpDwe6vPBf1CdGy0piZQTP6oUO0MJZH6 K+8Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=3GSMaXoh; arc=pass (i=1 spf=pass spfdomain=flex--coltonlewis.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-46974-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46974-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com X-Forwarded-Encrypted: i=1; AJvYcCXJoPnY9BwMBXDVxhkx+DQpNGAOkKd4xzhygJxvB3B8yUS392gVAx7wZsNjHfE/BIbJi+7UPwxMyons2NpWaPKZzdkvG8pvvRHJyanRFA== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id dv15-20020a05620a1b8f00b0078534eb8d7fsi3456606qkb.125.2024.01.31.10.38.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 10:38:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-46974-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=3GSMaXoh; arc=pass (i=1 spf=pass spfdomain=flex--coltonlewis.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-46974-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46974-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 03CFF1C22407 for ; Wed, 31 Jan 2024 18:38:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 415152134F; Wed, 31 Jan 2024 18:38:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="3GSMaXoh" Received: from mail-io1-f74.google.com (mail-io1-f74.google.com [209.85.166.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E296D1805F for ; Wed, 31 Jan 2024 18:38:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.74 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706726294; cv=none; b=t5zIB5z7nXJ7ThRHm4OFDt0YMUZMrh/QyEOMLiu4YD4hrBLuvHr8m49tBU1k9ocw4amuMkacfWfQ7Pnnw+xH3WSXl96faVbErBRCYnkqBzxvqPtibCk39lfc0oI8vNf6z6dK/q/9HgrrrxSw5mAMCBo3mdoySQ3hGC40Z3pNEdE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706726294; c=relaxed/simple; bh=UfjYc4q1VOylXIyltW4pByW+ntMGUUi2w22Mn2XGXdw=; h=Date:In-Reply-To:Mime-Version:Message-ID:Subject:From:To:Cc: Content-Type; b=XrAQBAM/e+cOQVDgIl1agn0ZZ6YhwgWJbv9WxAm+RU6PT5XKVOfaEIPOAKw/v2RxuwX9rjcUnZ8C9G5/+I3w8Ulxq0jTXo5JcNsvck8jOlmPpfBC2mcss3rpGa/RfAeyMFL/9lS5rT7hpWMpL32H0TK+8rVABurfP6TlZ7EfW+c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--coltonlewis.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=3GSMaXoh; arc=none smtp.client-ip=209.85.166.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--coltonlewis.bounces.google.com Received: by mail-io1-f74.google.com with SMTP id ca18e2360f4ac-7bf4698825eso7772539f.0 for ; Wed, 31 Jan 2024 10:38:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1706726292; x=1707331092; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:in-reply-to:date:from:to :cc:subject:date:message-id:reply-to; bh=B+7qh5lgqKvRJ5XTxEYs6sYIXkTaK5rzWchXA2WiWMs=; b=3GSMaXohKe/sOzam4ctApjW8NDYxjXk4Hu/WRuY3k693uQdeeehFaRbc26X4eMbvsC L/lAkqgbe2dweTQ02A78sLyEQ1Mhz+BpBbDctwiWw8Emy4iYbdNnf0yvN/IEHVbIxKm2 1WBl2+QkvepiqxpIGigbzawtV+05aIXbRWApWfn6V+c8KWegO/WrA0xTVqMFaDuss+TT SdEo+9VQJS/V1Mem5j9DDH2tAO9IYZK+4x1BFgA8nBCTOUboG5hTh0rFsx5X1k2CANIm SCx6x/hBI3o7TjTH1DEvG+KRuhWbcr0SuOFwsmvkestp0pCmxCMqC3dcf4NOLDsDvqGu kI6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706726292; x=1707331092; h=cc:to:from:subject:message-id:mime-version:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=B+7qh5lgqKvRJ5XTxEYs6sYIXkTaK5rzWchXA2WiWMs=; b=o4szlAbjEZfWUwGpVKY/kreofHeg0eV7NgdKK30rJxC25PPUlhos5IA0ZdVGAlWNht J6710BiHLRNtpA9dKm9FMvH0QovVCVfROcv/8MfYa2B+Yn9oOJC1Rbfcx4dbPuh0Clek 6kkWFA8DWqpnp0d+fhlTl9RRbyma2RtAxIFEFJU3h4wKCsdpkZhaq0qFX4oL84liasG3 5HOZxybTntz4e/mBJzMlyHW25GBTWJGLLYogwhK/tCXAX/uhkm/1xNijgKm4etsSzhSK 0Btb5N7TOgZidzNKILAjKP8pRz5O8Pd29Kx6bdfnb8vManXjEmYkduqtf1w5lTP5MgfF sWSA== X-Gm-Message-State: AOJu0YwTeax8RILlbY5mU8XiSoQfKI3D1jxiUD8Td82RkrEHu8o5ruvy kDEpAXY7t+0hrINh5J3ngSVDDVkdSzOM4aXdmpIKtq1ogutK7UB1M0p6zY4iiVQ0CRYs8BAiM6n tn192jYznEJGk3a3yrnvXfg== X-Received: from coltonlewis-kvm.c.googlers.com ([fda3:e722:ac3:cc00:2b:ff92:c0a8:14ce]) (user=coltonlewis job=sendgmr) by 2002:a5d:9c07:0:b0:7bf:ff87:209f with SMTP id 7-20020a5d9c07000000b007bfff87209fmr25977ioe.2.1706726292022; Wed, 31 Jan 2024 10:38:12 -0800 (PST) Date: Wed, 31 Jan 2024 18:38:10 +0000 In-Reply-To: (message from Oliver Upton on Mon, 29 Jan 2024 23:17:06 +0000) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Message-ID: Subject: Re: [PATCH] KVM: arm64: Add capability for unconditional WFx passthrough From: Colton Lewis To: Oliver Upton Cc: kvm@vger.kernel.org, maz@kernel.org, james.morse@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, catalin.marinas@arm.com, will@kernel.org, pbonzini@redhat.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8"; format=flowed; delsp=yes Oliver Upton writes: > 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. Good to know. I'll be thinking about that. > [*] > https://lore.kernel.org/kvmarm/a481ef04-ddd2-dfc1-41b1-d2ec45c6a3b5@huawei.com/ > -- > Thanks, > Oliver