Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp616559pxb; Wed, 6 Oct 2021 11:39:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzFjg2kFSwoIBF+qSjvVEVfA+vk6rQaELgAT9lRLE5fAZWpHs9MMtbmAYnZNZ02uNJJcOgK X-Received: by 2002:a17:902:9a97:b0:13e:2da4:8132 with SMTP id w23-20020a1709029a9700b0013e2da48132mr12559379plp.34.1633545590613; Wed, 06 Oct 2021 11:39:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633545590; cv=none; d=google.com; s=arc-20160816; b=MMlHic1b5TCrXlR4kWlmCQmewzs4IN2zAeFSJxZBfTTdwbpBLl8/VMrkHcsFGSP+5d zjd6dPKoCB/12vFOjdB6/XgKtIlVFO3MhS7jEnUFdVU2iaB+vgXnImp+nLoivo+5MXkt TZGqfSqcWJGaGssR9yerFSrux9UN209JhU/l1CUxFFlTV8i6F/zNuT/i5ulmAoy5JbUO jMNl7uJ0i3W1E3QBKYVjrE1HJpeyMUWdKp87Hu6BbYcbDWpMY0eGwogrHFjrnaZicLNu SCrdmZ2WQYofpzpfcEOrt0SwbXQVKnPj0C0WMduH3Tbfg7gw8eGibDt+2ydQqforrn8l oBAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=0hugsBbFZUCDXNjsc+rGS4MvBKlrA0O8GjGIvI5uqac=; b=u/3xDdLntnSwGtZ6r/UqO+VOugTzp3UUssDXDfFup1MGbHdlJVcTR6edhTDdmudGBT hKF89cgsTokTlNS8vQ8/BDvV3bukyeKUNJ+hcXDkFQJaQidGJRmFF94+GNJV1zHJ0Kmn OT18g+YKJ5/G3X9rR3sGj+Rqv8HSFArshPdK2UmKfztVBXZlECc+6yiCQ4ZktWXrZ1Td TEfnaylQMHr5Kmgo1fVnEMrMRwQ2YaHssO5pAxlOsg2qCt1egC5j2sUqLO6IYSEI9ZUG AiQfPaUhUGWDHVxeUoy8efg0c5uG24q6wTUeeh2LrWM/xGlungq+XkqmalAMvTGjRO1I 7thQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=hHwBl24o; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t22si13157992pgb.212.2021.10.06.11.39.36; Wed, 06 Oct 2021 11:39:50 -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=@gmail.com header.s=20210112 header.b=hHwBl24o; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232027AbhJFSjA (ORCPT + 99 others); Wed, 6 Oct 2021 14:39:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229992AbhJFSjA (ORCPT ); Wed, 6 Oct 2021 14:39:00 -0400 Received: from mail-ot1-x32b.google.com (mail-ot1-x32b.google.com [IPv6:2607:f8b0:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8D5AC061746 for ; Wed, 6 Oct 2021 11:37:07 -0700 (PDT) Received: by mail-ot1-x32b.google.com with SMTP id u20-20020a9d7214000000b0054e170300adso4240646otj.13 for ; Wed, 06 Oct 2021 11:37:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=0hugsBbFZUCDXNjsc+rGS4MvBKlrA0O8GjGIvI5uqac=; b=hHwBl24oGcmxhDDwfRwb/ze3Gxl536nKMitO2Ow9cOzjg6AWe7IFyhl++56ViyVrQm K8Lbfr0qim9BfXvS2RMqMc1GW/jI0nMFM/Owj06IfEtWGZG1QdoHarcCDYQFqHQk49km FnkSPQoB3UqIDiBP4cVgF6MY1FxQQq8MSaHi/NzC6iynU8IA2nqZUR5TYcJx7PQI2k1H UwZEbIk/F5n06P3YTODO+v9QVWVVoBt5/GRQlDyO8qJEOUWyyhBnZUGjIKq6OUD9g/GZ P0iCTfDmgUw5Jeg6fToV2goVvpH/aHD4VV7Npq0V6mGicpiebZ0Tp8PFapzOOeqPGewq 5n4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0hugsBbFZUCDXNjsc+rGS4MvBKlrA0O8GjGIvI5uqac=; b=eYOXcTigI3Gdh4NGGdo/u0Dj7RoLEAr8Vizf1LIvlTLi95irmcVAGHaeRK2wHw5uyQ uB5zd+TcxwYBcnzza4LO79DWY/kWkR1s3d0vI0A16enI3+LICihs5BBu07NoVlXrAxSG INoMGS3qpg+nh6g2AOAuroBS/TY3sYX1aJmZqEX+MjObVRqToL8gDmcarUjh9s8Idb4R vw0wfcX/PhZPNYrtqquIBGBgAex6rsN2Qi1KfSvP2xJkkbn0bcB1JXrvoNzq6mEtaHXH s7REDuC4ZPSJDpgyruX1ARxCNuIJSTcRA8GybJG7QrcOqq7mrFt+rRo44sodpO5PgsKz 7fGw== X-Gm-Message-State: AOAM531XewIRzeMthbvVZUR6o+s0qx4nKzmoU2EzIA/4a5GCgRy8ugYe 6tcx/3FeRlpCfgAXV2XRTOAChYJbMvDxAdP42/U= X-Received: by 2002:a05:6830:1bc6:: with SMTP id v6mr212601ota.299.1633545427166; Wed, 06 Oct 2021 11:37:07 -0700 (PDT) MIME-Version: 1.0 References: <8bbacd0e-4580-3194-19d2-a0ecad7df09c@molgen.mpg.de> <96f6dbed-b027-c65e-6888-c0e8630cc006@amd.com> In-Reply-To: From: Alex Deucher Date: Wed, 6 Oct 2021 14:36:56 -0400 Message-ID: Subject: Re: `AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT=y` causes AMDGPU to fail on Ryzen: amdgpu: SME is not compatible with RAVEN To: Borislav Petkov , Tom Lendacky Cc: Paul Menzel , Thomas Gleixner , Ingo Molnar , X86 ML , Dave Hansen , Andy Lutomirski , Peter Zijlstra , LKML , amd-gfx list Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 6, 2021 at 2:21 PM Borislav Petkov wrote: > > 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. :) Whoops, my eyes passed right over that. > > > 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. Well, this limitation only applies to Raven which is an integrated GPU in client parts. SME was initially productized on server parts so there was not a lot of concern given to interactions with integrated graphics at the time. This has since been fixed in newer integrated graphics. dGPUs work fine as long as the IOMMU is in remapping mode to handle the C bit. > > > 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? > From the x86 model and family info? I think Raven has different families from other Zen based CPUs. > And even if we do, that's still not accurate enough - we wanna know > whether the IOMMU works. Right. > > 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. @Tom Lendacky Any ideas? Alex > > > Other than these comments, looks fine to me. > > Thx. > > -- > Regards/Gruss, > Boris. > > https://people.kernel.org/tglx/notes-about-netiquette