Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp3281378rdb; Thu, 16 Nov 2023 05:39:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IGVMEaIgs6sSnqf4uRyQ0kR0wkHT+kKaqDO3kmxdMCkbqEQIke4spl6XRmXbkiC6u00NZYO X-Received: by 2002:a05:6a20:144e:b0:187:b995:fb78 with SMTP id a14-20020a056a20144e00b00187b995fb78mr1475970pzi.44.1700141948216; Thu, 16 Nov 2023 05:39:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700141948; cv=none; d=google.com; s=arc-20160816; b=PnK58TaE/EGgTpoAyYWd/4upwZgRpdK6VZHOIoki2II0+a72wrr2KSxJwJ4mn8te/1 1sNiNbnfXg9OobOT4qfH44llhthR+4571WQn0hxtSsHbPmYcntXBvaO3TKTMvHhmfYBE RzYNwdXDveV646wkposWiosPX5bnafd9t33l1Aq8Ub5iURDQLServ22pvLZpUSQruqz3 UZ6Vk1UTtz09rCJqsiCOSK9VOFQUsvMdMt2PNuDoKiBwKgcx1QeTaNlbawaprm4laROu TjLYGjATNjVlyqTr7OJgfOD9ojE7loEwOCdEHeogSJFrrtlSrW/F356JktCPmd5tKqTj W2Bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature:dkim-signature; bh=qGlqJ91XgT6zatL0ncRqFs5WPTRXZ76PpGZv2Os9czw=; fh=OgElHhSZJNBMEnAuD678McTWs7xpx31cZbXhJIm6CKc=; b=X8VXOST2LquviylRlx+6oPv1Kb3LyCEJEOw/MEbvR1xEz5KLXOD+r00TN2g8I4cUeU qwnozYOlfvz6nWHCso33RqWbi7osX6jF1xtTbSXgHte3F8p9foLgioN4zq3WOOAfqo+1 A0/XIEOzlf5XVm6+AFu5iecKG/W3DYMDnnSaMXOmexp9PSziRza1uz3FU+g2mntwPl5+ Up+QInPq2ja9Ws8ahOhxf/23loBIFVvEg67HpzzttC+sKjsDvPKCl8aoaCBzHcnWvBbF jTQQwG26DGtiquhVJK4nbCZe+S5UDJe3l9mw1Jwe18Ccw7Qs9WmBgs02KHbjjXgLc9zJ Bcvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=hq7bqN7q; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id jf1-20020a170903268100b001c7347e993esi11666765plb.17.2023.11.16.05.39.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 05:39:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=hq7bqN7q; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id A901480DB72B; Thu, 16 Nov 2023 05:39:04 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345218AbjKPNi4 (ORCPT + 99 others); Thu, 16 Nov 2023 08:38:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344962AbjKPNiz (ORCPT ); Thu, 16 Nov 2023 08:38:55 -0500 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A2C2A0; Thu, 16 Nov 2023 05:38:51 -0800 (PST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 3566F204FF; Thu, 16 Nov 2023 13:38:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1700141930; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qGlqJ91XgT6zatL0ncRqFs5WPTRXZ76PpGZv2Os9czw=; b=hq7bqN7qAkMVa/iDOqLUpaM+RodtpQsEIXkhW46MJ1L/vJzABEr7fQm/j2SI1xgZ1fN3kS QYWfF+IP1dp22stCfFdVlilyvx/wErZ+MckLhYy1mU1xnMhFROj6+vKb0AknLv2SJxoxH0 ZKVr4eJnAuQ076eo78Anb2VZy1+e9Vk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1700141930; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qGlqJ91XgT6zatL0ncRqFs5WPTRXZ76PpGZv2Os9czw=; b=UC4DUtwUxpwUmPDeoE2Kwkgm0sjho0yy1TK7RzO5EZHy58JO53cexW7Cd5YdOX4X3ax2Iu fVx2z4AlhQWg4+CA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id BE626139C4; Thu, 16 Nov 2023 13:38:49 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id Dx7VKmkbVmXgFgAAMHmgww (envelope-from ); Thu, 16 Nov 2023 13:38:49 +0000 From: =?UTF-8?q?Carlos=20L=C3=B3pez?= To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-doc@vger.kernel.org Cc: =?UTF-8?q?Carlos=20L=C3=B3pez?= , Paolo Bonzini , Jonathan Corbet Subject: [PATCH v2] KVM: X86: improve documentation for KVM_CAP_X86_BUS_LOCK_EXIT Date: Thu, 16 Nov 2023 14:36:29 +0100 Message-Id: <20231116133628.5976-1-clopez@suse.de> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Authentication-Results: smtp-out2.suse.de; none X-Spam-Level: X-Spam-Score: -3.30 X-Spamd-Result: default: False [-3.30 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_FIVE(0.00)[6]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MID_CONTAINS_FROM(1.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%] X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Thu, 16 Nov 2023 05:39:04 -0800 (PST) Improve the description for the KVM_CAP_X86_BUS_LOCK_EXIT capability, fixing a few typos and improving grammar for overall clarity. Signed-off-by: Carlos López --- v2: Corrected the name of the KVM_RUN_X86_BUS_LOCK flag Documentation/virt/kvm/api.rst | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Documentation/virt/kvm/api.rst b/Documentation/virt/kvm/api.rst index 7025b3751027..4701370bf46f 100644 --- a/Documentation/virt/kvm/api.rst +++ b/Documentation/virt/kvm/api.rst @@ -6256,9 +6256,9 @@ More architecture-specific flags detailing state of the VCPU that may affect the device's behavior. Current defined flags:: /* x86, set if the VCPU is in system management mode */ - #define KVM_RUN_X86_SMM (1 << 0) + #define KVM_RUN_X86_SMM (1 << 0) /* x86, set if bus lock detected in VM */ - #define KVM_RUN_BUS_LOCK (1 << 1) + #define KVM_RUN_X86_BUS_LOCK (1 << 1) /* arm64, set for KVM_EXIT_DEBUG */ #define KVM_DEBUG_ARCH_HSR_HIGH_VALID (1 << 0) @@ -7582,20 +7582,20 @@ KVM_BUS_LOCK_DETECTION_OFF and KVM_BUS_LOCK_DETECTION_EXIT are supported currently and mutually exclusive with each other. More bits can be added in the future. -With KVM_BUS_LOCK_DETECTION_OFF set, bus locks in guest will not cause vm exits +With KVM_BUS_LOCK_DETECTION_OFF set, bus locks in guest will not cause VM exits so that no additional actions are needed. This is the default mode. -With KVM_BUS_LOCK_DETECTION_EXIT set, vm exits happen when bus lock detected -in VM. KVM just exits to userspace when handling them. Userspace can enforce -its own throttling or other policy based mitigations. - -This capability is aimed to address the thread that VM can exploit bus locks to -degree the performance of the whole system. Once the userspace enable this -capability and select the KVM_BUS_LOCK_DETECTION_EXIT mode, KVM will set the -KVM_RUN_BUS_LOCK flag in vcpu-run->flags field and exit to userspace. Concerning -the bus lock vm exit can be preempted by a higher priority VM exit, the exit -notifications to userspace can be KVM_EXIT_BUS_LOCK or other reasons. -KVM_RUN_BUS_LOCK flag is used to distinguish between them. +With KVM_BUS_LOCK_DETECTION_EXIT set, VM exits happen when a bus lock is +detected in VM. KVM just exits to userspace when handling them. Userspace can +enforce its own throttling or other policy based mitigations. + +This capability is aimed to address the fact that a VM can exploit bus locks to +impact the performance of the whole system. Once userspace enables this +capability and selects the KVM_BUS_LOCK_DETECTION_EXIT mode, KVM will set the +KVM_RUN_X86_BUS_LOCK flag in the vcpu->run->flags field and exit to userspace. +Concerning the bus lock, a VM exit can be preempted by a higher priority VM +exit, so the exit notification to userspace can be KVM_EXIT_BUS_LOCK or another +reason. KVM_RUN_X86_BUS_LOCK flag is used to distinguish between them. 7.23 KVM_CAP_PPC_DAWR1 ---------------------- -- 2.35.3