Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp370102ybh; Wed, 15 Jul 2020 04:18:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+XH6tNQ8ekYLSaFmpvoUgBKrH/RjKHMEsG1P+xj9mPGojmrjC5TbSahnmcrOlKo60bwcc X-Received: by 2002:a05:6402:1805:: with SMTP id g5mr8723251edy.357.1594811899579; Wed, 15 Jul 2020 04:18:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594811899; cv=none; d=google.com; s=arc-20160816; b=j3Wvvn4sa5frQ2DnrBpzrbkBcVMzjEIfMqSRKyNQQ4ZBAis+6U0sAUmbebwkELykf1 OTaurdy6HeVTQ7dZrPmNT0+nDanbmOyFRghzUy2F79UNiRhnAEMBeYQz9BU0RZWhg1GP PdBjNe0U2GkHt5e+d1B0T3UEc6wqni3jjxH2IjLjwhSrB0im2dlpDYp26aaEXwvhXDDb oXaNMbtvLaei1v/x8rwsP0e0ETQG3+RWcp+pHuYaHqOjhXzg/toa7p6qK6stZWgWE/dT 6gpdrOixbTltgwlKE2Pb3eyj5tbIlHXGv/2X9+debQObGFzmNWnCD4+hl/gC2fGHkEAL iH0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=0HCakti0b6lmM4g905pdJX4peFuHbUF/j1G28PE/Bks=; b=a+tegSMAHl276VzS64DyyhPjFQhWomSW0sZ6+7thAegTO2qNXww5sGW6gylUtMm7UT /u9xXUFOqonsgr1C3UddX8QVAqywK8W0HChbY4t4/YzOMb6GcokzAiVd3BAogCOou5xx azlJiXMfde+8abNqYBLARoX8RS/CNKiNaKza5I0NhLLlgEliefw5GnKATdSELgrtXT5l 2K94pRfKYTIyT5WOF1gPwvaG9/xDDv+uU/k4KoSezlrnlqqrBTF1NgOg1gyGB8Ncl7vg FNqpe6nQC/tloX6LWv0Gbd0paGPCL3fDiKxmdfEbfNKXpyNcEGntejCc0BE+e/W98Had c3qA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s25si1088256ejv.413.2020.07.15.04.17.54; Wed, 15 Jul 2020 04:18:19 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731015AbgGOKIN (ORCPT + 99 others); Wed, 15 Jul 2020 06:08:13 -0400 Received: from [195.135.220.15] ([195.135.220.15]:40338 "EHLO mx2.suse.de" rhost-flags-FAIL-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1725811AbgGOKIM (ORCPT ); Wed, 15 Jul 2020 06:08:12 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 505C8B6C0; Wed, 15 Jul 2020 10:08:14 +0000 (UTC) Date: Wed, 15 Jul 2020 12:08:08 +0200 From: Joerg Roedel To: Peter Zijlstra Cc: Joerg Roedel , x86@kernel.org, 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: <20200715100808.GL16200@suse.de> References: <20200714120917.11253-1-joro@8bytes.org> <20200714120917.11253-64-joro@8bytes.org> <20200715084752.GD10769@hirez.programming.kicks-ass.net> <20200715091337.GI16200@suse.de> <20200715095136.GG10769@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200715095136.GG10769@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 15, 2020 at 11:51:36AM +0200, Peter Zijlstra wrote: > On Wed, Jul 15, 2020 at 11:13:37AM +0200, Joerg Roedel wrote: > > Then my understanding of intrumentation_begin/end() is wrong, I thought > > that the kernel will forbid setting breakpoints before > > instrumentation_begin(), which is necessary here because a break-point > > in the #VC handler might cause recursive #VC-exceptions when #DB is > > intercepted. > > Maybe you can elaborate on why this makes no sense? > > Kernel avoids breakpoints in any noinstr text, irrespective of > instrumentation_begin(). > > instrumentation_begin() merely allows one to call !noinstr functions. Right, but the handler calls into various other functions. I actually started to annotate them all with noinstr, but that was a can of worms when calling into generic kernel functions. And the only problem with intrumentation in the #VC handler is the #VC-for-#DB exit-code, so I decided to only handle this one with instrumentation forbidden and allow it for the rest of the handler. Regards, Joerg