Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp707372pxf; Thu, 18 Mar 2021 09:43:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZZlSdaZkxmb+iASWEREXQuwiQilsvaX916WrkBpWXwwwr7Qjc5JIReWYH7fVtSikoCYJV X-Received: by 2002:a17:907:98f5:: with SMTP id ke21mr42102810ejc.552.1616085833501; Thu, 18 Mar 2021 09:43:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616085833; cv=none; d=google.com; s=arc-20160816; b=Bi7tXpkfXR8hzrOFQ/ppKiSs5raxyTtcuyiqWs1q3fx/iij14MlQL8LkiU7ACbFLTM wXhdT0EB9cCLCxkrdnm2us9AKYLI8A20z3vopLNT4Ivet9CNTc4j2pYoIM4bRwANB8uB ZbWCXH0mCuVmZQKnTx7K4AobLN4N+mqpkTxE2ZyCrDsaQd+KjKR9Ww6JvBfC6SDMROLU NGwNxe/Fy0R0V0Das2jF1Iy073NT+3vqXiPoHSCzQKgsMFHNk6ucPuDicjU7LzDuq+S3 ANywdf2eARr4maNu2h2XJ0ysU85Ohv+wJ/SsqVCPn3VqzDhyMtaJ5CHogjg0LI8GbU8V MeMA== 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 :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=w9mQxWNnMTssOskHnAPG1oAnNBJ6d1DSK5jOvwHv+88=; b=QkrmcDIXGAK0x2cawS+DMsuAD7pBdY0wX88d3BVtckv0FVbK/vf8yLJismPUcNxc/H NuRiCsJO3u69xujNqiuZUj8gLB2WeCSoDxb88YCIeGXfeat213SO7pl6GRigRMRdJBMA 2MzNzDEi3nki/XAsK3e8Q+A/CzszI8bTHqS+RkLVIPlhxcp0OY4RUodssiA4PdcWiAvB PTvzcfox8kHKaMR0csSxgB2OBz+fFuHPdlgMfE8q7Vxvc82TtsbhN/LdJ9bx8CZjzBaQ NB6bw/RDFbxYMBcTXuvvFMrHaNdxa+2Ns7hEAotkcEBplfjvtOxJ73clv+0NkLsbrrf+ w9Ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OMba7aDP; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q25si2016058edt.39.2021.03.18.09.43.31; Thu, 18 Mar 2021 09:43:53 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OMba7aDP; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232183AbhCRQma (ORCPT + 99 others); Thu, 18 Mar 2021 12:42:30 -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