Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp4033744ybg; Sun, 7 Jun 2020 19:17:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxyMfBhIg82AW6GF5YO9/iaFl8i3u61ltZOgqWgbNfqeywSMmInT7sdm0PCmicJh8PUae5 X-Received: by 2002:a17:906:940d:: with SMTP id q13mr19178804ejx.534.1591582677138; Sun, 07 Jun 2020 19:17:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591582677; cv=none; d=google.com; s=arc-20160816; b=d3BSnTwd1mVl++m5YCSYaMRGnjymekhEA0KxwhZWupH1RcNpgWUarrsVKQf2HpfBnf 4aFwC7SygSa9rmcKTq8nqzuh1BTDpP5LVWdKHJ9nMk2zQ/FNsnNeGx7amUSM4qLA8TJ4 zqU5mUw4HSd42wqkfnns+x4LhtJhE0769Vt7/K/lvGGeuL1sRe8qbMcLqOvZvs0H5wQK cjIPnl9RbPVhN+WTbeRdQ7SWHBWmFEUDemffMovTr08KQNz8BswEg+I0Wcqn96gfKUcO ggCjYcmhW2waGyMy33xHlN1se4XJ34dUKeTG0CtnBjyO3r7G/SSltAekDrBASpYfdDa2 ZZ8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:message-id :mime-version:in-reply-to:references:cc:to:subject:from:date :dkim-signature; bh=LeNZHONdlm6bcYug9q3xuSIHrVN5iUaoxaV6Ago7nbU=; b=Sjnas+06MPrGj5ZEwOfXrtQmCjiG+wDhCbNXDyqf3+s9E0+aQHETEXg8gdbh6vDKrc //vcWHVVHwWlaKC1pPbHI/a2HzAoLlrxZeKGZ+x1SSJBXsEAoZqy21gOGxNFyZ23eN8Z Qg/1clUhM/wV5DDRxdkzae/5JulmZvWzNZnGixSCJz2NG9CrRVFLGDSdGgdEaXGlSCgQ l7p8aCpiL7msRFI/3nAWMPpU97gznGLgk6EYtDhU9JDFOBJsMyZH6QfYSbrOjfgydz0h Eq+1T8HSvjRi0XGTxC28kcDKoM/YnlHGtGBANBxM45FYs2fM7C62IDULZ+xFF1UZUEVT dayQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yahoo.ca header.s=s2048 header.b=hbSl9fSA; 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=REJECT sp=REJECT dis=NONE) header.from=yahoo.ca Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j10si7803024ejm.673.2020.06.07.19.17.34; Sun, 07 Jun 2020 19:17:57 -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=@yahoo.ca header.s=s2048 header.b=hbSl9fSA; 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=REJECT sp=REJECT dis=NONE) header.from=yahoo.ca Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728462AbgFHCPt (ORCPT + 99 others); Sun, 7 Jun 2020 22:15:49 -0400 Received: from sonic306-48.consmr.mail.gq1.yahoo.com ([98.137.68.111]:41344 "EHLO sonic306-48.consmr.mail.gq1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726662AbgFHCPs (ORCPT ); Sun, 7 Jun 2020 22:15:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.ca; s=s2048; t=1591582547; bh=LeNZHONdlm6bcYug9q3xuSIHrVN5iUaoxaV6Ago7nbU=; h=Date:From:Subject:To:Cc:References:In-Reply-To:From:Subject; b=hbSl9fSAaV+D3pugnsrFXMzN8fmQUT/2+N/GnpbslnifsZal7YrZOMPxmAsYqEX9cVCNw3kPhLQIUXd2ImeZOy85ixESRKVKOiJ/T1y1B0f8+PK/Lbu/RbGkvvAgqvj2+m8FIPGlWuirFh4ajkKZnpFDcAqodR/Ksc3122TRYKEI0BecV4Lk+eYZuEQQLbUk6OFlg26TlqUYGMl5mFcd1dJgBjkj06biu0Tulbh4fuzPC1IbUE2f32VhYc1qOdgEWNtYZ/GmVHAAB5yTsHUP9gSt7h1vSQ9YKuO3c9VStNbsU6kO9cgWDyY+56Dk+zW5fggGjJVVfZeBFIOM3aABEQ== X-YMail-OSG: N_6BpMEVRDvd.miR6A7lED5GPdAEx7ojsA-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.gq1.yahoo.com with HTTP; Mon, 8 Jun 2020 02:15:47 +0000 Received: by smtp431.mail.gq1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 3b13a0cd26292fd40daa8b7a3122671d; Mon, 08 Jun 2020 02:13:45 +0000 (UTC) Date: Sun, 07 Jun 2020 22:13:42 -0400 From: "Alex Xu (Hello71)" Subject: Re: 82fef0ad811f "x86/mm: unencrypted non-blocking DMA allocations use coherent pools" was Re: next-0519 on thinkpad x60: sound related? window manager crash To: David Rientjes Cc: alsa-devel@alsa-project.org, bp@alien8.de, hch@infradead.org, hch@lst.de, hpa@zytor.com, linux-kernel@vger.kernel.org, mingo@redhat.com, Pavel Machek , perex@perex.cz, tglx@linutronix.de, tiwai@suse.com, x86@kernel.org References: <20200520111136.GA3802@amd> <1591545088.74ii116nf2.none@localhost> <20200607163803.GA10303@duo.ucw.cz> <1591570155.2tn9o40h95.none@localhost> In-Reply-To: MIME-Version: 1.0 Message-Id: <1591582140.kcn3hpk42g.none@localhost> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Mailer: WebService/1.1.16072 hermes_yahoo Apache-HttpAsyncClient/4.1.4 (Java/11.0.6) Content-Length: 1504 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Excerpts from David Rientjes's message of June 7, 2020 8:57 pm: > Thanks for trying it out, Alex. Would you mind sending your .config and=20 > command line? I assume either mem_encrypt=3Don or=20 > CONFIG_AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT is enabled. >=20 > Could you also give this a try? >=20 > diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c > --- a/kernel/dma/direct.c > +++ b/kernel/dma/direct.c > @@ -99,10 +99,11 @@ static inline bool dma_should_alloc_from_pool(struct = device *dev, gfp_t gfp, > static inline bool dma_should_free_from_pool(struct device *dev, > unsigned long attrs) > { > - if (IS_ENABLED(CONFIG_DMA_COHERENT_POOL)) > + if (!IS_ENABLED(CONFIG_DMA_COHERENT_POOL)) > + return false; > + if (force_dma_unencrypted(dev)) > return true; > - if ((attrs & DMA_ATTR_NO_KERNEL_MAPPING) && > - !force_dma_unencrypted(dev)) > + if (attrs & DMA_ATTR_NO_KERNEL_MAPPING) > return false; > if (IS_ENABLED(CONFIG_DMA_DIRECT_REMAP)) > return true; >=20 This patch doesn't work for me either. It has since occurred to me that=20 while I do have CONFIG_AMD_MEM_ENCYRPT=3Dy, I have=20 CONFIG_AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT=3Dn, because it was broken with=20 amdgpu (unfortunately a downgrade from radeon in this respect). Tried it=20 again just now and it looks like it's now able to enable KMS, but all it=20 displays is serious-looking errors. Sorry for not mentioning that earlier. I'll send you my .config and=20 command line off-list. Thanks, Alex.