From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) (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 190F63F86EE for ; Wed, 23 Sep 2026 17:30:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.70 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790184603; cv=none; b=Y5kZNECorNuR+1tudrYaGIWnHxw2xZwrPUwFlvN1/ALBr8UmUdfWwTSNVGDjxJuWI0Virg/r/ccPjS0G8rJT+Kf0/5+4LHWDKlTT3P89LQBZEGmeEMT9ItT2eBWdUfMs1UftCtMdZEYnjpoKAnBdc1RmVYZyQF++UfT/XaHKboQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790184603; c=relaxed/simple; bh=Xb+U6YJSUeoOboOu794hniiPkJcsrI7/3PRgA18qQs4=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=S+2YYsyoqTU4G9I+xr1goK459MfbgnHZDXMMqwTTzFbOSoXEzSMHNNuNOgCxRKYfzaCcgCTykNfBkBlLOs3nL0tXZevyGINSijS1an04FDy4A6aKoeIt8JvWne4U9W7Hk4FaritJjqhLryJgI6uDicPwVpvjobeiMMsagfnjDms= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=EIXIe88j; arc=none smtp.client-ip=209.85.216.70 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="EIXIe88j" Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-39de4e72b33so1856431a91.2 for ; Wed, 23 Sep 2026 10:29:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1790184598; x=1790789398; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=lEgwGyblZ3NAaQJFmRUZMB/ng9M+MOX69eMi4kIb+DU=; b=EIXIe88jIsLgAZhjerE3Yy+cw2VllddHf/OXckJ3ncc5nwM6ZkSOQ9o72EtuNMIQtr FNDANsKM+iAaCAQai8JaRTYl6zNjKYGZK1e7kSJJVKpvN19V541DKcnQvYYsXG00TV+j rR0qeFcwVtj7e/64hJmYXdAmbXowoNmc01+XVvQULMyIB0LBQCjjGT6f4hLe02JgDqVK blRT4V5KWek6tlfxVQIwl88JXAiW6Dy49CMLucM/zg1O/VIIGuGy50KzxoGIvQ7tnNvr ddihixzKJKUPYiLqZBHZz3c5ipEWsLbZjXN8dIWZCG24R05D+hsF4EIi61LxXIB6VeFW wiNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790184598; x=1790789398; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=lEgwGyblZ3NAaQJFmRUZMB/ng9M+MOX69eMi4kIb+DU=; b=UuKhJEmxVzjty9ocM97yCCJNsv4PpGNWdRErg99MHItB3itnv4ICl+Ntr/o3xWNmQQ EC+xwuQVSlOzxMRmDO3fpYqV3Xkc9Xv4gSrUmpUhQGpjk1X5rvHg/8AOoPZid2SgaoUx +SWaLM3zKLHyviPT6R4Gx6XId6DILUCora7hB04x/B6Jt4j3ceX8WnjbN+4g9GvEr1/L 3Wmb+NqEcLRwdotuEKuneKnhiM+23c+FP8xHGZP/H3NJyjO1wVNjcPurLHDHQTo73tPh NxtCRIGjmAYQPjcJBEQ6ajIVFio+wUzX3AcBcBsyFJDktckiNMHQdsPSeRxP30W6sPve +OKA== X-Forwarded-Encrypted: i=1; AKwUvBzCBsHpMkVJRVOB7hoTOcR3S4mNl160HgIzQB+RwhUfnPdgOow7w4bpsNkEzwySMsLh8DsLS5+rwsDfMkE=@vger.kernel.org X-Gm-Message-State: AFuF++kxqdsYHr3ac3DSR2DKrIzP9hJ7WechjRjHDuMIPNJrt9AKL1oI PDzAH+3b1FPD0AP5x1fqcaa727yhS5XMoSmSuZ2n7SLNqVVYptYUh4jwNf0/wYseZmiuXi+Kc6v LOrP3+A== X-Received: from pjbmr22.prod.google.com ([2002:a17:90b:2396:b0:3a0:3f81:b5c1]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90a:dfcb:b0:39e:b15:7950 with SMTP id 98e67ed59e1d1-3a07e4f7befmr2966146a91.23.1790184597504; Wed, 23 Sep 2026 10:29:57 -0700 (PDT) Date: Wed, 23 Sep 2026 10:29:56 -0700 In-Reply-To: <20260923-kvm-arm-prefault-v4-1-d4b0b4dfa8c3@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260923-kvm-arm-prefault-v4-0-d4b0b4dfa8c3@kernel.org> <20260923-kvm-arm-prefault-v4-1-d4b0b4dfa8c3@kernel.org> Message-ID: Subject: Re: [PATCH v4 01/14] KVM: Allow architectures to disallow pre-fault From: Sean Christopherson To: "Lorenzo Stoakes (ARM)" Cc: Catalin Marinas , Will Deacon , Marc Zyngier , Oliver Upton , Joey Gouly , Steffen Eiden , Suzuki K Poulose , Zenghui Yu , Paolo Bonzini , Jonathan Corbet , Mark Rutland , Fuad Tabba , Randy Dunlap , Christian Borntraeger , Janosch Frank , David Hildenbrand , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Sven Schnelle , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Shuah Khan , Shuah Khan , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kvmarm@lists.linux.dev, kvm@vger.kernel.org, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, Jack Thomson , Jack Thomson , Alexandru Elisei , Vincent Donnefort , "Aneesh Kumar K.V" , Claudio Imbrenda , Leo Soares Passos , Wei-Lin Chang , linux-s390@vger.kernel.org Content-Type: text/plain; charset="us-ascii" On Wed, Sep 23, 2026, Lorenzo Stoakes (ARM) wrote: > All existing architectures which implement KVM pre-fault (x86, s390) have > mechanisms for disallowing pre-faulting. > > Currently these are open coded as part of kvm_arch_vcpu_pre_fault_memory(). > > Formalise this by moving them into a new kvm_arch_pre_fault_allowed() hook, > which every architecture selecting CONFIG_KVM_GENERIC_PRE_FAULT_MEMORY must > implement, returning an error code if the operation is disallowed or 0 > otherwise. > > The hook is called early in the generic code, allowing architectures to > disallow the operation prior to vCPU load. > > This is important, as kvm_vcpu_pre_fault_memory() is the only place where > generic code can call vcpu_load() on a vCPU that has not yet been > initialised. > > This lays the foundation for a future change which implements pre-faulting > for arm64 which needs to disallow the mechanism for uninitialised vCPUs. > > Suggested-by: Oliver Upton > Signed-off-by: Lorenzo Stoakes (ARM) > --- Acked-by: Sean Christopherson