Skip to contentSkip to conversation

route, dmix and other alsa plugins produce garbage output with mem_encrypt on Ryzen platform

Bug 211117 [email protected] 1 participant 5 messages Jan 18, 2021 – Jan 20, 2021 1 message not in the archive x86 platform drivers

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]/

#1 lore raw

https://bugzilla.kernel.org/show_bug.cgi?id=211117

Jaroslav Kysela ([email protected]) changed:

What |Removed |Added
----------------------------------------------------------------------------

          Component|Sound(ALSA)                 |Platform_x86
           Assignee|[email protected]              |drivers_platform_x86@kernel
                   |                            |-bugs.osdl.org

--- Comment #15 from Jaroslav Kysela ([email protected]) --- It looks like an issue which is not related directly to audio, right?

Reassigning to Platform_X86 .

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
#2 lore raw

[Bug 211117] dma_mmap_coherent() - garbage sound output with mem_encrypt on Ryzen platform

In reply to a message not in the archive

https://bugzilla.kernel.org/show_bug.cgi?id=211117

Jaroslav Kysela ([email protected]) changed:

What |Removed |Added
----------------------------------------------------------------------------

                 CC|                            |[email protected]
            Summary|[oxygen] [virtuoso] route,  |dma_mmap_coherent() -
                   |dmix and other alsa plugins |garbage sound output with
                   |produce garbage output with |mem_encrypt on Ryzen
                   |mem_encrypt on Ryzen        |platform
                   |platform                    |
Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
#3 lore raw

[Bug 211117] dma_mmap_coherent() - garbage sound output with mem_encrypt on Ryzen platform

In reply to a message not in the archive

https://bugzilla.kernel.org/show_bug.cgi?id=211117

--- Comment #16 from Takashi Iwai ([email protected]) --- Yes, this must be a generic issue. I'll ask Christoph at first.

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
#4 lore raw

[Bug 211117] dma_mmap_coherent() - garbage sound output with mem_encrypt on Ryzen platform

In reply to a message not in the archive

https://bugzilla.kernel.org/show_bug.cgi?id=211117

[email protected] changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected]

--- Comment #17 from [email protected] ---
This sounds like a mismatch between the encryption bit in the kernel and the encryption bit in userspace. It looks like that should be taken care of by the dma_pgprot() call in dma_mmap_attrs() or in iommu_dma_mmap(). But maybe the force_dma_unencrypted() in arch/x86/mm/mem_encrypt.c needs to understand if the IOMMU is doing the mapping. Since, even if the device doesn't support 48-bit or higher DMA, it will still done encrypted because of the IOMMU. I don't see any dmesg output, is the IOMMU enabled? What happens if you do iommu=pt on the kernel command line?

Alternatively, if you want memory encryption for your bare-metal system, you can see if the BIOS supports TSME (Transparent SME). Then you can remove mem_encrypt=on or add mem_encrypt=off (if enabled by default), and still get memory encryption.

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
#5 lore raw

[Bug 211117] dma_mmap_coherent() - garbage sound output with mem_encrypt on Ryzen platform

In reply to a message not in the archive

https://bugzilla.kernel.org/show_bug.cgi?id=211117

--- Comment #18 from Triton Circonflexe ([email protected]) --- Tested with iommu=pt (and no mem_encrypt option, so "on" by default): still white noise.

Regarding the encryption, I don't really have a _need_ for that. If I use it, it's in part because Virtualbox seems to require it in some use cases (not even entirely sure about that) and mostly because it's activated by default (and I like default settings to work correctly).
I checked the BIOS anyway but did not find any TSME or similar option (thanks for the information, though).

Right now, I'm working with mem_encrypt=off and I can do everything I need for now (no vbox for the moment).
I will continue to follow this bug because I can reproduce the problem easily and do tests if required.

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.