From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DDB11C43462 for ; Tue, 27 Apr 2021 11:38:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B0058613DD for ; Tue, 27 Apr 2021 11:38:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236065AbhD0Ljb (ORCPT ); Tue, 27 Apr 2021 07:39:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235705AbhD0Lja (ORCPT ); Tue, 27 Apr 2021 07:39:30 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 036D6C061574; Tue, 27 Apr 2021 04:38:47 -0700 (PDT) Received: from zn.tnic (p200300ec2f0c5e008a7c4c8941e22261.dip0.t-ipconnect.de [IPv6:2003:ec:2f0c:5e00:8a7c:4c89:41e2:2261]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 5A0041EC047E; Tue, 27 Apr 2021 13:38:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1619523525; 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: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=IAUQH8ckRL8RHgSocw7BeJrBQn+eUtnbT2dDn+igxMs=; b=JVTU+70sWvRTU+SopM0YlyyGOmgJ6g6s0pfWanKmCpWILaUWfjQC0nNpvbpkUqfQ2RRum2 FEuSSKX1W3ssLIne23n7/XG++M6Vrmnc4wwpffOGYr4mLk1KAEn2IFh+WRvL4uHH763Ts1 j21Ra3QsjV66hv690SzIZHGqkUij9BY= Date: Tue, 27 Apr 2021 13:38:40 +0200 From: Borislav Petkov To: Maxim Levitsky Cc: kvm@vger.kernel.org, "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , Ingo Molnar , Andrew Morton , Thomas Gleixner , Sean Christopherson , Marc Zyngier , Catalin Marinas , open list , Julien Thierry , Stefano Garzarella , Suzuki K Poulose , Jonathan Corbet , Jessica Yu , "H. Peter Anvin" , Jan Kiszka , Will Deacon , "open list:KERNEL VIRTUAL MACHINE FOR ARM64 (KVM/arm64)" , Paolo Bonzini , Vitaly Kuznetsov , Vasily Gorbik , Joerg Roedel , Claudio Imbrenda , Jim Mattson , Cornelia Huck , David Hildenbrand , Wanpeng Li , Janosch Frank , Christian Borntraeger , "open list:S390" , Heiko Carstens , Kieran Bingham , "open list:DOCUMENTATION" , "moderated list:KERNEL VIRTUAL MACHINE FOR ARM64 (KVM/arm64)" , James Morse Subject: Re: [PATCH v2 8/9] KVM: x86: add force_intercept_exceptions_mask Message-ID: References: <20210401135451.1004564-1-mlevitsk@redhat.com> <20210401135451.1004564-9-mlevitsk@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210401135451.1004564-9-mlevitsk@redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 01, 2021 at 04:54:50PM +0300, Maxim Levitsky wrote: > This parameter will be used by VMX and SVM code to force > interception of a set of exceptions, given by a bitmask > for guest debug and/or kvm debug. > > This option is not intended for production. > > This is based on an idea first shown here: > https://patchwork.kernel.org/project/kvm/patch/20160301192822.GD22677@pd.tnic/ > > CC: Borislav Petkov > Signed-off-by: Maxim Levitsky > --- > arch/x86/kvm/x86.c | 3 +++ > arch/x86/kvm/x86.h | 2 ++ > 2 files changed, 5 insertions(+) > > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > index 3627ce8fe5bb..1a51031d64d8 100644 > --- a/arch/x86/kvm/x86.c > +++ b/arch/x86/kvm/x86.c > @@ -176,6 +176,9 @@ module_param(force_emulation_prefix, bool, S_IRUGO); > int __read_mostly pi_inject_timer = -1; > module_param(pi_inject_timer, bint, S_IRUGO | S_IWUSR); > > +uint force_intercept_exceptions_mask; > +module_param(force_intercept_exceptions_mask, uint, S_IRUGO | S_IWUSR); > +EXPORT_SYMBOL_GPL(force_intercept_exceptions_mask); That's nice. I could use some text explaning the usage though, i.e. that thing takes a bitfield of exception vectors, so that I don't have to look at the code each time. :-) Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette