Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp583150pxk; Wed, 23 Sep 2020 10:29:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKNvob3FXtFYeRUYj3X5Kdk88sHAjeG2IckU+tTnyb0XStOp8mOIkbnyWmQHNqjzmssHBf X-Received: by 2002:a17:907:37b:: with SMTP id rs27mr807079ejb.0.1600882177219; Wed, 23 Sep 2020 10:29:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600882177; cv=none; d=google.com; s=arc-20160816; b=ddZ4qjBU7nacZc8exNy9rjpqcRPrQ2pT87kgcfWOAJIKyuZZqHXnIx5DjVUNJgFUjH +UxgcG1Ii6FHBKukT0l5gsVLVudzkI0MnWPbAWZMdBjKK1RLqGqhGfv3xR0Y4/8tcxti EaXFMq6JiBIBRcZrdhYeOAoq9AJT4gniU19SfR0EfZpTpfqqLyvnsS67SVqbftH7kz2m Hm+KXsqMvMrkWOoa+3LrhljUkOgQoP5asnHQ+a02bDR14v5gKQ7K8wDYraO6Z9FAjJ3I XsGAdcs7fDaYcnAoefIJI1CQMo2WjIjU6hWDL84+DsQfCR1egmF/X7NA5172ZR5hn+yC TuVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=Ma/IyYqWd34oHOgskwlzrFRY7gOhK4MLYjQUwqMt/1Q=; b=Djm9I8FE4UHG93m/uRctiqBuDlgJSkVslMw8Hz1TDvizrfXWaRkh0DwQEfEKq88mQ3 5NHWb2WZF5Sy7UdOWcOeZUWc8wuStoVDsx8ofLek4J3Pl4KdFZz6mtDfsQiBT3Pyku2P vtYYgAUqfQilB2UyKPria6NVsd2twOGC8kSdJ2uHfJ8PcenDpWbAb+kwWzs+MYtXerrU F6prGZJ+/rRpQK0SI7LDwPiULTJdDqOae52qCb9HTmrPpKNy3wRf3jt87+xk772UaSox fktLSuM6D53PWiom/CJJ07GzcvsbsN/m39gMbH9hJP3EPz2WRt6NQkvp5C/oX8ySC4c8 4fzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Ho/+dWms"; 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 h11si353051edr.319.2020.09.23.10.29.14; Wed, 23 Sep 2020 10:29:37 -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="Ho/+dWms"; 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 S1726774AbgIWR1r (ORCPT + 99 others); Wed, 23 Sep 2020 13:27:47 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:25293 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726751AbgIWR1p (ORCPT ); Wed, 23 Sep 2020 13:27:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600882063; 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=Ma/IyYqWd34oHOgskwlzrFRY7gOhK4MLYjQUwqMt/1Q=; b=Ho/+dWmsXEuc3ObPIIdanfrrvmdnCnFf6uGjQ07aPuTE6Qm+O2F0/1Ed4pvGqPd17PlAUB vfuMZar0sD6pTC/rtGHItdbeJWaip7kuh6piyTCxVK9ZGxvVZADd9MAcdFfwGXPMRmPfIq JdJirH/qi2WUNqhcMBpviKDS0SzqFvg= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-110-EjrH_UNrMT2vyHnn7juJQg-1; Wed, 23 Sep 2020 13:27:41 -0400 X-MC-Unique: EjrH_UNrMT2vyHnn7juJQg-1 Received: by mail-wr1-f72.google.com with SMTP id b7so116699wrn.6 for ; Wed, 23 Sep 2020 10:27:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Ma/IyYqWd34oHOgskwlzrFRY7gOhK4MLYjQUwqMt/1Q=; b=ZrfyptlnHSlv7KKbV/RmrFc7DepJZUbb4q5+/HxB0NVIg1UAwf96eHrzBvoM5ww0I3 ngPe4gzIbjXsYG6e80vreCLTUlVJ19HJbgUO106HC5EUc+99CMZN06SFP/ne/Kf5i1qp CuQtKOcN0efzqa5qZLLBDb6qC59BUm0y82o5mfAuaw00G3ZLzbCrK51Rh/o7iUs9+kFE ftmnChNQ5cftt/FxP/XO3sC5VmgA55iYRg3TXGN0L7+XnjrEnC3dD22tXvabVozsb3dJ dYkXu7nYw99YoWGNLWwif+KPHpSR9Ba9UBalDorXq//h65us2KRo/GXMfki5YbjuxSMh +BCQ== X-Gm-Message-State: AOAM532dasPiwFUweuiBv4PhDnBAoomFWbiY+3rFszECiPxsPKGmaheX 2pOO6xrjTHVKtJXJll6UM6o5L1jCaSmbqijiysDJsr8rY4zsmIP6L/8OzuwVARi8penVjQhybIj qLdHCyDnJaFOunos4XqysVpKd X-Received: by 2002:adf:f58b:: with SMTP id f11mr757861wro.250.1600882059642; Wed, 23 Sep 2020 10:27:39 -0700 (PDT) X-Received: by 2002:adf:f58b:: with SMTP id f11mr757833wro.250.1600882059442; Wed, 23 Sep 2020 10:27:39 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:15f1:648d:7de6:bad9? ([2001:b07:6468:f312:15f1:648d:7de6:bad9]) by smtp.gmail.com with ESMTPSA id t124sm539908wmg.31.2020.09.23.10.27.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 23 Sep 2020 10:27:38 -0700 (PDT) Subject: Re: [PATCH] KVM: SVM: Mark SEV launch secret pages as dirty. To: Sean Christopherson Cc: Cfir Cohen , "kvm @ vger . kernel . org" , Lendacky Thomas , Singh Brijesh , Grimm Jon , David Rientjes , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H . Peter Anvin" , x86@kernel.org, linux-kernel@vger.kernel.org References: <20200807012303.3769170-1-cfir@google.com> <20200919045505.GC21189@sjchrist-ice> <5ac77c46-88b4-df45-4f02-72adfb096262@redhat.com> <20200923170444.GA20076@linux.intel.com> <548b7b73-7a13-8267-414e-2b9e1569c7f7@redhat.com> <20200923172646.GB32044@linux.intel.com> From: Paolo Bonzini Message-ID: <0ccf42d8-2803-c1db-73f0-884d1ea27282@redhat.com> Date: Wed, 23 Sep 2020 19:27:37 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20200923172646.GB32044@linux.intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23/09/20 19:26, Sean Christopherson wrote: > /* > * Flush before LAUNCH_UPDATE encrypts pages in place, in case the cache > * contains the data that was written unencrypted. > */ > sev_clflush_pages(inpages, npages); > > there's nothing in the comment or code that even suggests sev_clflush_pages() is > conditional, i.e. no reason for the reader to peek at the implemenation. > > What about: > > /* > * Flush (on non-coherent CPUs) before LAUNCH_UPDATE encrypts pages in > * place, the cache may contain data that was written unencrypted. > */ Sounds good. Paolo