From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.160 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796090862; b=YcFsE1tLmXF7Kf7N+7zILtJvEmnpgLUij8IHTWyXiWI1wL63KKL3oKgotuJWuaRfyikd vPGLj1QIF5txYgpwxSHidPr1eCnDbvU0/eqJFbgor1bLfNDiROEYHOj+e8TYRLce/sXIj sGqvrqSy65TI9SYVHrrgKRKPJBSx/fpsNSNTz0EdyaqDpKa0HhDp3Gl2Va8RCg3/6NWnj P9IrO3/2OqiGioHHbvYOfFhB9pOl4ZBWO/h4bnoXXZ5t87mu6pVzEp0G8tWMjyAuENJv+ bkfQfWNT5t4gF70MetncKr82WEMehQ3wt7XJra6/8XnM1oILbxGPYrhZeaFlLfBG5vg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796090862; 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:Content-Language:From:In-Reply-To: Content-Type:Content-Transfer-Encoding; bh=6Ud7tipF1bW6EUTwpYqTm0774kIA0+XGgHsmwXezI2U=; b=d2k5OGcgpB7Flsf2D+dlMLoMU8JdULJGgHFXmfngynTgGmq+3dVJhdyMjgoh4iZyjWr2 NINJohGUtHFa9JqALJYOC5VVJZlWW+DRtvQO16OIx69nf3mpzIpFioOTDblJGhhOg8ld8 TTjPKtSC3oOYKAJiNo7qpLzQP3A/4RLq3GvlTO9P7SfgpWJA7FeDlTFd5lmEQ1lBM0so1 ZfpedxetF7aGWTzhxX7pZuipubRQhR4VCtJ5E1uKRhMltpHRZCATY64J7lDzXuDA3yDyW G37k7SqHGCNlCuUZdDXstPzeHF0KLCBWP/IBaldFTfGsPtcLwL2tyOXPwlo4oonlJNA== 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=xoU6MxLp; arc=none smtp.remote-ip=95.215.58.160 Received: from mta1.migadu.com (out-160.mta1.migadu.com [95.215.58.160]) (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 AC4AA606A31A for ; Tue, 1 Dec 2026 02:07:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org AC4AA606A31A 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=xoU6MxLp X-Envelope-To: linux-kernel@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=6Nc3rrWvi6iit6WbC3StOcsN41tw0MtrqHc0fa9MC0U=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1796090859; v=1; x=1796695659; b=xoU6MxLp8TT0KOcrhx6mEdYx+/vDDE4moQw1RolqjvxKleiTv2fxPq9/G5V/sE2P0suTVzdW vhI0uWevatHoteH2QvPpXd9L7Q3Ev6vqLMaxoUU0mkRhAdIZhRBQkXvD0a1afPj1L1+3lh1keKc 0sarLO48Hog08Gn1etAILVbg= X-Envelope-To: linux-kernel@vger.kernel.org Received: by smtp.migadu.com with ESMTPS id 4e15bc0457909a03; Tue, 01 Dec 2026 02:07:39 +0000 X-Mizu-Trace-ID: 4e15bc0457909a03 X-Migadu-Flow: FLOW_OUT Message-ID: <13fc687a-5573-4359-8410-1127112787f3@linux.dev> Date: Tue, 1 Dec 2026 10:07:04 +0800 X-Mailing-List: linux-kernel@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 v2 1/2] mm/vmalloc: drop VM_DMA_COHERENT from remap_vmalloc_range_partial To: Uladzislau Rezki Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Ye Liu References: <20261029-vmalloc_remap-v2-0-c4705cbf26c2@linux.dev> <20261029-vmalloc_remap-v2-1-c4705cbf26c2@linux.dev> Content-Language: en-US From: Ye Liu In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在 2026/11/22 23:39, Uladzislau Rezki 写道: > On Thu, Oct 29, 2026 at 05:19:07PM +0800, Ye Liu wrote: >> From: Ye Liu >> >> No caller maps a VM_DMA_COHERENT area through this path: such areas >> come from dma_alloc_coherent() internals and are freed via vunmap(), >> never through remap_vmalloc_range[_partial](); all 13 callers pass >> vmalloc_user()/vmalloc()-backed addresses. >> >> The flag was added in commit fe9041c245196 ("vmalloc: lift the arm >> flag for coherent mappings to common code") as a mechanical >> translation of ARM's VM_ARM_DMA_CONSISTENT. >> >> Drop it so DMA-coherent areas can never enter the path. >> >> Signed-off-by: Ye Liu >> --- >> mm/vmalloc.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/mm/vmalloc.c b/mm/vmalloc.c >> index db669103dc66..a888eca016a8 100644 >> --- a/mm/vmalloc.c >> +++ b/mm/vmalloc.c >> @@ -4894,7 +4894,7 @@ int remap_vmalloc_range_partial(struct vm_area_struct *vma, unsigned long uaddr, >> if (!area) >> return -EINVAL; >> >> - if (!(area->flags & (VM_USERMAP | VM_DMA_COHERENT))) >> + if (!(area->flags & VM_USERMAP)) >> return -EINVAL; >> >> if (check_add_overflow(size, off, &end_index) || >> >> -- >> 2.43.0 >> > I think we should really clarify why а remap_vmalloc_range_partial() should > no longer accept VM_DMA_COHERENT mappings, because this change explicitly > disallows a previously supported behavior. > > Could you please clarify why we should disallow this now? > Hi Uladzislau, Thanks for the review. Sorry for not making this explicit enough. The key point is that "previously accepted by the check" is not the same as "previously supported behavior". No in-tree caller passes a VM_DMA_COHERENT area to remap_vmalloc_range[_partial](); all 13 callers use vmalloc_user()/vmalloc() areas with VM_USERMAP. VM_DMA_COHERENT areas come from dma_alloc_coherent() internals and are freed via vunmap()/dma_free_coherent(), so they should not enter this remapping path at all. The flag was introduced by fe9041c245196 as a mechanical translation of ARM's VM_ARM_DMA_CONSISTENT, not as an API requirement. So this change removes an unused/accidental allowance rather than a supported behavior. I can reword the changelog to make that clearer if you think it would help. > Thank you! > > -- > Uladzislau Rezki -- Thanks, Ye Liu