From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 211FC1A262D for ; Sun, 2 Aug 2026 13:21:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785676866; cv=none; b=oDpi/RL6iRVMrO/dLx+ExKcyWQp/BrvrNpfSqG1h7MWf0WV7EDMWmeIot/Kb2qfU0KCK2/aeqoStn5LoNBue3m/xhitc8JONTPqKfMIC/o7avX7qAcffGkTQMh/lOxJYuZXkVAZpEmZick3EbMTHlLQXdjvscFhJ8YK2s6qoNlQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785676866; c=relaxed/simple; bh=fsFKuJx4SCrNmot2SptRKRT8JXktPRgbGXelOGQnMLM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=lNdjWZ+h22y/1oGx0180jbJ1yLnv6ra+/3C3Zp0tfMEUlFLoCCLBtz6ZGwju9i9SaND9wNhRSCqQcvwPSb+ie08SnJT7Uf/HsNNZvX2oUiJWivgtTiPXxU5BwEUCQeOYvjFIhyJmencl0DAYr+uQ7vOOiYbcTbxpeMPZb5340hQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Jy2nIzsS; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Jy2nIzsS" Received: by smtp.kernel.org (Postfix) with ESMTPSA id ABAFB1F000E9; Sun, 2 Aug 2026 13:21:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1785676864; bh=+m0vTyFzwQPJPx2ZXIyCfjlYQCNE16KWSYzyQPI3+jc=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=Jy2nIzsSlxGC4aoF1KcBX/ogK0bxLCbxP42DM3eM1qvZjV1FCm+NqTMU346dfUtou xF0IDggyn6yWbRmO+GIMXHFSMn8eLeSOhBw5fksWG+Xz/+TQZHqLMqQqkLoFHjVbBe fYL14U76ASrNPVMYlsnS5zE02RuQlerKvBydvW8pjhS36qEvHbMKrB/Cg+iyXgXjGg pPuZBCi0Fy075M8zwl/GRzk97irH7sXEgq9jmbOmoyWiCExh451X7fwz31+hQNCZOf 7byXpGWd0OpWWBvbai1gPGgaAMIeWYA6Gisqr50rj7ktz38m6cCv2LFgy6fwcND0pM 5/H8k519Udbsg== Date: Sun, 2 Aug 2026 15:20:59 +0200 From: Ingo Molnar To: Thorsten Blum Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , linux-kernel@vger.kernel.org Subject: Re: [PATCH RESEND] x86/fpu: Use vmemdup_user() in xstateregs_set() Message-ID: References: <20260720195534.70111-3-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: * Thorsten Blum wrote: > > Replace the open-coded vmalloc() and copy_from_user() with > > vmemdup_user() to simplify xstateregs_set(). > > > > vmemdup_user() returns an ERR_PTR() on failure, preserving the existing > > -ENOMEM and -EFAULT error codes. Since vmemdup_user() is backed by > > kvmalloc(), use kvfree() to free the buffer instead. > > > > Return early on error and drop the obsolete out label. > I've resent this cleanup a few times and haven't received feedback. Is > this still something you would consider, or would you prefer that I drop > it? It's intended to be a mechanical cleanup with no functional changes. > > Happy to rerun the relevant x86 XSAVE selftests if it helps. So the changelog is silent on any potential side-effects of this change. vmalloc will return page-aligned addresses. kmalloc won't. Will this have any effects on performance? Are there other examples of vmalloc() -> kvmalloc() conversions in the tree, is it a recommended and well-tested technique to simplify the code? A very quick git log investigation does not seem to be showing any such recent conversion examples: starship:~/tip> git log -E --grep='kvmalloc' --since=one-year-ago | grep -w vmalloc I'm not opposed to it in principle, I just think the 'analysis' side of the patch description is basically non-existent. Thanks, Ingo