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=-0.8 required=3.0 tests=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 F2D21C433E0 for ; Thu, 11 Jun 2020 13:07:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DBBF420835 for ; Thu, 11 Jun 2020 13:07:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728330AbgFKNHD (ORCPT ); Thu, 11 Jun 2020 09:07:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728249AbgFKNGg (ORCPT ); Thu, 11 Jun 2020 09:06:36 -0400 Received: from theia.8bytes.org (8bytes.org [IPv6:2a01:238:4383:600:38bc:a715:4b6d:a889]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 888E5C03E96F; Thu, 11 Jun 2020 06:06:36 -0700 (PDT) Received: by theia.8bytes.org (Postfix, from userid 1000) id 8E68E869; Thu, 11 Jun 2020 15:06:34 +0200 (CEST) Date: Thu, 11 Jun 2020 15:06:33 +0200 From: Joerg Roedel To: Borislav Petkov Cc: x86@kernel.org, hpa@zytor.com, Andy Lutomirski , Dave Hansen , Peter Zijlstra , Jiri Slaby , Dan Williams , Tom Lendacky , Juergen Gross , Kees Cook , David Rientjes , Cfir Cohen , Erdem Aktas , Masami Hiramatsu , Mike Stunes , Joerg Roedel , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org Subject: Re: [PATCH v3 54/75] x86/sev-es: Handle DR7 read/write events Message-ID: <20200611130633.GD11924@8bytes.org> References: <20200428151725.31091-1-joro@8bytes.org> <20200428151725.31091-55-joro@8bytes.org> <20200525105935.GH25636@zn.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200525105935.GH25636@zn.tnic> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 25, 2020 at 12:59:35PM +0200, Borislav Petkov wrote: > On Tue, Apr 28, 2020 at 05:17:04PM +0200, Joerg Roedel wrote: > > + if (data) > > + data->dr7 = val; > > Are we still returning ES_OK if !data? Yes, it just means we ignore DR7 writes when they happen early before runtime_data is allocated. Since the DR7 value never makes it to the hardware register anyway, it doesn't matter. Joerg From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joerg Roedel Subject: Re: [PATCH v3 54/75] x86/sev-es: Handle DR7 read/write events Date: Thu, 11 Jun 2020 15:06:33 +0200 Message-ID: <20200611130633.GD11924@8bytes.org> References: <20200428151725.31091-1-joro@8bytes.org> <20200428151725.31091-55-joro@8bytes.org> <20200525105935.GH25636@zn.tnic> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20200525105935.GH25636@zn.tnic> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: virtualization-bounces@lists.linux-foundation.org Sender: "Virtualization" To: Borislav Petkov Cc: Juergen Gross , Tom Lendacky , Dave Hansen , Mike Stunes , Kees Cook , kvm@vger.kernel.org, Peter Zijlstra , Cfir Cohen , x86@kernel.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, Joerg Roedel , Masami Hiramatsu , Andy Lutomirski , hpa@zytor.com, Erdem Aktas , David Rientjes , Dan Williams , Jiri Slaby List-Id: virtualization@lists.linuxfoundation.org On Mon, May 25, 2020 at 12:59:35PM +0200, Borislav Petkov wrote: > On Tue, Apr 28, 2020 at 05:17:04PM +0200, Joerg Roedel wrote: > > + if (data) > > + data->dr7 = val; > > Are we still returning ES_OK if !data? Yes, it just means we ignore DR7 writes when they happen early before runtime_data is allocated. Since the DR7 value never makes it to the hardware register anyway, it doesn't matter. Joerg