All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Lendacky <thomas.lendacky@amd.com>
To: Baoquan He <bhe@redhat.com>, rientjes@google.com
Cc: Robin Murphy <robin.murphy@arm.com>,
	Christoph Hellwig <hch@infradead.org>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org,
	rppt@linux.ibm.com, brijesh.singh@amd.com,
	kexec@lists.infradead.org, iommu@lists.linux-foundation.org,
	m.szyprowski@samsung.com
Subject: Re: [PATCH RFC 0/2] dma-pool: allow user to disable atomic pool
Date: Wed, 11 Aug 2021 08:46:27 -0500	[thread overview]
Message-ID: <615cfd68-b1c2-f2d0-0c03-1271a913cef2@amd.com> (raw)
In-Reply-To: <20210811022327.GF23322@MiWiFi-R3L-srv>

On 8/10/21 9:23 PM, Baoquan He wrote:
> On 08/10/21 at 03:52pm, Tom Lendacky wrote:
>> On 8/5/21 1:54 AM, Baoquan He wrote:
>>> On 06/24/21 at 11:47am, Robin Murphy wrote:
>>>> On 2021-06-24 10:29, Baoquan He wrote:
>>>>> On 06/24/21 at 08:40am, Christoph Hellwig wrote:

...

> Looking at the those related commits, the below one from David tells 
> that atomic dma pool is used when device require non-blocking and
> unencrypted buffer. When I checked the system I borrowed, it's AMD EYPC
> and SME is enabled. And it has many pci devices, as you can see, its 'ls
> pci' outputs 113 lines. But disabling the three atomic pools didn't
> trigger any error on that AMD system. Does it mean only specific devices
> need this atomic pool in SME/SEV enabling case? Should we add more
> details in document or code comment to make clear this? 

It very well could be just the devices being used. Under SME (bare metal),
if a device supports 64-bit DMA, then bounce buffers aren't used and the
DMA can be performed directly to encrypted memory, so there is no need to
issue a set_memory_decrypted() call, so I would assume it likely isn't
using the pool.

Under SEV, however, all DMA has to go through guest un-encrypted memory.
If you pass through a device that does dma_alloc_coherent() calls with
GFP_ATOMIC, then the pool will be needed.

Thanks,
Tom

WARNING: multiple messages have this Message-ID (diff)
From: Tom Lendacky via iommu <iommu@lists.linux-foundation.org>
To: Baoquan He <bhe@redhat.com>, rientjes@google.com
Cc: brijesh.singh@amd.com, x86@kernel.org, kexec@lists.infradead.org,
	linux-kernel@vger.kernel.org, rppt@linux.ibm.com,
	Christoph Hellwig <hch@infradead.org>,
	linux-mm@kvack.org, iommu@lists.linux-foundation.org,
	Robin Murphy <robin.murphy@arm.com>
Subject: Re: [PATCH RFC 0/2] dma-pool: allow user to disable atomic pool
Date: Wed, 11 Aug 2021 08:46:27 -0500	[thread overview]
Message-ID: <615cfd68-b1c2-f2d0-0c03-1271a913cef2@amd.com> (raw)
In-Reply-To: <20210811022327.GF23322@MiWiFi-R3L-srv>

On 8/10/21 9:23 PM, Baoquan He wrote:
> On 08/10/21 at 03:52pm, Tom Lendacky wrote:
>> On 8/5/21 1:54 AM, Baoquan He wrote:
>>> On 06/24/21 at 11:47am, Robin Murphy wrote:
>>>> On 2021-06-24 10:29, Baoquan He wrote:
>>>>> On 06/24/21 at 08:40am, Christoph Hellwig wrote:

...

> Looking at the those related commits, the below one from David tells 
> that atomic dma pool is used when device require non-blocking and
> unencrypted buffer. When I checked the system I borrowed, it's AMD EYPC
> and SME is enabled. And it has many pci devices, as you can see, its 'ls
> pci' outputs 113 lines. But disabling the three atomic pools didn't
> trigger any error on that AMD system. Does it mean only specific devices
> need this atomic pool in SME/SEV enabling case? Should we add more
> details in document or code comment to make clear this? 

It very well could be just the devices being used. Under SME (bare metal),
if a device supports 64-bit DMA, then bounce buffers aren't used and the
DMA can be performed directly to encrypted memory, so there is no need to
issue a set_memory_decrypted() call, so I would assume it likely isn't
using the pool.

Under SEV, however, all DMA has to go through guest un-encrypted memory.
If you pass through a device that does dma_alloc_coherent() calls with
GFP_ATOMIC, then the pool will be needed.

Thanks,
Tom
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

