Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp767589ybg; Sun, 26 Jul 2020 21:41:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwfBvJJ7zkVwZAJLUDDW+pSlJ9KuKM+e65h8DqXMlFP8wMK7IYTXvtL0/ZWrJ7jA0GlZUcr X-Received: by 2002:a17:906:fad1:: with SMTP id lu17mr13723598ejb.127.1595824896492; Sun, 26 Jul 2020 21:41:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595824896; cv=none; d=google.com; s=arc-20160816; b=xrN2icdunQKUiviXp9M5iZFG2frAxRJGfpCTMbnvq0ptvNSuWE+PtkEW+Z1x+Aoxnl Mm8DgeeY98ekszUlE6dFeHX2xmflfl7gVKQ5vARqZTIefpxHBgifWEPTJGJbRVtSrt4l hhS98kPm5A+KOrYIGTHo5TTD3BROlJVhkD+aPWBEDy0rNFYtOmxaKnBhgEhvLQiIwEGe bBEMelsOUuSbZp7PXaG7BTdQlaizIx0X7N52/Fb33RB7JsLLc2HDJMwbe/vcCbx0YbE+ 84RxSGa6jpAQfPvfHoRcmgh0aQfdI+ihBpqZ/VM4/5eWFJ9H2ThcXQYp0TJM43795NJY rmug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:ironport-sdr:ironport-sdr; bh=zMMUJ825FESNlEBnlQZB0mlDrEPRMNVHtK0Q5ZXceW4=; b=ArhtoNkkWRSWoF0dcPAZ0MaV7eqbGre2O8VJYaHhw4Mvvfw7BvVaFkhM2/UA4nea05 A6dG+krYntqR9OYK2qMGdDanmb6p1t0EDgS1OTG+UYuON29dnsuQKKaD7eqdo39BGAUE YLYasOnsRQV/mpaTiQzqZ8WlFNDTRW6T9eqtiylH5Wl2wmqJd2LE/Czl4GHO5eP22l3p qYPTIgwv7OiKegFspjt1xK12znLvmST13Pm0HmEjTE93Kyi6CRAw9mn97YJcD2ay2kkF aK8fNJIm94P1Xc8xuBiy9D7uwj/LLoNy8bxG1cnnZwK3k9/AT86onZp9o6IdKTIKvkPg VOjQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l30si1765070ede.587.2020.07.26.21.41.13; Sun, 26 Jul 2020 21:41:36 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726185AbgG0Ei7 (ORCPT + 99 others); Mon, 27 Jul 2020 00:38:59 -0400 Received: from mga09.intel.com ([134.134.136.24]:18171 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725775AbgG0Ei7 (ORCPT ); Mon, 27 Jul 2020 00:38:59 -0400 IronPort-SDR: oHt++YRZMMtHbKQAZju13K2pWl5Sywl9mgmz5q4fVb/YxhLlJrt39CQ7Axp4Kh9FzW230mRgjg Cxs0KFhWKRrw== X-IronPort-AV: E=McAfee;i="6000,8403,9694"; a="152212542" X-IronPort-AV: E=Sophos;i="5.75,401,1589266800"; d="scan'208";a="152212542" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jul 2020 21:38:58 -0700 IronPort-SDR: L6jOe41O0iqVqciMLpspnbWmF0D/4Y9vYi1l/Y5ngszxIkVL7I31Gq/pAxbYff5Pj9SPokJhGM 6Q7GnAjVYErQ== X-IronPort-AV: E=Sophos;i="5.75,401,1589266800"; d="scan'208";a="463930493" Received: from unknown (HELO [10.239.13.99]) ([10.239.13.99]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jul 2020 21:38:55 -0700 Subject: Re: [RFC 2/2] KVM: VMX: Enable bus lock VM exit To: Sean Christopherson , Vitaly Kuznetsov Cc: Chenyi Qiang , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Paolo Bonzini , Wanpeng Li , Jim Mattson , Joerg Roedel References: <20200628085341.5107-1-chenyi.qiang@intel.com> <20200628085341.5107-3-chenyi.qiang@intel.com> <878sg3bo8b.fsf@vitty.brq.redhat.com> <0159554d-82d5-b388-d289-a5375ca91323@intel.com> <87366bbe1y.fsf@vitty.brq.redhat.com> <87zh8j9to2.fsf@vitty.brq.redhat.com> <20200723012114.GP9114@linux.intel.com> From: Xiaoyao Li Message-ID: Date: Mon, 27 Jul 2020 12:38:53 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200723012114.GP9114@linux.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/23/2020 9:21 AM, Sean Christopherson wrote: > On Wed, Jul 01, 2020 at 04:49:49PM +0200, Vitaly Kuznetsov wrote: >> Xiaoyao Li writes: >>> So you want an exit to userspace for every bus lock and leave it all to >>> userspace. Yes, it's doable. >> >> In some cases we may not even want to have a VM exit: think >> e.g. real-time/partitioning case when even in case of bus lock we may >> not want to add additional latency just to count such events. > > Hmm, I suspect this isn't all that useful for real-time cases because they'd > probably want to prevent the split lock in the first place, e.g. would prefer > to use the #AC variant in fatal mode. Of course, the availability of split > lock #AC is a whole other can of worms. > > But anyways, I 100% agree that this needs either an off-by-default module > param or an opt-in per-VM capability. > Maybe on-by-default or an opt-out per-VM capability? Turning it on introduces no overhead if no bus lock happens in guest but gives KVM the capability to track every potential bus lock. If user doesn't want the extra latency due to bus lock VM exit, it's better try to fix the bus lock, which also incurs high latency. >> I'd suggest we make the new capability tri-state: >> - disabled (no vmexit, default) >> - stats only (what this patch does) >> - userspace exit >> But maybe this is an overkill, I'd like to hear what others think. > > Userspace exit would also be interesting for debug. Another throttling > option would be schedule() or cond_reched(), though that's probably getting > into overkill territory. > We're going to leverage host's policy, i.e., calling handle_user_bus_lock(), for throttling, as proposed in https://lkml.kernel.org/r/1595021700-68460-1-git-send-email-fenghua.yu@intel.com