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=-6.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 63168C433E9 for ; Thu, 18 Mar 2021 16:43:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3387764F2A for ; Thu, 18 Mar 2021 16:43:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232151AbhCRQmb (ORCPT ); Thu, 18 Mar 2021 12:42:31 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:54344 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232191AbhCRQmI (ORCPT ); Thu, 18 Mar 2021 12:42:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616085728; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=w9mQxWNnMTssOskHnAPG1oAnNBJ6d1DSK5jOvwHv+88=; b=OMba7aDPnvK8/JJm0MDdBII8jjyfC+kh1H7UOIrEzQGeYa2eLQKF+X4PWV7nKSf9lyg5VA 7XEd52bAEbrOz0nFbHorU3hyE6C8eRgLh4j0IgcqGMY/XmX1vvPhSu/tjUyGeDahVGGGHk M1wgi5HB7jY1S69lb1DHtUgsS1QoNes= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-467-WcOpsJfMMjmIsOroWLMHuQ-1; Thu, 18 Mar 2021 12:42:06 -0400 X-MC-Unique: WcOpsJfMMjmIsOroWLMHuQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4CF31801817; Thu, 18 Mar 2021 16:42:03 +0000 (UTC) Received: from starship (unknown [10.35.206.85]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9DE4810023B0; Thu, 18 Mar 2021 16:41:58 +0000 (UTC) Message-ID: <7169229dde171c8e10fb276ff8e1a869af99b39d.camel@redhat.com> Subject: Re: [PATCH 3/3] KVM: SVM: allow to intercept all exceptions for debug From: Maxim Levitsky To: Sean Christopherson , Joerg Roedel Cc: kvm@vger.kernel.org, Vitaly Kuznetsov , linux-kernel@vger.kernel.org, Thomas Gleixner , Wanpeng Li , Kieran Bingham , Jessica Yu , Jan Kiszka , Andrew Morton , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , Jim Mattson , Borislav Petkov , Stefano Garzarella , "H. Peter Anvin" , Paolo Bonzini , Ingo Molnar , Borislav Petkov Date: Thu, 18 Mar 2021 18:41:57 +0200 In-Reply-To: References: <20210315221020.661693-1-mlevitsk@redhat.com> <20210315221020.661693-4-mlevitsk@redhat.com> <4116d6ce75a85faccfe7a2b3967528f0561974ae.camel@redhat.com> <8ba6676471dc8c8219e35d6a1695febaea20bb0b.camel@redhat.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-2.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2021-03-18 at 16:35 +0000, Sean Christopherson wrote: > On Thu, Mar 18, 2021, Joerg Roedel wrote: > > On Thu, Mar 18, 2021 at 11:24:25AM +0200, Maxim Levitsky wrote: > > > But again this is a debug feature, and it is intended to allow the user > > > to shoot himself in the foot. > > > > And one can't debug SEV-ES guests with it, so what is the point of > > enabling it for them too? You can create a special SEV-ES guest which does handle all exceptions via #VC, or just observe it fail which can be useful for some whatever reason. > > Agreed. I can see myself enabling debug features by default, it would be nice > to not having to go out of my way to disable them for SEV-ES/SNP guests. This does sound like a valid reason to disable this for SEV-ES. > > Skipping SEV-ES guests should not be difficult; KVM could probably even > print a message stating that the debug hook is being ignored. One thought would > be to snapshot debug_intercept_exceptions at VM creation, and simply zero it out > for incompatible guests. That would also allow changing debug_intercept_exceptions > without reloading KVM, which IMO would be very convenient. > So all right I'll disable this for SEV-ES. The idea to change the debug_intercept_exceptions on the fly is also a good idea, I will implement it in next version of the patches. Thanks for the review, Best regards, Maxim Levitsky