[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <de04db4c-95e2-e921-5a2f-7fb33fed4fdc@amd.com>
Date: Wed, 25 Aug 2021 08:54:31 -0500
From: Brijesh Singh <brijesh.singh@....com>
To: Borislav Petkov <bp@...en8.de>
Cc: brijesh.singh@....com, x86@...nel.org,
linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
linux-efi@...r.kernel.org, platform-driver-x86@...r.kernel.org,
linux-coco@...ts.linux.dev, linux-mm@...ck.org,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Joerg Roedel <jroedel@...e.de>,
Tom Lendacky <thomas.lendacky@....com>,
"H. Peter Anvin" <hpa@...or.com>, Ard Biesheuvel <ardb@...nel.org>,
Paolo Bonzini <pbonzini@...hat.com>,
Sean Christopherson <seanjc@...gle.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
Andy Lutomirski <luto@...nel.org>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Sergio Lopez <slp@...hat.com>, Peter Gonda <pgonda@...gle.com>,
Peter Zijlstra <peterz@...radead.org>,
Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>,
David Rientjes <rientjes@...gle.com>,
Dov Murik <dovmurik@...ux.ibm.com>,
Tobin Feldman-Fitzthum <tobin@....com>,
Michael Roth <michael.roth@....com>,
Vlastimil Babka <vbabka@...e.cz>,
"Kirill A . Shutemov" <kirill@...temov.name>,
Andi Kleen <ak@...ux.intel.com>, tony.luck@...el.com,
marcorr@...gle.com, sathyanarayanan.kuppuswamy@...ux.intel.com
Subject: Re: [PATCH Part1 v5 17/38] x86/mm: Add support to validate memory
when changing C-bit
On 8/25/21 6:06 AM, Borislav Petkov wrote:
>
> I really meant putting the beginning of that string at the very first
> position on the line:
>
> if (WARN(hdr->end_entry > end_entry || cur_entry > hdr->cur_entry,
> "SEV-SNP: PSC processing going backward, end_entry %d (got %d) cur_entry %d (got %d)\n",
> end_entry, hdr->end_entry, cur_entry, hdr->cur_entry)) {
>
> Exactly like this!
>
Noted.
> ...
>
>> +static void set_page_state(unsigned long vaddr, unsigned int npages, int op)
>> +{
>> + unsigned long vaddr_end, next_vaddr;
>> + struct snp_psc_desc *desc;
>> +
>> + vaddr = vaddr & PAGE_MASK;
>> + vaddr_end = vaddr + (npages << PAGE_SHIFT);
>> +
>> + desc = kmalloc(sizeof(*desc), GFP_KERNEL_ACCOUNT);
>
> And again, from previous review:
>
> kzalloc() so that you don't have to memset() later in
> __set_page_state().
>
I replied to your previous comment. Depending on the npages value, the
__set_page_state() will be called multiple times and on each call it
needs to clear desc before populate it. So, I do not see strong reason
to use kzalloc() during the desc allocation. I thought you were okay
with that explanation.
>> + if (!desc)
>> + panic("SEV-SNP: failed to alloc memory for PSC descriptor\n");
>
> "allocate" fits just fine too.
>
Noted.
thanks
Powered by blists - more mailing lists