public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Ashish Kalra <ashish.kalra@amd.com>
To: Borislav Petkov <bp@alien8.de>
Cc: pbonzini@redhat.com, seanjc@google.com, tglx@linutronix.de,
	mingo@redhat.com, hpa@zytor.com, joro@8bytes.org,
	Thomas.Lendacky@amd.com, x86@kernel.org, kvm@vger.kernel.org,
	linux-kernel@vger.kernel.org, srutherford@google.com,
	brijesh.singh@amd.com, linux-efi@vger.kernel.org
Subject: Re: [PATCH v3 3/5] mm: x86: Invoke hypercall when page encryption status is changed
Date: Wed, 30 Jun 2021 03:10:18 +0000	[thread overview]
Message-ID: <20210630031018.GA3373@ashkalra_ubuntu_server> (raw)
In-Reply-To: <YMJaXGoVMzyR/cP6@zn.tnic>

Hello Boris, Paolo,

On Thu, Jun 10, 2021 at 08:30:52PM +0200, Borislav Petkov wrote:
> On Tue, Jun 08, 2021 at 06:06:26PM +0000, Ashish Kalra wrote:
> > +void notify_range_enc_status_changed(unsigned long vaddr, int npages,
> > +				    bool enc)
> 
> You don't need to break this line.
> 
> > @@ -285,12 +333,13 @@ static void __init __set_clr_pte_enc(pte_t *kpte, int level, bool enc)
> >  static int __init early_set_memory_enc_dec(unsigned long vaddr,
> >  					   unsigned long size, bool enc)
> >  {
> > -	unsigned long vaddr_end, vaddr_next;
> > +	unsigned long vaddr_end, vaddr_next, start;
> >  	unsigned long psize, pmask;
> >  	int split_page_size_mask;
> >  	int level, ret;
> >  	pte_t *kpte;
> >  
> > +	start = vaddr;
> >  	vaddr_next = vaddr;
> >  	vaddr_end = vaddr + size;
> >  
> > @@ -345,6 +394,8 @@ static int __init early_set_memory_enc_dec(unsigned long vaddr,
> >  
> >  	ret = 0;
> >  
> > +	notify_range_enc_status_changed(start, PAGE_ALIGN(size) >> PAGE_SHIFT,
> > +					enc);
> 
> Ditto.
> 
> >  out:
> >  	__flush_tlb_all();
> >  	return ret;
> > diff --git a/arch/x86/mm/pat/set_memory.c b/arch/x86/mm/pat/set_memory.c
> > index 156cd235659f..9729cb0d99e3 100644
> > --- a/arch/x86/mm/pat/set_memory.c
> > +++ b/arch/x86/mm/pat/set_memory.c
> > @@ -2020,6 +2020,13 @@ static int __set_memory_enc_dec(unsigned long addr, int numpages, bool enc)
> >  	 */
> >  	cpa_flush(&cpa, 0);
> >  
> > +	/*
> > +	 * Notify hypervisor that a given memory range is mapped encrypted
> > +	 * or decrypted. The hypervisor will use this information during the
> > +	 * VM migration.
> > +	 */
> 
> Simplify that comment:
> 
>         /*
>          * Notify the hypervisor about the encryption status change of the memory
> 	 * range. It will use this information during the VM migration.
>          */
> 
> 
> With those nitpicks fixed:
> 
> Reviewed-by: Borislav Petkov <bp@suse.de>
> 
> Paulo, if you want me to take this, lemme know, but I think it'll
> conflict with patch 5 so perhaps it all should go together through the
> kvm tree...
> 

Will these patches be merged into 5.14 ?

I have posted another version (v5) for patch 5 after more review comments
from Boris, so please pull in all these patches together. 

Thanks,
Ashish

> Thx.
> 
> -- 
> Regards/Gruss,
>     Boris.
> 
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpeople.kernel.org%2Ftglx%2Fnotes-about-netiquette&amp;data=04%7C01%7CAshish.Kalra%40amd.com%7C142a30170b8145b44a2f08d92c3de599%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637589466634224968%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=nCXHGP8%2F9on0DurrLLbBT0MivMWXfNqwS73rKkqclUM%3D&amp;reserved=0

  reply	other threads:[~2021-06-30  3:10 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-08 18:05 [PATCH v3 0/5] Add Guest API & Guest Kernel support for SEV live migration Ashish Kalra
2021-06-08 18:05 ` [PATCH v3 1/5] KVM: X86: Introduce KVM_HC_MAP_GPA_RANGE hypercall Ashish Kalra
2021-06-10 16:58   ` Paolo Bonzini
2021-06-08 18:06 ` [PATCH v3 2/5] KVM: x86: invert KVM_HYPERCALL to default to VMMCALL Ashish Kalra
2021-08-19 20:45   ` Sean Christopherson
2021-08-19 22:08     ` Kalra, Ashish
2021-08-19 23:02       ` Kalra, Ashish
2021-08-19 23:15         ` Sean Christopherson
2021-08-20 13:32           ` Ashish Kalra
2021-06-08 18:06 ` [PATCH v3 3/5] mm: x86: Invoke hypercall when page encryption status is changed Ashish Kalra
2021-06-10 18:30   ` Borislav Petkov
2021-06-30  3:10     ` Ashish Kalra [this message]
2021-06-08 18:06 ` [PATCH v3 4/5] EFI: Introduce the new AMD Memory Encryption GUID Ashish Kalra
2021-06-10 15:01   ` Ard Biesheuvel
2021-06-08 18:07 ` [PATCH v3 5/5] x86/kvm: Add guest support for detecting and enabling SEV Live Migration feature Ashish Kalra
2021-06-10 18:32   ` Borislav Petkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210630031018.GA3373@ashkalra_ubuntu_server \
    --to=ashish.kalra@amd.com \
    --cc=Thomas.Lendacky@amd.com \
    --cc=bp@alien8.de \
    --cc=brijesh.singh@amd.com \
    --cc=hpa@zytor.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    --cc=srutherford@google.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox