Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp606339pxb; Wed, 6 Oct 2021 11:26:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTvqle9VS1kzT5fBgW/JwexlpmsyApX39hmjvQg48y7JrVI9TmaLkcrBNcnuzA8LOfdzZ5 X-Received: by 2002:aa7:d7d2:: with SMTP id e18mr14400611eds.126.1633544760565; Wed, 06 Oct 2021 11:26:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633544760; cv=none; d=google.com; s=arc-20160816; b=xrW9HyfjRO9zQV/WDlaOLoEHFrJSbBoQzjn1eEUW0tHsYG/KLXr9Pff4BCdw9/ci9L oK5Skz6zf+42KsdoWFwIe8XDQZsMwNbFQ91TLyZ0QTjZH9Pjg0UNnY4evR8VL0R+s32k WFUwxVxLV4O/aYRwl2yzR2Uvq2xaGXdU/qgbFYF4Bj96IBkwh+wbeyLpILiKxHg83VOZ s7ogZCQp6XOmt3gpDL8ImJ/VcmFy0gmKpDpHGk+Mg2W+hG1r3sPvbqClJsGOARm8DuP3 X4SCd+NuBl9WlLye18NRhqIg3A6F6vX04iMfhuz312sfJ3k13rvrnb6/6avPJGe6n3co nbGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=pH1BgCGgyot6UfzzXy0SswyDq/UI1YakCT6GvUCirKw=; b=h9e1RFia5+eX7US/9Ty60xw/D5OSngmEnMpofP9NxWqFyzK7rcvE9T4cYdbm3AtqVH xpAhtfJxz6WQ9m6xrfQnUu/I2q9wXRxx5yKXN4QlnzkCuBip/e3y4PYnudeMT+jnsWv/ gFZyEzDA3hs2J/DrCW56SZcnJ3SLME1GNS6qZydEXDyQKmZt9/0ZBvoa4kygHIfRtGmy TSHeJQVxVMNiwYZ+YPPBHyzmHQKlj1w3JVta5gEAQA1Du0EJ3Dz0cMDPaZJCe3iN4yCL tPYlN2BaE6u4hhiTsOePmFXS+dACLSLtDUwg5QM22Ssoj4Y1pWPGHfMe3kdxJugHw7E2 ljRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=oVmbu+zc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v10si1071388eda.536.2021.10.06.11.25.35; Wed, 06 Oct 2021 11:26:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=oVmbu+zc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238900AbhJFSXv (ORCPT + 99 others); Wed, 6 Oct 2021 14:23:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238119AbhJFSXu (ORCPT ); Wed, 6 Oct 2021 14:23:50 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D12ACC061746 for ; Wed, 6 Oct 2021 11:21:57 -0700 (PDT) Received: from zn.tnic (p200300ec2f0d3600a30656d48e985313.dip0.t-ipconnect.de [IPv6:2003:ec:2f0d:3600:a306:56d4:8e98:5313]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 2A0B31EC0409; Wed, 6 Oct 2021 20:21:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1633544516; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=pH1BgCGgyot6UfzzXy0SswyDq/UI1YakCT6GvUCirKw=; b=oVmbu+zc1maiohCcroG06IQIcsjl8Q9q3UgtvojYzwsuZVdAV/xkpZ98xRPQOzvRyf14pF BTB/m6iRzqe8ecmlxH8p0xopY+XFKBtvaUARBnIxzMirQWPvqIWH+a16jFJGEdyjnO06YQ e11g8v3++pB1AN3dgD6V8/qUXjVBPVA= Date: Wed, 6 Oct 2021 20:21:52 +0200 From: Borislav Petkov To: Alex Deucher Cc: Tom Lendacky , Paul Menzel , Thomas Gleixner , Ingo Molnar , X86 ML , Dave Hansen , Andy Lutomirski , Peter Zijlstra , LKML , amd-gfx list Subject: Re: `AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT=y` causes AMDGPU to fail on Ryzen: amdgpu: SME is not compatible with RAVEN Message-ID: References: <8bbacd0e-4580-3194-19d2-a0ecad7df09c@molgen.mpg.de> <96f6dbed-b027-c65e-6888-c0e8630cc006@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 06, 2021 at 02:10:30PM -0400, Alex Deucher wrote: > This is not limited to Raven. That's what the innocuous "a.o." wanted to state. :) > All GPUs (and quite a few other > devices) have a limited DMA mask. AMD GPUs have between 32 and 48 > bits of DMA depending on what generation the hardware is. So to > support SME, you either need swiotlb with bounce buffers or you need > IOMMU in remapping mode. The limitation with Raven is that if you want > to use it with the IOMMU enabled it requires the IOMMU to be set up in > passthrough mode to support IOMMUv2 functionality for compute support > and due to other hardware limitations on the display side. So for all > GPUs except raven, just having IOMMU enabled in remapping mode is > fine. GPUs from other vendors would likely run into similar > limitations. Raven just has further limitations. Hmm, and in passthrough mode it would use bounce buffers when SME is enabled. And when those 256K are not enough, it would fail there too, even with IOMMUv2. At least this is how it looks from here. Dunno, it feels like doing GPU compute and SME does not go hand-in-hand real smoothly currently but that probably doesn't matter all too much for both user camps. But that's just me with a hunch. > Another option would be to enable SME by default on Epyc platforms, > but disabled by default on client APU platforms or even just raven. Thing is, we don't know at SME init time - very early during boot - whether we're Epyc or client. Can we find that out reliably from the hw? And even if we do, that's still not accurate enough - we wanna know whether the IOMMU works. So I guess we're all left to the user to decide. But I'm always open to suggestions for solving things in sw and not requiring any user interaction. > Other than these comments, looks fine to me. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette