Received: by 2002:a05:6a10:8a4d:0:0:0:0 with SMTP id dn13csp712882pxb; Fri, 13 Aug 2021 04:51:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzzqRbBPSaH/8H2Vg0i6vldaGso0F97QcjPraPdZH3zfReLdfuC5nOyZPyKLwW/gt1WlIW6 X-Received: by 2002:a05:6602:389:: with SMTP id f9mr1753273iov.97.1628855505453; Fri, 13 Aug 2021 04:51:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628855505; cv=none; d=google.com; s=arc-20160816; b=Lod6OjcjG/ldcJ3jkmWkdkpROOM6eRHjEfQYfjbgRjwKm4It2o1MpsU7D59btLsu4+ p5SqM98nJiv4+fIRribiuIQrFDsXfFNJ9P4RkoNFerXNd8jsQTjzhhwAAJ/tTWfw14Z/ 0dX9gNRXj29ycbxPG+L6tkx5qQURXvsC9Z8Jk0E9yeAEffK9AAq7wpu1faMP8HmLx/Lp UrhZuOK2LZgm0F+w1Ha39xkSHJjdm6rjiADaU9IeicUZxtOJ6L+uc9nFyph+H6122psf 7hy8KohUwQcFHkGaImsrH87XrcDuEsiKATP0p52q4p6fCR7IAWVkI6S6KSPxijUNEKK0 JocA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=WPW5sSZjUxZ3x8JTAj91aHnNyirgFEzr1J7d0XBG/HA=; b=fdp6SluhvYuGNzUuOERvG2ld72rj+i+9J0c4liURmQl7yQquVoGJdea61J1hNfeTpb Rlk6+GboZ5p5JLEuZ/66fJz0Qli4t1+GzuRovUR3egg3Jw/pWL7mcrhNE6jXnw7W7ET4 7iXUnfaX+xOlTfolqPINb/tvSJ/LexIU0JMmQaVBO41lR3KU+ZwokQzTwlrGS2/bSGv9 JOcW8NLrIjwAx0QrT11yv5YB2fw4M1l/jcCA9k1M9hPLJjoyN9PFjiLaJon165k51yh6 rnH5udxaL8ITKoGb6GRVp2UCa34tgrrMFtd2l09SC3pbSs6trsTHNbU+BywCP7CEmMc3 r2iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=P2ABTh4l; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j2si1425750ilr.103.2021.08.13.04.51.34; Fri, 13 Aug 2021 04:51:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-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=@alien8.de header.s=dkim header.b=P2ABTh4l; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240266AbhHMLNF (ORCPT + 99 others); Fri, 13 Aug 2021 07:13:05 -0400 Received: from mail.skyhub.de ([5.9.137.197]:39540 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240262AbhHMLNE (ORCPT ); Fri, 13 Aug 2021 07:13:04 -0400 Received: from zn.tnic (p200300ec2f0a0d0079874d21390dee82.dip0.t-ipconnect.de [IPv6:2003:ec:2f0a:d00:7987:4d21:390d:ee82]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 8CD731EC0354; Fri, 13 Aug 2021 13:12:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1628853152; 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:in-reply-to:in-reply-to: references:references; bh=WPW5sSZjUxZ3x8JTAj91aHnNyirgFEzr1J7d0XBG/HA=; b=P2ABTh4lPaXRaUU+RtlYZTkMizbxNKmwMIwxtCmMEan0F0wJtyuBhj1mLNFzeSCag+f5va /hKeBFX1vqOUbEHFnpNyZ1XO3hPc56tZM0Gd2Vt2gvfnUx9/RSgF3d4B6CeAZB4Sk50o1T XctMGGA8nfKk6rRyiZhqhk6A5CS1hOI= Date: Fri, 13 Aug 2021 13:13:11 +0200 From: Borislav Petkov To: Brijesh Singh Cc: x86@kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-efi@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-coco@lists.linux.dev, linux-mm@kvack.org, linux-crypto@vger.kernel.org, Thomas Gleixner , Ingo Molnar , Joerg Roedel , Tom Lendacky , "H. Peter Anvin" , Ard Biesheuvel , Paolo Bonzini , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Andy Lutomirski , Dave Hansen , Sergio Lopez , Peter Gonda , Peter Zijlstra , Srinivas Pandruvada , David Rientjes , Dov Murik , Tobin Feldman-Fitzthum , Michael Roth , Vlastimil Babka , tony.luck@intel.com, npmccallum@redhat.com, brijesh.ksingh@gmail.com Subject: Re: [PATCH Part1 RFC v4 12/36] x86/sev: Add helper for validating pages in early enc attribute changes Message-ID: References: <20210707181506.30489-1-brijesh.singh@amd.com> <20210707181506.30489-13-brijesh.singh@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210707181506.30489-13-brijesh.singh@amd.com> Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Wed, Jul 07, 2021 at 01:14:42PM -0500, Brijesh Singh wrote: > +void __init early_snp_set_memory_private(unsigned long vaddr, unsigned long paddr, > + unsigned int npages) > +{ > + if (!sev_feature_enabled(SEV_SNP)) > + return; > + > + /* Ask hypervisor to add the memory pages in RMP table as a 'private'. */ From a previous review: Ask the hypervisor to mark the memory pages as private in the RMP table. Are you missing my comments, do I have to write them more prominently or what is the problem? DO I NEED TO WRITE IN CAPS ONLY MAYBE? > +void __init early_snp_set_memory_shared(unsigned long vaddr, unsigned long paddr, > + unsigned int npages) > +{ > + if (!sev_feature_enabled(SEV_SNP)) > + return; > + > + /* > + * Invalidate the memory pages before they are marked shared in the > + * RMP table. > + */ > + pvalidate_pages(vaddr, npages, 0); > + > + /* Ask hypervisor to make the memory pages shared in the RMP table. */ From a previous review: s/make/mark/ > + early_set_page_state(paddr, npages, SNP_PAGE_STATE_SHARED); > +} > + > +void __init snp_prep_memory(unsigned long paddr, unsigned int sz, int op) that op should be: enum psc_op { SNP_PAGE_STATE_SHARED, SNP_PAGE_STATE_PRIVATE, }; too. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette