Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2172620iof; Tue, 7 Jun 2022 22:08:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyO5lO9Nfc1LbzHAuyRlqiUgT2UcDEvI2YpjqRJEaHPjZk2y1jgFcUN4VSaOEPU+wsiZ0kI X-Received: by 2002:a17:90b:2c0b:b0:1e3:25d3:e770 with SMTP id rv11-20020a17090b2c0b00b001e325d3e770mr48952817pjb.101.1654664897370; Tue, 07 Jun 2022 22:08:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654664897; cv=none; d=google.com; s=arc-20160816; b=S05jsKU3t831ZlFRxX8BcMtkPEdYHJzObDuj8hUIAyf8ViBdhEL4wR4nXizrZ9pXvI ad3BbKTMi/boLVE1AiWHKmFBuJDhR3YwNSeOWbJV+jeoDXh7+xQkmhk7BPJZRkZxs5VF XQmDkrf5fCkzJzwwoX4vOqgb0KQKgJ6gmGGe6ChTX6PB4jm7oegG2ThnCDkD7fLzG+9a 7DC3E6uLyx+AiETxZ+bUBANwTKpNUDo35jAPiGy+GOEvevU38YngK0aD3N8JurCgA+ie yXDxD2jD+Hv/m94vkKGPxrvXrHlJLi4V9CVPLE7io0trHge838xaDd00CIsh4s+1InyD UE6g== 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=ZgbqoWmVh8unwI+8+KB+XyDaFO15cUwY+W/0lJyyZyU=; b=DOoSZoiJNrq8rSaA+3cqu40vQF70bJj1H0A3jioTnDZ+i9CPscezFyX/fpfDENhxhf v6Y7SRdppuLz9gJcX6RSc25sDG20F5dANTpfQtpYmZoUdRXMfeQ++SNpu/V7eyP50eX+ vwIrMyHLzNee0CHXkglnZZSehOOurPIfhl7Lq16BKeSmUdHffxxd8d7J7y2itlXzPVHG tMRKtn2L3dBYpGrD1Z2Gj7vLLCRGKleyY8Xi0tuQX+lBWT3CzePFV/8S7B5NGudFmbRy ByhtIQlxq4UJMJcZT5RX9L2V11BTcevcG/GZSK494aswoqGjZ0VEn0fdTXUf7N3giStA 2UUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PGzwbjtx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id bi7-20020a170902bf0700b00156b46e2407si26096739plb.471.2022.06.07.22.08.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 22:08:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PGzwbjtx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 43AFF26E897; Tue, 7 Jun 2022 21:35:27 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1384301AbiFGWZX (ORCPT + 99 others); Tue, 7 Jun 2022 18:25:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381241AbiFGVRa (ORCPT ); Tue, 7 Jun 2022 17:17:30 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 609372218A4; Tue, 7 Jun 2022 11:58:37 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 21ECBB8233E; Tue, 7 Jun 2022 18:58:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7EA8AC385A2; Tue, 7 Jun 2022 18:58:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654628313; bh=pfvUU/V6IqUWT2zQcygVATlHHRSp7oNJoS8dGnypnnU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PGzwbjtxLeswzkoigfBeOkFLgrnkR1lBW89U40JVhnlEyo5gQaf8EfNLb5jEkj+VD pJ38mT4b6oqx4j7859x2uDI9fNvk157dB9uIGw9i1onDSp5Di0seZ1Ha5X4ygvHFYM UrDB4i7b5YxZ1vTJ8Eq9KcEDAvFGF7hUtH/Cu7aI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Ellerman , Haren Myneni , Sasha Levin Subject: [PATCH 5.18 243/879] powerpc/powernv/vas: Assign real address to rx_fifo in vas_rx_win_attr Date: Tue, 7 Jun 2022 18:56:01 +0200 Message-Id: <20220607165009.906409912@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Haren Myneni [ Upstream commit c127d130f6d59fa81701f6b04023cf7cd1972fb3 ] In init_winctx_regs(), __pa() is called on winctx->rx_fifo and this function is called to initialize registers for receive and fault windows. But the real address is passed in winctx->rx_fifo for receive windows and the virtual address for fault windows which causes errors with DEBUG_VIRTUAL enabled. Fixes this issue by assigning only real address to rx_fifo in vas_rx_win_attr struct for both receive and fault windows. Reported-by: Michael Ellerman Signed-off-by: Haren Myneni Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/338e958c7ab8f3b266fa794a1f80f99b9671829e.camel@linux.ibm.com Signed-off-by: Sasha Levin --- arch/powerpc/include/asm/vas.h | 2 +- arch/powerpc/platforms/powernv/vas-fault.c | 2 +- arch/powerpc/platforms/powernv/vas-window.c | 4 ++-- arch/powerpc/platforms/powernv/vas.h | 2 +- drivers/crypto/nx/nx-common-powernv.c | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/include/asm/vas.h b/arch/powerpc/include/asm/vas.h index 83afcb6c194b..c36f71e01c0f 100644 --- a/arch/powerpc/include/asm/vas.h +++ b/arch/powerpc/include/asm/vas.h @@ -126,7 +126,7 @@ static inline void vas_user_win_add_mm_context(struct vas_user_win_ref *ref) * Receive window attributes specified by the (in-kernel) owner of window. */ struct vas_rx_win_attr { - void *rx_fifo; + u64 rx_fifo; int rx_fifo_size; int wcreds_max; diff --git a/arch/powerpc/platforms/powernv/vas-fault.c b/arch/powerpc/platforms/powernv/vas-fault.c index a7aabc18039e..c1bfad56447d 100644 --- a/arch/powerpc/platforms/powernv/vas-fault.c +++ b/arch/powerpc/platforms/powernv/vas-fault.c @@ -216,7 +216,7 @@ int vas_setup_fault_window(struct vas_instance *vinst) vas_init_rx_win_attr(&attr, VAS_COP_TYPE_FAULT); attr.rx_fifo_size = vinst->fault_fifo_size; - attr.rx_fifo = vinst->fault_fifo; + attr.rx_fifo = __pa(vinst->fault_fifo); /* * Max creds is based on number of CRBs can fit in the FIFO. diff --git a/arch/powerpc/platforms/powernv/vas-window.c b/arch/powerpc/platforms/powernv/vas-window.c index 0f8d39fbf2b2..0072682531d8 100644 --- a/arch/powerpc/platforms/powernv/vas-window.c +++ b/arch/powerpc/platforms/powernv/vas-window.c @@ -404,7 +404,7 @@ static void init_winctx_regs(struct pnv_vas_window *window, * * See also: Design note in function header. */ - val = __pa(winctx->rx_fifo); + val = winctx->rx_fifo; val = SET_FIELD(VAS_PAGE_MIGRATION_SELECT, val, 0); write_hvwc_reg(window, VREG(LFIFO_BAR), val); @@ -739,7 +739,7 @@ static void init_winctx_for_rxwin(struct pnv_vas_window *rxwin, */ winctx->fifo_disable = true; winctx->intr_disable = true; - winctx->rx_fifo = NULL; + winctx->rx_fifo = 0; } winctx->lnotify_lpid = rxattr->lnotify_lpid; diff --git a/arch/powerpc/platforms/powernv/vas.h b/arch/powerpc/platforms/powernv/vas.h index 8bb08e395de0..08d9d3d5a22b 100644 --- a/arch/powerpc/platforms/powernv/vas.h +++ b/arch/powerpc/platforms/powernv/vas.h @@ -376,7 +376,7 @@ struct pnv_vas_window { * is a container for the register fields in the window context. */ struct vas_winctx { - void *rx_fifo; + u64 rx_fifo; int rx_fifo_size; int wcreds_max; int rsvd_txbuf_count; diff --git a/drivers/crypto/nx/nx-common-powernv.c b/drivers/crypto/nx/nx-common-powernv.c index 32a036ada5d0..f418817c0f43 100644 --- a/drivers/crypto/nx/nx-common-powernv.c +++ b/drivers/crypto/nx/nx-common-powernv.c @@ -827,7 +827,7 @@ static int __init vas_cfg_coproc_info(struct device_node *dn, int chip_id, goto err_out; vas_init_rx_win_attr(&rxattr, coproc->ct); - rxattr.rx_fifo = (void *)rx_fifo; + rxattr.rx_fifo = rx_fifo; rxattr.rx_fifo_size = fifo_size; rxattr.lnotify_lpid = lpid; rxattr.lnotify_pid = pid; -- 2.35.1