[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7afbbc7f-8f02-ca6c-0c8c-bbf01fae70ea@gmail.com>
Date: Fri, 30 Jul 2021 12:10:54 +0800
From: Tianyu Lan <ltykernel@...il.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
Cc: kys@...rosoft.com, haiyangz@...rosoft.com, sthemmin@...rosoft.com,
wei.liu@...nel.org, decui@...rosoft.com, tglx@...utronix.de,
mingo@...hat.com, bp@...en8.de, x86@...nel.org, hpa@...or.com,
dave.hansen@...ux.intel.com, luto@...nel.org, peterz@...radead.org,
boris.ostrovsky@...cle.com, jgross@...e.com,
sstabellini@...nel.org, joro@...tes.org, will@...nel.org,
davem@...emloft.net, kuba@...nel.org, jejb@...ux.ibm.com,
martin.petersen@...cle.com, arnd@...db.de, hch@....de,
m.szyprowski@...sung.com, robin.murphy@....com,
thomas.lendacky@....com, brijesh.singh@....com, ardb@...nel.org,
Tianyu.Lan@...rosoft.com, rientjes@...gle.com,
martin.b.radev@...il.com, akpm@...ux-foundation.org,
rppt@...nel.org, kirill.shutemov@...ux.intel.com,
aneesh.kumar@...ux.ibm.com, krish.sadhukhan@...cle.com,
saravanand@...com, xen-devel@...ts.xenproject.org,
pgonda@...gle.com, david@...hat.com, keescook@...omium.org,
hannes@...xchg.org, sfr@...b.auug.org.au,
michael.h.kelley@...rosoft.com, iommu@...ts.linux-foundation.org,
linux-arch@...r.kernel.org, linux-hyperv@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-scsi@...r.kernel.org,
netdev@...r.kernel.org, vkuznets@...hat.com, anparri@...rosoft.com
Subject: Re: [PATCH 10/13] x86/Swiotlb: Add Swiotlb bounce buffer remap
function for HV IVM
Hi Konrad:
Thanks for your review.
On 7/30/2021 12:29 AM, Konrad Rzeszutek Wilk wrote:
>> diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
>> index 1fa81c096c1d..6866e5784b53 100644
>> --- a/kernel/dma/swiotlb.c
>> +++ b/kernel/dma/swiotlb.c
>> @@ -194,8 +194,13 @@ static void swiotlb_init_io_tlb_mem(struct io_tlb_mem *mem, phys_addr_t start,
>> mem->slots[i].alloc_size = 0;
>> }
>>
>> - set_memory_decrypted((unsigned long)vaddr, bytes >> PAGE_SHIFT);
>> - memset(vaddr, 0, bytes);
>> + mem->vaddr = dma_map_decrypted(vaddr, bytes);
>> + if (!mem->vaddr) {
>> + pr_err("Failed to decrypt memory.\n");
> I am wondering if it would be worth returning an error code in this
> function instead of just printing an error?
Yes, this is good idea and will update in the next version.
>
> For this patch I think it is Ok, but perhaps going forward this would be
> better done as I am thinking - is there some global guest->hyperv
> reporting mechanism so that if this fails - it ends up being bubbled up
> to the HyperV console-ish?
Hyper-V has such panic page report mechanism. Guest can pass one page
log to host during crash.
Powered by blists - more mailing lists