From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 55096C43387 for ; Thu, 10 Jan 2019 19:13:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1F7A3208E3 for ; Thu, 10 Jan 2019 19:13:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547147601; bh=6HjNiUGcF+8EsREza5GfSKJJjnAlumtJ/0mYm5UBtPQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=q7cHceahnDD8wOvksEz+aNXp4zeepmDrDqLBOj+WRXVMl5ZoBn13qfyKDsmz+aM9R f8PAb5tqTvgxJ7pR0DONiORUne/lRjtkD8KX7v29B6qt4LE5uW2iugXIrfloURCGiB 99j/YYwkHimJMnuIb/bv4RdoxNHksPYmhLtSVIDk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729027AbfAJTNU (ORCPT ); Thu, 10 Jan 2019 14:13:20 -0500 Received: from mail.kernel.org ([198.145.29.99]:39686 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728572AbfAJTNU (ORCPT ); Thu, 10 Jan 2019 14:13:20 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E295D20874; Thu, 10 Jan 2019 19:13:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547147599; bh=6HjNiUGcF+8EsREza5GfSKJJjnAlumtJ/0mYm5UBtPQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=oeew7MdNk8pcIpiHQoGDxEKGJzrBnfrk+cVclzk8Y5pjBoUQOPWd+P6xelkfjZPcl cQkgIT7qLASgUMpEv5ITZ3xmw4Qq2v2udn2B1ph7BRVcivYWurMBfYSCaBaXgd/rkF Q6qSAa9HmdGlicI+iC51ZZm651F52B8JJa8LX91c= Date: Thu, 10 Jan 2019 20:13:17 +0100 From: Greg KH To: "Lendacky, Thomas" Cc: "stable@vger.kernel.org" , Sasha Levin Subject: Re: [PATCH] kernel/dma/direct: Do not include SME mask in the DMA supported check Message-ID: <20190110191317.GD18221@kroah.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.2 (2019-01-07) Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Sat, Dec 22, 2018 at 04:32:40PM +0000, Lendacky, Thomas wrote: > commit c92a54cfa0257e8ffd66b2a17d49e9c0bd4b769f upstream > > This fix appears in 4.20, but dma_direct_supported() was changed in 4.20 > such that the original version of the fix will not apply to previous > versions of the kernel. The fix only applies to the 4.19-stable tree and > has been backported for that tree. > > The dma_direct_supported() function intends to check the DMA mask against > specific values. However, the phys_to_dma() function includes the SME > encryption mask, which defeats the intended purpose of the check. This > results in drivers that support less than 48-bit DMA (SME encryption mask > is bit 47) from being able to set the DMA mask successfully when SME is > active, which results in the driver failing to initialize. > > Change the function used to check the mask from phys_to_dma() to > __phys_to_dma() so that the SME encryption mask is not part of the check. > > Fixes: c1d0af1a1d5d ("kernel/dma/direct: take DMA offset into account in dma_direct_supported") > Cc: # 4.19.x > Signed-off-by: Tom Lendacky > --- > kernel/dma/direct.c | 13 +++++++++++-- > 1 file changed, 11 insertions(+), 2 deletions(-) Now queued up, thanks. greg k-h