]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
powerpc/powernv/vas: Assign real address to rx_fifo in vas_rx_win_attr
authorHaren Myneni <haren@linux.ibm.com>
Sat, 9 Apr 2022 08:44:16 +0000 (01:44 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jun 2022 08:20:58 +0000 (10:20 +0200)
[ 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
arch/powerpc/platforms/powernv/vas-fault.c
arch/powerpc/platforms/powernv/vas-window.c
arch/powerpc/platforms/powernv/vas.h
drivers/crypto/nx/nx-common-powernv.c

index e33f80b0ea81952525a68d5cc8587517210730b3..47062b457049048f3615c0369bc3660e18ad8e72 100644 (file)
@@ -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;
 
index 3d21fce254b741c3b7bb52edcea631108d42aa9c..dd9c23c097816a0b7318ca545906fa16abfca17d 100644 (file)
@@ -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.
index 7ba0840fc3b557bcabafda5be5da814a3a7f37f7..3a86cdd5ae6c30a78e7295344f87e807ae35b971 100644 (file)
@@ -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;
index 70f793e8f6cc6756618903e080eb76c15b5e2f50..1f6e73809205e7bc06d2ab9650b266280d6f99b2 100644 (file)
@@ -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;
index 13c65deda8e979f75ce4231240bf5549996000f1..8a4f10bb3fcddbda2a03058c0e94e6723e97ef18 100644 (file)
@@ -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;