From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A609F26FA5E for ; Fri, 14 Nov 2025 19:09:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763147342; cv=none; b=jLvBFtDPD1leM/7/1swlhxu9m+mCOGw4/g8M8cSqI8/4LLpu3tTY4TIwJw1lucHkXXlC+vLcUsPaSx5NtZZZlTIAmyan7MmTOW6AxZbXDKZojxka0a8D3yx0lwSKkR+cnLIVqT5ODdpDRCNhFHAz3YPujxJKlZzf+Z98cp/Td6I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763147342; c=relaxed/simple; bh=Nfxgm75Jhb2I/JUAINHfI4c962h33wDu9+inj+NnIc4=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=RjQ3hGWThPNYq+KzRmiwMlcG9U8ke41vdMcAq3U1V4sAmYb51fma4mUYLV1pL0KAT7N8wl7uJddS8pvscXXcgzEcnUSQANlt/cksJIS64lOrp6bh1JCbI4B0XnBpbrrclTTM93dbE4aTMl9NbnydiE6QeFIla5CnKarwD9f7YjI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=fHb6/0T/; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fHb6/0T/" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-47755de027eso17699845e9.0 for ; Fri, 14 Nov 2025 11:09:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763147339; x=1763752139; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=/kduuOxJm1uiHOQpqpaE+0Irtr18Sdz3O5vUWzH6wpM=; b=fHb6/0T/UAhSE5wcCP+7RD3ngi1eXkslSyTAzfQmGdaDtPyU/dplUDuPHUd6KUMGbv P7OYQEyhTBHQUUq7kgWw4FPAEouV9zk3pYeYAkVPHwh3q8bcWksNDIVryB9xYGnwdmBe DDKSHYLg6PGGmjU/pfdHqghmToD6Y4CgYiQt3+5heP1xLizekn/nmlOxHldxzzf26YpP rLQNVVL3e/rlrWz3hts3cHVaZklPzHFEFBMfaA/T6iU7/MAuUjNGckD+M3/5SGQ7/7OK t1xhupHqpEECojOsf/9I/pGjr8F5+EhP5xhXRRR01ZWKzM1wubutAay9DJ+Y8JXr4c6Q FeYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763147339; x=1763752139; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=/kduuOxJm1uiHOQpqpaE+0Irtr18Sdz3O5vUWzH6wpM=; b=EiTvYohfDt3fq5QdXRv9sd02Onu/HCojgWs+7rCfBL9WZwYqj8Xb//1rXnjfCG1qRN vd2S/FWnlHmkOYRBY5DBbv2me/mubwvHMl90oUBx8Ih0wyTNIiZlY7kxzhvAsA7G59LP uXJcA4DGuoQKpAzp21czRM0SyjcxLrtmwZ3vHielppDf9ldTF6tYoZg4VeVSgqlGWE0c I5T9pNFVyXGiEZmKiMJihqGxOHPlhZNqJydkRGpfsEFXI2iUufS42HmQk3qx+GuHhdQS +TqwU/mqdVWymo8qJKgvOgIYsX9nubNJvhiuV0Uajd/dYeDJ3ZDaevVe5IQBIecaRKOP TE6g== X-Forwarded-Encrypted: i=1; AJvYcCXbXC5edVwPpi/IqIU6GSdMDCAmUtaZZdd6+bathNkpgezhpOQA3xSkXXa/e0Ry2+nHamdM0a9TNWUo++E=@vger.kernel.org X-Gm-Message-State: AOJu0YyDgSDs1Sx17TYIVrI4EqohX58zrpE5QS0xhOl4UsbZwqx6iCGv uW1wa5pKC2fFpgbiS5wvmxTNnIA59Ee3tV68iQfAmBpVTMImtpU8DWvb X-Gm-Gg: ASbGncvQvL2vCFznXLJexM5+PQOXZnPi5XWCbuLw5PRG2crJULaJ8JH2czARmRkIEVL gWNEv2kiVC9ngng2ewEO+OPnGs0oBH86YcUmE8r1W3u99gLqTxUhCdzWOWMTjjZ1l+T0zFHg8xT k9qT2Uwklq64YHcIhE1pjP/dCMxC2CgJr7Jlp4r9dm/HPGwQzWpFKecQv9Ed9YP4FySnV7cJ+mn yRqnRkN8f8N9zljX2tkMQjRCRXFGeFVnv0PQCor+WUik9ENL8UFD7rhasREmL/Xgfk2m3maMSAy 5EAEwnG4gYKLhXLyo7jytpsifkybREta9ChT+KTft/9m/o41nbhFFwvgL85xMawkyOqxR3xQdTr lQ2m2cTZ+iOaZ5zRV9SRnrvw2rLh+7h73U6sYpcwOy81O3pyve7PFJFfwScrwBXPPC+5HwJtf+h Y/wDl7YZqyP2XvpJ62aZ5THSDP6XlMA3wk9t+KztfrC8U4D8iHLTTJ1IhNY9VeA8I= X-Google-Smtp-Source: AGHT+IFWHe5vo4aCmUnfRTE8bLs+NNaWOHslfnze7qRX+02RlEOWeu0jyoeKkQbA3EZNRkKxFnbT8Q== X-Received: by 2002:a05:600c:1f87:b0:471:1435:b0ea with SMTP id 5b1f17b1804b1-4778fe795b0mr39564935e9.24.1763147338776; Fri, 14 Nov 2025 11:08:58 -0800 (PST) Received: from pumpkin (82-69-66-36.dsl.in-addr.zen.co.uk. [82.69.66.36]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-477952823d3sm23335595e9.11.2025.11.14.11.08.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Nov 2025 11:08:58 -0800 (PST) Date: Fri, 14 Nov 2025 19:08:56 +0000 From: David Laight To: Linus Torvalds Cc: Jon Kohler , Jason Wang , "Michael S. Tsirkin" , Eugenio =?UTF-8?B?UMOpcmV6?= , "kvm@vger.kernel.org" , "virtualization@lists.linux.dev" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Borislav Petkov , Sean Christopherson Subject: Re: [PATCH net-next] vhost: use "checked" versions of get_user() and put_user() Message-ID: <20251114190856.7e438d9d@pumpkin> In-Reply-To: References: <20251113005529.2494066-1-jon@nutanix.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; arm-unknown-linux-gnueabihf) 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-Transfer-Encoding: 7bit On Fri, 14 Nov 2025 09:48:02 -0800 Linus Torvalds wrote: ... > But then get_user() gets optimized to do the address space check using > a data dependency instead of the "access_ok()" control dependency, and > so get_user() doesn't need LFENCE at all, and now get_user() is > *faster* than __get_user(). I think that is currently only x86-64? There are patches in the pipeline for ppc. I don't think I've seen anything for arm32 or arm64. arm64 has the issue that the hardware looks at the wrong address bit, so might need an explicit guard page at the end of user addresses. Changing x86-32 to have a guard page ought to be straightforward. But I think the user stack ends right at 0xc000000 (with argv[] and env[]) so it might be safer to also reduce the stack size by 4k (pretending env[] is larger) to avoid problems with code that is trying to map things at fixed addresses just below the stack (or do we care about that?). I'm sure I should be able to build and test the x86-32 code. I guess there are instruction for doing that under qemu somewhere? Might be time to drop support for cpu that don't support cmov? David