From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Haren Myneni <haren@linux.ibm.com>,
Michael Ellerman <mpe@ellerman.id.au>,
Sasha Levin <sashal@kernel.org>,
davem@davemloft.net, npiggin@gmail.com,
linuxppc-dev@lists.ozlabs.org, linux-crypto@vger.kernel.org
Subject: [PATCH AUTOSEL 5.10 20/26] powerpc/powernv/vas: Assign real address to rx_fifo in vas_rx_win_attr
Date: Wed, 1 Jun 2022 09:57:53 -0400 [thread overview]
Message-ID: <20220601135759.2004435-20-sashal@kernel.org> (raw)
In-Reply-To: <20220601135759.2004435-1-sashal@kernel.org>
From: Haren Myneni <haren@linux.ibm.com>
[ 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 <mpe@ellerman.id.au>
Signed-off-by: Haren Myneni <haren@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/338e958c7ab8f3b266fa794a1f80f99b9671829e.camel@linux.ibm.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
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 e33f80b0ea81..47062b457049 100644
--- a/arch/powerpc/include/asm/vas.h
+++ b/arch/powerpc/include/asm/vas.h
@@ -52,7 +52,7 @@ enum vas_cop_type {
* 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 3d21fce254b7..dd9c23c09781 100644
--- a/arch/powerpc/platforms/powernv/vas-fault.c
+++ b/arch/powerpc/platforms/powernv/vas-fault.c
@@ -352,7 +352,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 7ba0840fc3b5..3a86cdd5ae6c 100644
--- a/arch/powerpc/platforms/powernv/vas-window.c
+++ b/arch/powerpc/platforms/powernv/vas-window.c
@@ -403,7 +403,7 @@ static void init_winctx_regs(struct 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);
@@ -737,7 +737,7 @@ static void init_winctx_for_rxwin(struct 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 70f793e8f6cc..1f6e73809205 100644
--- a/arch/powerpc/platforms/powernv/vas.h
+++ b/arch/powerpc/platforms/powernv/vas.h
@@ -383,7 +383,7 @@ struct 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 13c65deda8e9..8a4f10bb3fcd 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
next prev parent reply other threads:[~2022-06-01 14:06 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-01 13:57 [PATCH AUTOSEL 5.10 01/26] IB/rdmavt: add missing locks in rvt_ruc_loopback Sasha Levin
2022-06-01 13:57 ` [PATCH AUTOSEL 5.10 02/26] ARM: dts: ox820: align interrupt controller node name with dtschema Sasha Levin
2022-06-01 13:57 ` [PATCH AUTOSEL 5.10 03/26] ARM: dts: s5pv210: align DMA channels " Sasha Levin
2022-06-01 13:57 ` [PATCH AUTOSEL 5.10 04/26] arm64: dts: qcom: msm8994: Fix BLSP[12]_DMA channels count Sasha Levin
2022-06-01 13:57 ` [PATCH AUTOSEL 5.10 05/26] PM / devfreq: rk3399_dmc: Disable edev on remove() Sasha Levin
2022-06-01 13:57 ` [PATCH AUTOSEL 5.10 06/26] crypto: ccree - use fine grained DMA mapping dir Sasha Levin
2022-06-01 13:57 ` [PATCH AUTOSEL 5.10 07/26] soc: ti: ti_sci_pm_domains: Check for null return of devm_kcalloc Sasha Levin
2022-06-01 13:57 ` [PATCH AUTOSEL 5.10 08/26] fs: jfs: fix possible NULL pointer dereference in dbFree() Sasha Levin
2022-06-01 13:57 ` [PATCH AUTOSEL 5.10 09/26] arm64: Expand ESR_ELx_WFx_ISS_TI to match its ARMv8.7 definition Sasha Levin
2022-06-01 13:57 ` [PATCH AUTOSEL 5.10 10/26] ARM: OMAP1: clock: Fix UART rate reporting algorithm Sasha Levin
2022-06-01 13:57 ` [PATCH AUTOSEL 5.10 11/26] selftests/resctrl: Change the default limited time to 120 seconds Sasha Levin
2022-06-01 13:57 ` [PATCH AUTOSEL 5.10 12/26] powerpc/fadump: Fix fadump to work with a different endian capture kernel Sasha Levin
2022-06-01 13:57 ` [PATCH AUTOSEL 5.10 13/26] fat: add ratelimit to fat*_ent_bread() Sasha Levin
2022-06-01 13:57 ` [PATCH AUTOSEL 5.10 14/26] pinctrl: renesas: rzn1: Fix possible null-ptr-deref in sh_pfc_map_resources() Sasha Levin
2022-06-01 13:57 ` [PATCH AUTOSEL 5.10 15/26] ARM: versatile: Add missing of_node_put in dcscb_init Sasha Levin
2022-06-01 13:57 ` [PATCH AUTOSEL 5.10 16/26] ARM: dts: exynos: add atmel,24c128 fallback to Samsung EEPROM Sasha Levin
2022-06-01 13:57 ` [PATCH AUTOSEL 5.10 17/26] ARM: hisi: Add missing of_node_put after of_find_compatible_node Sasha Levin
2022-06-01 13:57 ` [PATCH AUTOSEL 5.10 18/26] PCI: Avoid pci_dev_lock() AB/BA deadlock with sriov_numvfs_store() Sasha Levin
2022-06-01 13:57 ` [PATCH AUTOSEL 5.10 19/26] tracing: incorrect isolate_mote_t cast in mm_vmscan_lru_isolate Sasha Levin
2022-06-01 13:57 ` Sasha Levin [this message]
2022-06-01 13:57 ` [PATCH AUTOSEL 5.10 21/26] powerpc/xics: fix refcount leak in icp_opal_init() Sasha Levin
2022-06-01 13:57 ` [PATCH AUTOSEL 5.10 22/26] powerpc/powernv: fix missing of_node_put in uv_init() Sasha Levin
2022-06-01 13:57 ` [PATCH AUTOSEL 5.10 23/26] macintosh/via-pmu: Fix build failure when CONFIG_INPUT is disabled Sasha Levin
2022-06-01 13:57 ` [PATCH AUTOSEL 5.10 24/26] powerpc/iommu: Add missing of_node_put in iommu_init_early_dart Sasha Levin
2022-06-01 13:57 ` [PATCH AUTOSEL 5.10 25/26] RDMA/hfi1: Prevent panic when SDMA is disabled Sasha Levin
2022-06-01 13:57 ` [PATCH AUTOSEL 5.10 26/26] drm: fix EDID struct for old ARM OABI format Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220601135759.2004435-20-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=davem@davemloft.net \
--cc=haren@linux.ibm.com \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox