Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp467653ybl; Tue, 28 Jan 2020 06:25:57 -0800 (PST) X-Google-Smtp-Source: APXvYqziG3dQB5oPMIsSuR2obF+yVthhdLmVDrElQ0sW1GmBvdO04d7oymrnhWY8LQwSBqlz4bOf X-Received: by 2002:aca:ad11:: with SMTP id w17mr3056585oie.85.1580221557478; Tue, 28 Jan 2020 06:25:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580221557; cv=none; d=google.com; s=arc-20160816; b=a51BVW729IjSzcEm9l3CQQ80TPg8TL5ilU4DEnb8ArKla3keV4vOSt3GeWC8Dkm9NK nT3KAX272J9iLZpodQ415BkAa3n7+3rJpI5BSY69C9Mo6vtGkOPha1tnxBho9SovD6Jt GxNdozbtTA4c49YiaDsaiNMb/atpdLauvVDl7BREeaDQfPREGJpu1DFl/Dmni5EAmMcb JGp+/5rEUI0502iRtI6ZBRIQYIuHO3rxUaI18NXZ9/hakUR4BWOgufDZj53lNdk9w/7i mOtGUFNo5K5hFlHZl0Xjg/9ZNcTkmbI0iQrzRrdOy+E3gbDFkmNzopwZaItK8rI51d6z TwhA== 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:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=hvA0uVxorKv4Ao+Rdq9RRoDm8yWbjclINoJZ98dBoDA=; b=xe40a5r9VASqY4yGG0R8nwzna+n/gOr3J+a3lIMAoFwsk3Ydp+4hIemDd9Gx6RMUTm vR58ZWEJHWVdzmb7+s7ygEwAp81bK/VqLcRYZIWVkgGfdS/J75mLEfg8NCRZpyrO0T8e R2EG5klXQmNkXcNmJM2rIyJPwCH2fCRs0lQL5l3XR+4Wo23rJJkmbuYQdKEOL58FGqAc F1QXkQKekSDkPFQwQuDn9lppoI96MJpwaEznpttIvh20+uIQyTFwBPcua4CwaxlCYCw8 54PVEAEdOGxJftBkl+nZzFQNvcZurpSbCH3LFLsdF16n7ZycTkhwXK+ttI24xZ+QxVCe l3dQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Fj9F/5kw"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q6si10511028otg.248.2020.01.28.06.25.45; Tue, 28 Jan 2020 06:25:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Fj9F/5kw"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729663AbgA1OYy (ORCPT + 99 others); Tue, 28 Jan 2020 09:24:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:51710 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732766AbgA1OYv (ORCPT ); Tue, 28 Jan 2020 09:24:51 -0500 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 70D542468A; Tue, 28 Jan 2020 14:24:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580221489; bh=krkpRTJjaq0aPRrGNgYXqjuGQlifAOUX/tNFEfRm/jU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Fj9F/5kwalY8V1+oj8vzJqab96lw7EXIdnmlPNMFEWqsCUAtBJXiVPd0S8yL83cyM o+QNpHbyVbZQpKh7O+VsAHIlfmyQOvn19zEEXM+0ucooVysKJRVoBGQAYKefVoqYRm z+g8wO258hiE7nCGAoIEX0NoLiYe5Sq5GBdoGErQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sam Bobroff , Alex Deucher , Sasha Levin Subject: [PATCH 4.9 228/271] drm/radeon: fix bad DMA from INTERRUPT_CNTL2 Date: Tue, 28 Jan 2020 15:06:17 +0100 Message-Id: <20200128135909.551165717@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200128135852.449088278@linuxfoundation.org> References: <20200128135852.449088278@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sam Bobroff [ Upstream commit 62d91dd2851e8ae2ca552f1b090a3575a4edf759 ] The INTERRUPT_CNTL2 register expects a valid DMA address, but is currently set with a GPU MC address. This can cause problems on systems that detect the resulting DMA read from an invalid address (found on a Power8 guest). Instead, use the DMA address of the dummy page because it will always be safe. Fixes: d8f60cfc9345 ("drm/radeon/kms: Add support for interrupts on r6xx/r7xx chips (v3)") Fixes: 25a857fbe973 ("drm/radeon/kms: add support for interrupts on SI") Fixes: a59781bbe528 ("drm/radeon: add support for interrupts on CIK (v5)") Signed-off-by: Sam Bobroff Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/radeon/cik.c | 4 ++-- drivers/gpu/drm/radeon/r600.c | 4 ++-- drivers/gpu/drm/radeon/si.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c index b99f3e59011c1..5fcb5869a4891 100644 --- a/drivers/gpu/drm/radeon/cik.c +++ b/drivers/gpu/drm/radeon/cik.c @@ -7026,8 +7026,8 @@ static int cik_irq_init(struct radeon_device *rdev) } /* setup interrupt control */ - /* XXX this should actually be a bus address, not an MC address. same on older asics */ - WREG32(INTERRUPT_CNTL2, rdev->ih.gpu_addr >> 8); + /* set dummy read address to dummy page address */ + WREG32(INTERRUPT_CNTL2, rdev->dummy_page.addr >> 8); interrupt_cntl = RREG32(INTERRUPT_CNTL); /* IH_DUMMY_RD_OVERRIDE=0 - dummy read disabled with msi, enabled without msi * IH_DUMMY_RD_OVERRIDE=1 - dummy read controlled by IH_DUMMY_RD_EN diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index f2eac6b6c46a3..9569c35f8766a 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c @@ -3697,8 +3697,8 @@ int r600_irq_init(struct radeon_device *rdev) } /* setup interrupt control */ - /* set dummy read address to ring address */ - WREG32(INTERRUPT_CNTL2, rdev->ih.gpu_addr >> 8); + /* set dummy read address to dummy page address */ + WREG32(INTERRUPT_CNTL2, rdev->dummy_page.addr >> 8); interrupt_cntl = RREG32(INTERRUPT_CNTL); /* IH_DUMMY_RD_OVERRIDE=0 - dummy read disabled with msi, enabled without msi * IH_DUMMY_RD_OVERRIDE=1 - dummy read controlled by IH_DUMMY_RD_EN diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c index b75d809c292e3..919d389869ceb 100644 --- a/drivers/gpu/drm/radeon/si.c +++ b/drivers/gpu/drm/radeon/si.c @@ -6018,8 +6018,8 @@ static int si_irq_init(struct radeon_device *rdev) } /* setup interrupt control */ - /* set dummy read address to ring address */ - WREG32(INTERRUPT_CNTL2, rdev->ih.gpu_addr >> 8); + /* set dummy read address to dummy page address */ + WREG32(INTERRUPT_CNTL2, rdev->dummy_page.addr >> 8); interrupt_cntl = RREG32(INTERRUPT_CNTL); /* IH_DUMMY_RD_OVERRIDE=0 - dummy read disabled with msi, enabled without msi * IH_DUMMY_RD_OVERRIDE=1 - dummy read controlled by IH_DUMMY_RD_EN -- 2.20.1