From patchwork Thu Aug 20 09:22:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 265540 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=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 7845AC433E1 for ; Thu, 20 Aug 2020 11:42:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4F3982054F for ; Thu, 20 Aug 2020 11:42:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597923752; bh=lcTEtvuv4gEDlkkLxpxR49805vP8l+6lZXkQI2AUzyU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=wVmJ0RKL9bx0DoT3urj1+Xq5a6C2f1X+tcvnkwUcwadWGtQF4UipG1611bhCDB4KD jmeoXk846opW2UWT+oRO9Y3Lqj+MGzlnIYY6Y4veKRb227mfFG8pzBOwcOoSsI3+LA y74Wr8xwy1LMDiG9zoOFpG3sf0JXSS2QkeKz01Ic= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730784AbgHTLmK (ORCPT ); Thu, 20 Aug 2020 07:42:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:56020 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728862AbgHTKES (ORCPT ); Thu, 20 Aug 2020 06:04:18 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.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 224C022BF3; Thu, 20 Aug 2020 10:04:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597917857; bh=lcTEtvuv4gEDlkkLxpxR49805vP8l+6lZXkQI2AUzyU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a7yshkJWz5y/q0gi7D8R7tqnj6Y81LxdQl/fAYQrcQyEHSgtmIxLh8V8ZG3FN1dOH 9NzXvlyBzB6uB7zEAxaBb2/K+DjVnOcWdat+tzSuaDF+KMDzFnFnGD8kyhTVMttMl4 tegu4Hxx1FwPKZjEzMleNMfL2F+jd7AxaOlE52mQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sven Schnelle , Helge Deller Subject: [PATCH 4.9 165/212] parisc: mask out enable and reserved bits from sba imask Date: Thu, 20 Aug 2020 11:22:18 +0200 Message-Id: <20200820091610.738352581@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820091602.251285210@linuxfoundation.org> References: <20200820091602.251285210@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Sven Schnelle commit 5b24993c21cbf2de11aff077a48c5cb0505a0450 upstream. When using kexec the SBA IOMMU IBASE might still have the RE bit set. This triggers a WARN_ON when trying to write back the IBASE register later, and it also makes some mask calculations fail. Cc: Signed-off-by: Sven Schnelle Signed-off-by: Helge Deller Signed-off-by: Greg Kroah-Hartman --- drivers/parisc/sba_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/parisc/sba_iommu.c +++ b/drivers/parisc/sba_iommu.c @@ -1283,7 +1283,7 @@ sba_ioc_init_pluto(struct parisc_device ** (one that doesn't overlap memory or LMMIO space) in the ** IBASE and IMASK registers. */ - ioc->ibase = READ_REG(ioc->ioc_hpa + IOC_IBASE); + ioc->ibase = READ_REG(ioc->ioc_hpa + IOC_IBASE) & ~0x1fffffULL; iova_space_size = ~(READ_REG(ioc->ioc_hpa + IOC_IMASK) & 0xFFFFFFFFUL) + 1; if ((ioc->ibase < 0xfed00000UL) && ((ioc->ibase + iova_space_size) > 0xfee00000UL)) {