Re: [PATCH 07/11] treewide: Replace the use of mem_encrypt_active() with prot_guest_has()

2021-07-31 Thread Sean Christopherson via iommu
On Tue, Jul 27, 2021, Tom Lendacky wrote: > @@ -451,7 +450,7 @@ void __init mem_encrypt_free_decrypted_mem(void) >* The unused memory range was mapped decrypted, change the encryption >* attribute from decrypted to encrypted before freeing it. >*/ > - if (mem_encrypt_act

Re: [PATCH v2 4/4] swiotlb: Free tbl memory in swiotlb_exit()

2021-07-31 Thread Guenter Roeck
On 7/31/21 7:29 PM, Konrad Rzeszutek Wilk wrote: On Sat, Jul 31, 2021 at 11:26:11AM -0700, Guenter Roeck wrote: Hi, On Tue, Jul 20, 2021 at 02:38:26PM +0100, Will Deacon wrote: Although swiotlb_exit() frees the 'slots' metadata array referenced by 'io_tlb_default_mem', it leaves the underlying

Re: [PATCH v2 4/4] swiotlb: Free tbl memory in swiotlb_exit()

2021-07-31 Thread Konrad Rzeszutek Wilk
On Sat, Jul 31, 2021 at 11:26:11AM -0700, Guenter Roeck wrote: > Hi, > > On Tue, Jul 20, 2021 at 02:38:26PM +0100, Will Deacon wrote: > > Although swiotlb_exit() frees the 'slots' metadata array referenced by > > 'io_tlb_default_mem', it leaves the underlying buffer pages allocated > > despite no

Re: [PATCH v2 4/4] swiotlb: Free tbl memory in swiotlb_exit()

2021-07-31 Thread Guenter Roeck
Hi, On Tue, Jul 20, 2021 at 02:38:26PM +0100, Will Deacon wrote: > Although swiotlb_exit() frees the 'slots' metadata array referenced by > 'io_tlb_default_mem', it leaves the underlying buffer pages allocated > despite no longer being usable. > > Extend swiotlb_exit() to free the buffer pages as

[PATCH v2] iommu: Check if group is NULL before remove device

2021-07-31 Thread Frank Wunderlich
From: Frank Wunderlich If probe_device is failing, iommu_group is not initialized because iommu_group_add_device is not reached, so freeing it will result in NULL pointer access. iommu_bus_init ->bus_iommu_probe ->probe_iommu_group in for each:/* return -22 in fail case */ ->io