Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2352799pxb; Mon, 20 Sep 2021 19:50:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJypvXPbToj4DhFfEtywoWoKXE8a3dnPEImj7zUsiYk1Ji6imaoSrjMkqYFQhLSYZOcS8mMb X-Received: by 2002:a05:6602:2c05:: with SMTP id w5mr21575809iov.160.1632192614367; Mon, 20 Sep 2021 19:50:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632192614; cv=none; d=google.com; s=arc-20160816; b=J6Z3pcqAF8GYN0RNgFDg2C/Wl0cDy8LJ3uIJbpWEah3itTGYyn8MowHQZJcH6y4CoV GwGa12mMgcpu4G5DI1GgtRtdpcGNNa3T1x38TKpg8n42cR37nnwVAGULp8cj+QIzIziq YsRG/m4FJFwh16jBkvV48402izjacxfmZ2huwljpEp9mZBGtQsMSzQUvFGINWl6r0Dvk qmNmpDlJMUOdFU0I52WZoOFA5q8z4I2GacRwUAu80B2AX9KnhVGXlCm0zg+2Gkn5MfyY 792Iy5+etIo/gV1+CcaCuYmNu3DBOE32ZElo3Nwprfx5fXQRQIuSKVjzY7+QRXU5mn4z DBbA== 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=r4OBnty+qkF7FLOwCxp8CeSCBNCXRJ1ooIqdIEFSdMY=; b=YVJ45Y/XoCXw7ggsK/F3+VCrUm+mz6Q1YH0jvNnTO6PTj6d8eIPfShAFuL/7diOR8K g92cn3At7J5BhWfSTNnUBr9Q5MxcfHHdEEtk/KFxDqLWNGEVye6H4khuOYFvI3sjFb6U c/dRb0wSNl2EBGAugrCTeYpXk1PaCHNPY/MHL30h0N6V5OXtqwr2UzfnteXqym52R7ZO RdxXUr/GOh1V/vxzIKIBNgsj7uXcr/JDJIJVBIhA2n/tuX5+FxytJmmYyfhQasT6l4Df oIppmzPnoZ9cWhC3aLws+MfN6ubsl1V1y0Za5EStoIP7iiJlKlbK9JzW+mNd2eGz2Kdy 4vrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yyVhp8Vs; 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 d3si1383813ile.167.2021.09.20.19.50.03; Mon, 20 Sep 2021 19:50:14 -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=yyVhp8Vs; 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 S1383220AbhITSoR (ORCPT + 99 others); Mon, 20 Sep 2021 14:44:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:54226 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381473AbhITSiR (ORCPT ); Mon, 20 Sep 2021 14:38:17 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 662FE61440; Mon, 20 Sep 2021 17:29:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632158989; bh=i4LcWwvR2rayH2yP62levZhOyXc56jezu34Fls1SmV0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yyVhp8VsurQY3dGZQouQ9b9HG3kmxHiGlAWiN5P9Rc2NXK5/YL4VH4LFR9En2LTr5 Zfvdi/JfcT7bfIDA9Ab50CURlP89olRWTbDktskNO+PGCtN4I3iYmc3RZHpopsnvzj b7Qu315iszZ1XIjVVzqfv9eOWEGUaDlDJVrLe9BM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jan Beulich , Christoph Hellwig , Juergen Gross Subject: [PATCH 5.14 003/168] swiotlb-xen: fix late init retry Date: Mon, 20 Sep 2021 18:42:21 +0200 Message-Id: <20210920163921.756646422@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163921.633181900@linuxfoundation.org> References: <20210920163921.633181900@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: Jan Beulich commit 4c092c59015f7adf0f07685f869edb96d997a756 upstream. The commit referenced below removed the assignment of "bytes" from xen_swiotlb_init() without - like done for xen_swiotlb_init_early() - adding an assignment on the retry path, thus leading to excessively sized allocations upon retries. Fixes: 2d29960af0be ("swiotlb: dynamically allocate io_tlb_default_mem") Signed-off-by: Jan Beulich Cc: stable@vger.kernel.org Reviewed-by: Christoph Hellwig Signed-off-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/778299d6-9cfd-1c13-026e-25ee5d14ecb3@suse.com Signed-off-by: Juergen Gross --- drivers/xen/swiotlb-xen.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/xen/swiotlb-xen.c +++ b/drivers/xen/swiotlb-xen.c @@ -211,8 +211,8 @@ error: if (repeat--) { /* Min is 2MB */ nslabs = max(1024UL, (nslabs >> 1)); - pr_info("Lowering to %luMB\n", - (nslabs << IO_TLB_SHIFT) >> 20); + bytes = nslabs << IO_TLB_SHIFT; + pr_info("Lowering to %luMB\n", bytes >> 20); goto retry; } pr_err("%s (rc:%d)\n", xen_swiotlb_error(m_ret), rc);