[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220223115539.pqk7624xku2qwhlu@black.fi.intel.com>
Date: Wed, 23 Feb 2022 14:55:39 +0300
From: "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>
To: Borislav Petkov <bp@...en8.de>
Cc: Brijesh Singh <brijesh.singh@....com>, x86@...nel.org,
linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
linux-coco@...ts.linux.dev, 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>,
Paolo Bonzini <pbonzini@...hat.com>,
Sean Christopherson <seanjc@...gle.com>,
Andy Lutomirski <luto@...nel.org>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Peter Gonda <pgonda@...gle.com>,
Peter Zijlstra <peterz@...radead.org>,
David Rientjes <rientjes@...gle.com>,
Michael Roth <michael.roth@....com>,
Andi Kleen <ak@...ux.intel.com>
Subject: Re: [PATCH] x86/mm/cpa: Generalize __set_memory_enc_pgtable()
On Wed, Feb 23, 2022 at 12:31:56PM +0100, Borislav Petkov wrote:
> @@ -2024,11 +2026,9 @@ static int __set_memory_enc_pgtable(unsigned long addr, int numpages, bool enc)
> */
> cpa_flush(&cpa, 0);
>
> - /*
> - * Notify hypervisor that a given memory range is mapped encrypted
> - * or decrypted.
> - */
> - notify_range_enc_status_changed(addr, numpages, enc);
> + /* Notify hypervisor that we have successfully set/clr encryption attribute. */
> + if (!ret)
> + x86_platform.guest.enc_status_change_finish(addr, numpages, enc);
>
> return ret;
> }
This operation can fail for TDX. We need to be able to return error code
here:
/* Notify hypervisor that we have successfully set/clr encryption attribute. */
if (!ret)
ret = x86_platform.guest.enc_status_change_finish(addr, numpages, enc);
--
Kirill A. Shutemov
Powered by blists - more mailing lists