WARNING: multiple messages have this Message-ID (diff)
From: Tom Lendacky <thomas.lendacky@amd.com>
To: Baoquan He <bhe@redhat.com>, rientjes@google.com
Cc: Robin Murphy <robin.murphy@arm.com>,
	Christoph Hellwig <hch@infradead.org>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org,
	rppt@linux.ibm.com, brijesh.singh@amd.com,
	kexec@lists.infradead.org, iommu@lists.linux-foundation.org,
	m.szyprowski@samsung.com
Subject: Re: [PATCH RFC 0/2] dma-pool: allow user to disable atomic pool
Date: Wed, 11 Aug 2021 08:46:27 -0500	[thread overview]
Message-ID: <615cfd68-b1c2-f2d0-0c03-1271a913cef2@amd.com> (raw)
In-Reply-To: <20210811022327.GF23322@MiWiFi-R3L-srv>

On 8/10/21 9:23 PM, Baoquan He wrote:
> On 08/10/21 at 03:52pm, Tom Lendacky wrote:
>> On 8/5/21 1:54 AM, Baoquan He wrote:
>>> On 06/24/21 at 11:47am, Robin Murphy wrote:
>>>> On 2021-06-24 10:29, Baoquan He wrote:
>>>>> On 06/24/21 at 08:40am, Christoph Hellwig wrote:

...

> Looking at the those related commits, the below one from David tells 
> that atomic dma pool is used when device require non-blocking and
> unencrypted buffer. When I checked the system I borrowed, it's AMD EYPC
> and SME is enabled. And it has many pci devices, as you can see, its 'ls
> pci' outputs 113 lines. But disabling the three atomic pools didn't
> trigger any error on that AMD system. Does it mean only specific devices
> need this atomic pool in SME/SEV enabling case? Should we add more
> details in document or code comment to make clear this? 

It very well could be just the devices being used. Under SME (bare metal),
if a device supports 64-bit DMA, then bounce buffers aren't used and the
DMA can be performed directly to encrypted memory, so there is no need to
issue a set_memory_decrypted() call, so I would assume it likely isn't
using the pool.

Under SEV, however, all DMA has to go through guest un-encrypted memory.
If you pass through a device that does dma_alloc_coherent() calls with
GFP_ATOMIC, then the pool will be needed.

Thanks,
Tom

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

  reply	other threads:[~2021-08-11 13:46 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-24  5:20 [PATCH RFC 0/2] dma-pool: allow user to disable atomic pool Baoquan He
2021-06-24  5:20 ` Baoquan He
2021-06-24  5:20 ` [PATCH 1/2] docs: kernel-parameters: Update to reflect the current default size of " Baoquan He
2021-06-24  5:20   ` Baoquan He
2021-06-24  5:20 ` [PATCH 2/2] dma-pool: allow user to disable " Baoquan He
2021-06-24  5:20   ` Baoquan He
2021-06-24  7:40 ` [PATCH RFC 0/2] " Christoph Hellwig
2021-06-24  7:40   ` Christoph Hellwig
2021-06-24  9:29   ` Baoquan He
2021-06-24  9:29     ` Baoquan He
2021-06-24  9:29     ` Baoquan He
2021-06-24 10:47     ` Robin Murphy
2021-06-24 10:47       ` Robin Murphy
2021-06-24 10:47       ` Robin Murphy
2021-06-24 12:10       ` Christoph Hellwig
2021-06-24 12:10         ` Christoph Hellwig
2021-06-24 12:10         ` Christoph Hellwig
2021-08-05  6:54       ` Baoquan He
2021-08-05  6:54         ` Baoquan He
2021-08-05  6:54         ` Baoquan He
2021-08-10 20:52         ` Tom Lendacky
2021-08-10 20:52           ` Tom Lendacky
2021-08-10 20:52           ` Tom Lendacky via iommu
2021-08-11  2:23           ` Baoquan He
2021-08-11  2:23             ` Baoquan He
2021-08-11  2:23             ` Baoquan He
2021-08-11 13:46             ` Tom Lendacky [this message]
2021-08-11 13:46               ` Tom Lendacky
2021-08-11 13:46               ` Tom Lendacky via iommu
2021-08-11  5:52           ` Christoph Hellwig
2021-08-11  5:52             ` Christoph Hellwig
2021-08-11  5:52             ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=615cfd68-b1c2-f2d0-0c03-1271a913cef2@amd.com \
    --to=thomas.lendacky@amd.com \
    --cc=bhe@redhat.com \
    --cc=brijesh.singh@amd.com \
    --cc=hch@infradead.org \
    --cc=iommu@lists.linux-foundation.org \
    --cc=kexec@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=m.szyprowski@samsung.com \
    --cc=rientjes@google.com \
    --cc=robin.murphy@arm.com \
    --cc=rppt@linux.ibm.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.