From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.124 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795979804; b=4AmsiaffN/1svg6XVDDQzA0TVMOK95ym0WgzBi/C0KrJtWTZvyVCix7v4tAOTtc6c218 B07bqTuDlTyqxHqpJK781T2cUch/XACzU1hDGFpJAbiyWlgiJxfWpXM9+AAJf/TcFYPFE 8L5XbPjkNJOkTuVPySTeTynFZ0BDQga5guox3Hm5InG/mn4gD9HgolSkUw82fMcIiB6qI qvLtgzTf/+dU9TYen+8icPshO1Z6NPqZZIi233h1NA7a12FeNaRm217PADUZ1+WOBMiLj D1fUn5YIq2j0L7UZbDS7WCscfy+3XfJ6wLOGG/AwXcPppqZcTe4ZoaV8ry5yaGlessw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795979804; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:Message-ID:Date:MIME-Version:User-Agent: Subject:To:Cc:References:From:In-Reply-To:Content-Type: Content-Transfer-Encoding; bh=Pwt36hLxhMeiR8O47nakJaHVZ7lZ/VWDytDRJ3XsPzQ=; b=5efoNvOCWxtK1AA78fKsorP1ntRo3gPZDzKy9qJ2jj96x6rGP1mPo26B9z/35MMpUHtw xFTzztMiL9ZI1if9EUEkr8ZeCoSCGmuJNh2GIkCCyaQaC+GcMCzj0CcnWXROfAOZPcQ5d 7SGyL/3Cg+CphAnbGgPGao1P5RAdl8KEntX+JzDodCYFJhlg36fddWtget8Kif8LwA4+z KgSTYNa1dtSnon7Xf/ja9VE8DaPxNoL3/fjZQK9lbvc84ski2/Q6PqqbAjOdhqTpkjYmk cH/E3cIX2y0ka4npbifhmmNqdVJr98UfSdkGcGxHG/0PK0L+CiRWJWK3zbA3fxYUyBg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=fnYV5M+a; arc=none smtp.remote-ip=91.218.175.124 Received: from mta0.migadu.com (out-124.mta0.migadu.com [91.218.175.124]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3A47A606A323 for ; Sun, 29 Nov 2026 19:16:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3A47A606A323 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=fnYV5M+a X-Envelope-To: linux-rdma@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=7l0Pd9OccAUSbfhRkPAV0S0BH4rCLeodKNXPH9wSoIE=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1795979801; v=1; x=1796584601; b=fnYV5M+aMG7WlvulnpSL0WckGbngqdyLToynFJYGAk85J2gkdz50hLo4okX8C4zcPogXItXQ 8WfEK201ozmPr38S8CA7kp5Ls4ajEM01iQWkOHyTT/aKNKaRinYXMwjyV9EpNBOrB6L+g1ipRwM LSNeLRaOAbQLi3qI7TofM4+o= X-Envelope-To: linux-rdma@vger.kernel.org Received: by smtp.migadu.com with ESMTPS id b2e1164fdd96b6c4; Sun, 29 Nov 2026 19:16:41 +0000 X-Mizu-Trace-ID: b2e1164fdd96b6c4 X-Migadu-Flow: FLOW_OUT Message-ID: <87a40abe-30e3-414c-ac13-ed166c91239d@linux.dev> Date: Sun, 29 Nov 2026 11:16:37 -0800 X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH rdma-rc] RDMA/rxe: Bound MR copy and flush chunks to MR pages To: Andrew Stellman , Zhu Yanjun , "yanjun.zhu@linux.dev" Cc: Li Zhijian , Jason Gunthorpe , Leon Romanovsky , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org References: <20261128140840.59003-1-bugs@stellman-greene.com> <20261129001904.79077-1-bugs@stellman-greene.com> <77aba02e-64a7-4987-80f8-46c5301ac106@linux.dev> <20261129135306.80838-1-bugs@stellman-greene.com> From: Zhu Yanjun In-Reply-To: <20261129135306.80838-1-bugs@stellman-greene.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 在 2026/11/29 5:53, Andrew Stellman 写道: > On Sat, Nov 28, 2026 at 04:36:17PM -0800, Zhu Yanjun wrote: >> Do you make tests in your local host? Or just use AI to make static >> analysis? > My last reply was from reading the source. After your question I ran > a check in an arm64 QEMU guest on mainline 4f069ab1ec24 plus a > test-only patch (logging and a root-only hook), with 64 KiB pages, > KASAN and rxe: > > - Five user MRs registered with ibv_reg_mr, including buffers that > were 4 KiB aligned but not 64 KiB aligned. A pr_info at the top > of rxe_mr_fill_pages_from_sgt() logged mr_page_size=65536 and > PAGE_SIZE=65536 for all five, and the WARN_ON didn't fire. > > - A root-only test hook called rxe_mr_init_fast() and then > rxe_map_mr_sg() directly, with the MR page size set to 4 KiB. > rxe_mr_fill_pages_from_sgt() wasn't called. > > The v1 patch was tested on mainline 7cd8495c0f16 in an arm64 QEMU > guest with 64 KiB pages and KASAN, using a root-only test hook that > calls rxe_mr_copy() directly. A read and a write across a 4 KiB > MR-page boundary failed without the patch, passed with it, and failed > again with it reverted. The flush path was built but not run. Below is the implementation of mr_page_size: static inline unsigned int mr_page_size(struct rxe_mr *mr) {     return mr ? mr->ibmr.page_size : PAGE_SIZE; } In the function below, mr->ibmr.page_size is initialized: void rxe_mr_init(int access, struct rxe_mr *mr) {     u32 key = mr->elem.index << 8 | rxe_get_next_key(-1);     /* set ibmr->l/rkey and also copy into private l/rkey      * - for user MRs these will always be the same      * - for cases where caller 'owns' the key portion      * - they may be different until REG_MR WQE is executed.      */     mr->lkey = mr->ibmr.lkey = key;     mr->rkey = mr->ibmr.rkey = key;     mr->access = access;     mr->ibmr.page_size = PAGE_SIZE;     mr->page_mask = PAGE_MASK;     mr->page_shift = PAGE_SHIFT;     mr->state = RXE_MR_STATE_INVALID; } Can you find anywhere else where mr->ibmr.page_size is assigned a different value? Thanks a lot. Yanjun Zhu > > I can send the test-only probe patch and the user program (user-mr.c) > if they'd help. -- Best Regards, Yanjun.Zhu