Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1963055pxb; Thu, 16 Sep 2021 21:43:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPxHJprYHYbhpzvVCZUPz5WFoP68fC9+SmU9uMMAGJADYK0Qa2u0EN1sgvB499CmMtVpvX X-Received: by 2002:a05:6402:31eb:: with SMTP id dy11mr10705990edb.17.1631853785635; Thu, 16 Sep 2021 21:43:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631853785; cv=none; d=google.com; s=arc-20160816; b=lbYp1yjjv69a5ts4qJPbn4DUODyck/A9uAwv+pNRwQlcOlghNcc/GfGa+w+w2JN6Jq o68fRjNgkGv5rsomtyGK3baA3IhCKYfF44j77AJMHSLIoZW7VVJCZGhRro/2SJxOXKNJ 9/TyKGiBzsvMGvoxOdSJn0a/+pr2SPOql2R+yb8lZ3EwhRUA9kFilEwcL3wehXdA9cYq B/2NizuggdpTpInj5BXKYOBgGvYvDnWGfpMeCIZEjG5uaPqsH1Ge7qekVdh5TS+Wy2CE ujBphkPuc6gbliVPg90Rs5I9rTgFl2n8PBbLsr26mAAmp4kPbYnqv4pVoxFHqwcNb3jJ YfHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9uHHlLWDCj/1aAx3PhOkjtAu6SscNirez6vPnn6arhs=; b=jDLXZnDdtCCgHgj5QtxnKsu/bYrqLgL7QguDqXvgkq2cAu6j+5LO0R6g489W3TdIgJ C2S8Utr7Pj7YL423odqs67cbgbFLXsGFMfBS9gSLFT9veNywH2v2aYZ+p4v2TnWHgjXn kQNb4OAQJFaPQ31txfu+RLIuebEjifAc7N9G5XjrL2RYvNe7BPYYxHUYJUUfznXc80tQ sM2FM6Bt3L6doCHfrnfVi0Bujf/GDAzvK2HZqCREo16wiPvisDeiQ5O4AQOvfDksf78E hcfN2FPKztwElLDxsQvH4TXeUVlcaVrcc6i1DBNKraUv5jzrFyecwyfpZgOJScERQ1o/ jPJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mO04xN1v; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 8si5251006ejd.768.2021.09.16.21.42.42; Thu, 16 Sep 2021 21:43:05 -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=@linuxfoundation.org header.s=korg header.b=mO04xN1v; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350699AbhIPRtP (ORCPT + 99 others); Thu, 16 Sep 2021 13:49:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:57062 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355364AbhIPRlX (ORCPT ); Thu, 16 Sep 2021 13:41:23 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 397FA61A84; Thu, 16 Sep 2021 16:52:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631811148; bh=BBeyKNK44+fXwO9rcbxjtQzZo+draOt3fVXpXTPATWw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mO04xN1vk7H2HvMvsppBAGafzP5g8rBQ0CdRRPuDS8gUhOTGHdNtKIzqE7tLokGj6 KTfkt33V821Tdte/W91OJw+yeDq6siazJ8Z2Mk7mRfWnYvfE/LynOK/Sv1cFFeAq7d hauy53t8Wlnz8PRY4BvENGKQvuph61g4ify+4t4o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Halil Pasic , Christian Borntraeger , Konrad Rzeszutek Wilk Subject: [PATCH 5.14 400/432] s390/pv: fix the forcing of the swiotlb Date: Thu, 16 Sep 2021 18:02:29 +0200 Message-Id: <20210916155824.390648165@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155810.813340753@linuxfoundation.org> References: <20210916155810.813340753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Halil Pasic commit 93ebb6828723b8aef114415c4dc3518342f7dcad upstream. Since commit 903cd0f315fe ("swiotlb: Use is_swiotlb_force_bounce for swiotlb data bouncing") if code sets swiotlb_force it needs to do so before the swiotlb is initialised. Otherwise io_tlb_default_mem->force_bounce will not get set to true, and devices that use (the default) swiotlb will not bounce despite switolb_force having the value of SWIOTLB_FORCE. Let us restore swiotlb functionality for PV by fulfilling this new requirement. This change addresses what turned out to be a fragility in commit 64e1f0c531d1 ("s390/mm: force swiotlb for protected virtualization"), which ain't exactly broken in its original context, but could give us some more headache if people backport the broken change and forget this fix. Signed-off-by: Halil Pasic Tested-by: Christian Borntraeger Reviewed-by: Christian Borntraeger Fixes: 903cd0f315fe ("swiotlb: Use is_swiotlb_force_bounce for swiotlb data bouncing") Fixes: 64e1f0c531d1 ("s390/mm: force swiotlb for protected virtualization") Cc: stable@vger.kernel.org #5.3+ Signed-off-by: Konrad Rzeszutek Wilk Signed-off-by: Greg Kroah-Hartman --- arch/s390/mm/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/s390/mm/init.c +++ b/arch/s390/mm/init.c @@ -186,9 +186,9 @@ static void pv_init(void) return; /* make sure bounce buffers are shared */ + swiotlb_force = SWIOTLB_FORCE; swiotlb_init(1); swiotlb_update_mem_attributes(); - swiotlb_force = SWIOTLB_FORCE; } void __init mem_init(void)