Re: [PATCH] x86/tdx: Enhance code generation for TDCALL and SEAMCALL wrappers

2024-08-28 Thread Edgecombe, Rick P
On Tue, 2024-06-04 at 12:34 -0700, Sean Christopherson wrote: > > If we're willing to suffer a few gnarly macros, I think we get a satisfactory > mix > of standardized arguments and explicit operands, and generate vastly better > code. Hi Sean, We are kind of stuck on improving the code generati

Re: [bug report] Drivers: hv: vmbus: Track decrypted status in vmbus_gpadl

2024-07-29 Thread Edgecombe, Rick P
On Sat, 2024-07-27 at 00:33 -0500, Dan Carpenter wrote: > Commit 211f514ebf1e ("Drivers: hv: vmbus: Track decrypted status in > vmbus_gpadl") from Mar 11, 2024 (linux-next), leads to the following > Smatch static checker warning: > > drivers/hv/channel.c:870 vmbus_teardown_gpadl() >   

Re: [PATCH 0/5] Handle set_memory_XXcrypted() errors in Hyper-V

2024-04-11 Thread Edgecombe, Rick P
On Wed, 2024-04-10 at 21:34 +, Wei Liu wrote: > > Applied to hyperv-fixes. Thanks. Thanks, and thanks to Michael for getting it across the finish line.

Re: [RFC RFT PATCH 0/4] Handle set_memory_XXcrypted() errors in hyperv

2024-03-07 Thread Edgecombe, Rick P
On Thu, 2024-03-07 at 17:11 +, Michael Kelley wrote: > Using your patches plus the changes in my comments, I've > done most of the testing described above. The normal > paths work, and when I hack set_memory_encrypted() > to fail, the error paths correctly did not free the memory. > I checked b

Re: [RFC RFT PATCH 1/4] hv: Leak pages if set_memory_encrypted() fails

2024-03-01 Thread Edgecombe, Rick P
On Fri, 2024-03-01 at 20:21 +, Michael Kelley wrote: > > The Hyper-V case can actually be a third path when a paravisor > is being used.  In that case, for both TDX and SEV-SNP, the > hypervisor callbacks in __set_memory_enc_pgtable() go > to Hyper-V specific functions that talk to the paravis

Re: [RFC RFT PATCH 1/4] hv: Leak pages if set_memory_encrypted() fails

2024-03-01 Thread Edgecombe, Rick P
On Fri, 2024-03-01 at 19:00 +, Michael Kelley wrote: > From: Rick Edgecombe Sent: Wednesday, > February 21, 2024 6:10 PM > > > > Historically, the preferred Subject prefix for changes to > connection.c has > been "Drivers: hv: vmbus:", not just "hv:".  Sometimes that > preference > isn't fol

Re: [RFC RFT PATCH 1/4] hv: Leak pages if set_memory_encrypted() fails

2024-03-01 Thread Edgecombe, Rick P
On Fri, 2024-03-01 at 09:26 +, Wei Liu wrote: > > Hyperv could free decrypted/shared pages if set_memory_encrypted() > > fails. > > "Hyper-V" throughout. Ok. > > > Leak the pages if this happens. > > > > Only compile tested. > > > > Cc: "K. Y. Srinivasan" > > Cc: Haiyang Zhang > > Cc: W

Re: [PATCH v4 0/3] x86/hyperv: Mark CoCo VM pages not present when changing encrypted state

2024-01-16 Thread Edgecombe, Rick P

Re: [PATCH v4 1/3] x86/hyperv: Use slow_virt_to_phys() in page transition hypervisor callback

2024-01-16 Thread Edgecombe, Rick P

Re: [PATCH v3 1/3] x86/hyperv: Use slow_virt_to_phys() in page transition hypervisor callback

2024-01-12 Thread Edgecombe, Rick P
On Fri, 2024-01-12 at 15:07 +, Michael Kelley wrote: > The comment is Kirill Shutemov's suggestion based on comments in > an earlier version of the patch series.  See [1].   The intent is to > prevent > some later revision to slow_virt_to_phys() from adding a check for > the > present bit and b

Re: [PATCH v3 1/3] x86/hyperv: Use slow_virt_to_phys() in page transition hypervisor callback

2024-01-11 Thread Edgecombe, Rick P
On Fri, 2024-01-05 at 10:30 -0800, mhkelle...@gmail.com wrote: > + * It is also used in callbacks for CoCo VM page transitions between > private > + * and shared because it works when the PRESENT bit is not set in > the leaf > + * PTE. In such cases, the state of the PTEs, including the PFN, is > o

Re: [PATCH v3 2/3] x86/mm: Regularize set_memory_p() parameters and make non-static

2024-01-11 Thread Edgecombe, Rick P
On Fri, 2024-01-05 at 10:30 -0800, mhkelle...@gmail.com wrote: > From: Michael Kelley > > set_memory_p() is currently static.  It has parameters that don't > match set_memory_p() under arch/powerpc and that aren't congruent > with the other set_memory_* functions. There's no good reason for > the

Re: [PATCH v3 3/3] x86/hyperv: Make encrypted/decrypted changes safe for load_unaligned_zeropad()

2024-01-11 Thread Edgecombe, Rick P
On Fri, 2024-01-05 at 10:30 -0800, mhkelle...@gmail.com wrote: >   * hv_vtom_set_host_visibility - Set specified memory visible to > host. >   * > @@ -521,7 +547,7 @@ static bool hv_vtom_set_host_visibility(unsigned > long kbuffer, int pagecount, bo >   > pfn_array = kmalloc(HV_HYP_PAGE_SIZ

Re: [PATCH v2 4/8] x86/sev: Enable PVALIDATE for PFNs without a valid virtual address

2023-11-28 Thread Edgecombe, Rick P
On Tue, 2023-11-28 at 18:08 +, Michael Kelley wrote: > > > > Sort of separately, if those vmalloc objections can't be worked > > through, did you consider doing something like text_poke() does > > (create > > the temporary mapping in a temporary MM) for pvalidate purposes? I > > don't know eno

Re: [PATCH v2 2/8] x86/mm: Don't do a TLB flush if changing a PTE that isn't marked present

2023-11-27 Thread Edgecombe, Rick P
On Tue, 2023-11-21 at 13:20 -0800, mhkelle...@gmail.com wrote: > --- a/arch/x86/mm/pat/set_memory.c > +++ b/arch/x86/mm/pat/set_memory.c > @@ -1636,7 +1636,10 @@ static int __change_page_attr(struct cpa_data > *cpa, int primary) > */ > if (pte_val(old_pte) != pte_va

Re: [PATCH v2 4/8] x86/sev: Enable PVALIDATE for PFNs without a valid virtual address

2023-11-27 Thread Edgecombe, Rick P
On Tue, 2023-11-21 at 13:20 -0800, mhkelle...@gmail.com wrote: > +static int pvalidate_pfn(unsigned long vaddr, unsigned int size, > +    unsigned long pfn, bool validate, int *rc2) > +{ > +   int rc; > +   struct page *page = pfn_to_page(pfn); > + > +   *rc2 = vmap_