Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp301579ybh; Wed, 15 Jul 2020 02:17:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw3atRO13MpNRtcXbmsouaFtOYi7K/Wqb3rbCzUN/lSATyAUh/HZqn1j+yQ7r+VYuURoz7I X-Received: by 2002:a50:f149:: with SMTP id z9mr8747890edl.167.1594804650533; Wed, 15 Jul 2020 02:17:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594804650; cv=none; d=google.com; s=arc-20160816; b=gqFqBB5zklsldiquT6Q/UasNOA5NBzemHjKhckA+KfUeR6BpNQ9hDvxZMrpNXK5RXk gLfQWKy/7ff/GSa9UQlu8u1B9DFf5KNzjfLRPONH5CatEdi3puxSX3zP8Ikud70zjtnc Hns/hRwkCdPS3GDvSURiKacmGdWY0xoY9V2BWTnV0PwSK8rUZwsyQbJ/s5ROUQ4myEqx ZnFZCYAdF2gjwz3TuoR7fA8tr7uFxlGWIaWGQrpl+HmVxsEDW4fxLk8Cf+c9ySQfjlp+ YkrWrQcFr05COIEYM7DcLH/9OjcYkZhIjZBRlN1WL00QGSuwTfm1+17lPg92suyFQ/bo zF1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=2hxetUaUv/Sl3bYl89m2PSXLP2Q6opXZZBO3eaTSzBk=; b=sspSHzFbq2bBAZvzEM2Dh1dJtC3tXKAOYmQ0q3ZLCM9jvFO1YQEKea6RjojvqP8QqX /RYKXxbfmgPPW5Fl2XqQ4LouR3KKhk/4Ea0RlxIbYbGHVwPJHNKEX7rEmXvH+Tl8e5Up Q7EDy13PiEm5+mOeibrUgGHOjpnYIn5pGqmTh8UR1+U+J7dr+5sf/UsxsG7Cob1DIs5j KPrrPRFSUbRqS3qZdfdQyje5x1z7R+VvvKaScgX1NSVgOdozihU/PQMb/0EkIWOAVk22 EIENU9CbAr5hHNryctoK+AsZY+ZHzOvAaoGGVfbrM4CqJhpezVhQLSMJf0iWew+YIfX/ Pg2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=WW8YoVzk; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bl24si847289ejb.602.2020.07.15.02.17.07; Wed, 15 Jul 2020 02:17:30 -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=fail header.i=@infradead.org header.s=casper.20170209 header.b=WW8YoVzk; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730437AbgGOIsO (ORCPT + 99 others); Wed, 15 Jul 2020 04:48:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729377AbgGOIsN (ORCPT ); Wed, 15 Jul 2020 04:48:13 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0709CC061755; Wed, 15 Jul 2020 01:48:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=2hxetUaUv/Sl3bYl89m2PSXLP2Q6opXZZBO3eaTSzBk=; b=WW8YoVzkyFTNUO9zvgWo2fwDzD Lqc0L2K1pu7x6Aoez048E/g4JFKPhwgeWkwrPWMYTj0CoOm8R+ljR0SxX8amd6+eXuJX/CS9zmIBP 943484iheiZFam8/iMWZxomMZnKu3B5V7HkQa0b7F7vNyE0OOpFL410o1HVKURFQzX7WfnAynrSRq tPJdTgs6yJAUqRMlfeetU4QyxaCqG8Ix+u5Od6IdthJP8fJ/XDceikh2bSZdYT0a33CAF8phFpOoh sMIvkBLrFGVTnISkOolA4A/ruDGcTPVcQFmN13Opjlbj/piWe6oHWmXOLLCQdHnbZ2fe1g5NLgJOf CE8x9iDA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jvd50-0007wY-B1; Wed, 15 Jul 2020 08:47:54 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id BB2203028C8; Wed, 15 Jul 2020 10:47:52 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id A994F2145CCC2; Wed, 15 Jul 2020 10:47:52 +0200 (CEST) Date: Wed, 15 Jul 2020 10:47:52 +0200 From: Peter Zijlstra To: Joerg Roedel Cc: x86@kernel.org, Joerg Roedel , hpa@zytor.com, Andy Lutomirski , Dave Hansen , Jiri Slaby , Dan Williams , Tom Lendacky , Juergen Gross , Kees Cook , David Rientjes , Cfir Cohen , Erdem Aktas , Masami Hiramatsu , Mike Stunes , Sean Christopherson , Martin Radev , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org Subject: Re: [PATCH v4 63/75] x86/sev-es: Handle #DB Events Message-ID: <20200715084752.GD10769@hirez.programming.kicks-ass.net> References: <20200714120917.11253-1-joro@8bytes.org> <20200714120917.11253-64-joro@8bytes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200714120917.11253-64-joro@8bytes.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 14, 2020 at 02:09:05PM +0200, Joerg Roedel wrote: > @@ -1028,6 +1036,16 @@ DEFINE_IDTENTRY_VC_SAFE_STACK(exc_vmm_communication) > struct ghcb *ghcb; > > lockdep_assert_irqs_disabled(); > + > + /* > + * #DB is special and needs to be handled outside of the intrumentation_begin()/end(). > + * Otherwise the #VC handler could be raised recursivly. > + */ > + if (error_code == SVM_EXIT_EXCP_BASE + X86_TRAP_DB) { > + vc_handle_trap_db(regs); > + return; > + } > + > instrumentation_begin(); Wait what?! That makes no sense what so ever.