Re: [PATCH v6] swiotlb: Adjust SWIOTBL bounce buffer size for SEV guests.

2020-12-01 Thread Konrad Rzeszutek Wilk
On Tue, Nov 24, 2020 at 11:46:22PM +, Ashish Kalra wrote: > Hello Konrad, > > On Mon, Nov 23, 2020 at 10:56:31PM +, Ashish Kalra wrote: > > Hello Konrad, > > > > On Mon, Nov 23, 2020 at 12:56:32PM -0500, Konrad Rzeszutek Wilk wrote: > > > On Mon, Nov 23, 2020 at 06:06:47PM +0100,

Re: [PATCH v6] swiotlb: Adjust SWIOTBL bounce buffer size for SEV guests.

2020-11-24 Thread Ashish Kalra
Hello Konrad, On Mon, Nov 23, 2020 at 10:56:31PM +, Ashish Kalra wrote: > Hello Konrad, > > On Mon, Nov 23, 2020 at 12:56:32PM -0500, Konrad Rzeszutek Wilk wrote: > > On Mon, Nov 23, 2020 at 06:06:47PM +0100, Borislav Petkov wrote: > > > On Thu, Nov 19, 2020 at 09:42:05PM +, Ashish

Re: [PATCH v6] swiotlb: Adjust SWIOTBL bounce buffer size for SEV guests.

2020-11-24 Thread Kalra, Ashish
> On Nov 24, 2020, at 3:04 AM, Borislav Petkov wrote: > > On Mon, Nov 23, 2020 at 10:56:31PM +, Ashish Kalra wrote: >> As i mentioned earlier, the patch was initially based on using a % of >> guest memory, > > Can you figure out how much the guest memory is and then allocate a >

Re: [PATCH v6] swiotlb: Adjust SWIOTBL bounce buffer size for SEV guests.

2020-11-24 Thread Kalra, Ashish
> On Nov 24, 2020, at 3:38 AM, Borislav Petkov wrote: > > On Tue, Nov 24, 2020 at 09:25:06AM +, Kalra, Ashish wrote: >> But what will be the criteria to figure out this percentage? >> >> As I mentioned earlier, this can be made as complicated as possible by >> adding all kind of

Re: [PATCH v6] swiotlb: Adjust SWIOTBL bounce buffer size for SEV guests.

2020-11-24 Thread Borislav Petkov
On Tue, Nov 24, 2020 at 09:25:06AM +, Kalra, Ashish wrote: > But what will be the criteria to figure out this percentage? > > As I mentioned earlier, this can be made as complicated as possible by > adding all kind of heuristics but without any predictable performance > gain. > > Or it can be

Re: [PATCH v6] swiotlb: Adjust SWIOTBL bounce buffer size for SEV guests.

2020-11-24 Thread Borislav Petkov
On Mon, Nov 23, 2020 at 01:43:27PM -0500, Konrad Rzeszutek Wilk wrote: > I am assuming that TDX is going to have the same exact issue that > AMD SEV will have. > > Are you recommending to have an unified x86 specific callback > where we check if it: > > - CPUID_AMD_SEV or CPUID_INTEL_TDX is

Re: [PATCH v6] swiotlb: Adjust SWIOTBL bounce buffer size for SEV guests.

2020-11-23 Thread Ashish Kalra
Hello Konrad, On Mon, Nov 23, 2020 at 12:56:32PM -0500, Konrad Rzeszutek Wilk wrote: > On Mon, Nov 23, 2020 at 06:06:47PM +0100, Borislav Petkov wrote: > > On Thu, Nov 19, 2020 at 09:42:05PM +, Ashish Kalra wrote: > > > From: Ashish Kalra > > > > > > For SEV, all DMA to and from guest has

Re: [PATCH v6] swiotlb: Adjust SWIOTBL bounce buffer size for SEV guests.

2020-11-23 Thread Konrad Rzeszutek Wilk
On Mon, Nov 23, 2020 at 07:02:15PM +0100, Borislav Petkov wrote: > On Mon, Nov 23, 2020 at 12:56:32PM -0500, Konrad Rzeszutek Wilk wrote: > > This is not going to work for TDX. I think having a registration > > to SWIOTLB to have this function would be better going forward. > > > > As in there

Re: [PATCH v6] swiotlb: Adjust SWIOTBL bounce buffer size for SEV guests.

2020-11-23 Thread Borislav Petkov
On Mon, Nov 23, 2020 at 12:56:32PM -0500, Konrad Rzeszutek Wilk wrote: > This is not going to work for TDX. I think having a registration > to SWIOTLB to have this function would be better going forward. > > As in there will be a swiotlb_register_adjuster() which AMD SEV > code can call at start,

Re: [PATCH v6] swiotlb: Adjust SWIOTBL bounce buffer size for SEV guests.

2020-11-23 Thread Konrad Rzeszutek Wilk
On Mon, Nov 23, 2020 at 06:06:47PM +0100, Borislav Petkov wrote: > On Thu, Nov 19, 2020 at 09:42:05PM +, Ashish Kalra wrote: > > From: Ashish Kalra > > > > For SEV, all DMA to and from guest has to use shared (un-encrypted) pages. > > SEV uses SWIOTLB to make this happen without requiring

Re: [PATCH v6] swiotlb: Adjust SWIOTBL bounce buffer size for SEV guests.

2020-11-23 Thread Borislav Petkov
On Thu, Nov 19, 2020 at 09:42:05PM +, Ashish Kalra wrote: > From: Ashish Kalra > > For SEV, all DMA to and from guest has to use shared (un-encrypted) pages. > SEV uses SWIOTLB to make this happen without requiring changes to device > drivers. However, depending on workload being run, the

[PATCH v6] swiotlb: Adjust SWIOTBL bounce buffer size for SEV guests.

2020-11-19 Thread Ashish Kalra
From: Ashish Kalra For SEV, all DMA to and from guest has to use shared (un-encrypted) pages. SEV uses SWIOTLB to make this happen without requiring changes to device drivers. However, depending on workload being run, the default 64MB of SWIOTLB might not be enough and SWIOTLB may run out of