From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f74.google.com (mail-wr1-f74.google.com [209.85.221.74]) (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 66CB84C6C for ; Fri, 24 Apr 2026 08:49:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.74 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777020554; cv=none; b=qIDejbyZfy/x579hajMj2Mg0Yv3cMW/E52xh21wnf9tqJs8lo5K89znOFlOnfO1PNvlxDwf+GtU/Gyzvbb5W0cyi+7fgWt4ZgQLqu1lPl7QmImJJ+biqwn8nTqzfiC3FRAiADhPEqD3D/ABhwPVC0lxIHYbEkKJvlOumo450QJE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777020554; c=relaxed/simple; bh=mRLjagBdARb/RSTyBslw+tT7PGeiGRSx+fVrQ7vBgkY=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=XEk4IATgTk+Mh+sPRA15pHm46qijKEcul75v7QK2+V31wfQ+o1W4qId9wl7q8pvWbK8SeO1xiEaXAXD1FdyYUd9IWc4fNTWiRSpLacDo0RRJGu3OTrpXKC7gYWx+Hp7yPNEz4r37XfsD9ZVzT0fGbClvfFFuXcU1+bQgAYSRP0k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--tabba.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=NK0m7EFU; arc=none smtp.client-ip=209.85.221.74 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--tabba.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="NK0m7EFU" Received: by mail-wr1-f74.google.com with SMTP id ffacd0b85a97d-4411a2ff53aso2947631f8f.0 for ; Fri, 24 Apr 2026 01:49:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1777020550; x=1777625350; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=aH/14ddBCo2kTCzx4ceCZMALAM1Tsur26jX4fxnDfAE=; b=NK0m7EFUgI/F8lxfBL9TR7yUyixOgRfqo0mqXQ3dvrvYdu0eG6mUUtKdapgwnfiwLF LsWbMwqm7gHbVN6VZbhIR5xefPM8kJw6sky82GRn4XeHMJNLe0uQW1LVSqQrAww8GlzK l7om1J7wm4FXaMwotZyxT4pJFQaJubReSIof8EtZ1iYyDNpFCdXFlETOcCXfBnFxf/Pj JEn+XZqSHNiuOmn9YN/tTaN3HCkpBWoh7Y5MUeiKEs+O+vV5FWQJcgaR6PaXiBK1E2a5 AKv5/mNQhPSzgtT6Ww/Gk7NSuzB1U72gurxNzRBuJ296/3rdwZLRHyfrcT6xu9naOcxb mHpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777020550; x=1777625350; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=aH/14ddBCo2kTCzx4ceCZMALAM1Tsur26jX4fxnDfAE=; b=KAgZtyIw2ClT9PF5igQSRwfrZ/VUFlbjG9Wc7zuF6roPWlybuVWOfBA1nd9wAVmQU0 YtqpGBNt9SpnZAoy62OyhrpPwC4t20lG63bBCqhNRme4MgRxF3EXqiFuiNH71WR4N7nR 3/QgaTHXE01VdQoFSJmEW0bOvtvRYyB3qvlhpA1jEiKVZf3fbR6hEa9F4BspdU6i/iLb BZtv9QIzEadw8tNtx6gKI374c3Kc7gMcWzR/5rjU/zv7y3J9xO6XJd7DGxOvOW07ShAO S1cBztc6U+oyfWxWRQ4px3dfAia3gi4EqA6uG6GE0JQVk0up7NYKcGuuJC+gdxyeVAie O+Rg== X-Forwarded-Encrypted: i=1; AFNElJ+FcIABush6r6MuRgQ5Qmz0vv7NZjjMcjGNzwSGfbrAf7QzPeXdgy3b/KLp8I4rDPfsXJZJrLlWNzKpM1k=@vger.kernel.org X-Gm-Message-State: AOJu0YzsHpYhyDuP9BF9jcC6aFiWCdwHgBwXnMGjB5NOJ3ORv4tnzDXm HCUQp/hgr95Ykob15SZUkauirCmV1zAYCbTfJ9hXJUahRcutJZxpIMFUffHmDCLpTagfIyEh330 myw== X-Received: from wrtj10.prod.google.com ([2002:a5d:604a:0:b0:43d:77d4:5f06]) (user=tabba job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:4fc6:b0:48a:53ea:1408 with SMTP id 5b1f17b1804b1-48a53ea15a4mr231487385e9.8.1777020549668; Fri, 24 Apr 2026 01:49:09 -0700 (PDT) Date: Fri, 24 Apr 2026 09:49:02 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.54.0.rc2.544.gc7ae2d5bb8-goog Message-ID: <20260424084908.370776-1-tabba@google.com> Subject: [PATCH 0/6] KVM: arm64: pKVM init and feature detection fixes From: Fuad Tabba To: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: tabba@google.com, catalin.marinas@arm.com, will@kernel.org, maz@kernel.org, oupton@kernel.org, qperret@google.com, suzuki.poulose@arm.com, joey.gouly@arm.com, yuzenghui@huawei.com Content-Type: text/plain; charset="UTF-8" Hi folks, These six patches are standalone correctness fixes I'd like to land before posting a follow-up to Will's pKVM infrastructure series [1] that moves vCPU state management to EL2. Sending them separately keeps the bigger series focused, but they are all valid fixes to have regardless. The first patch fixes feature detection for FEAT_Debugv8p9: it was checking the wrong field in ID_AA64DFR0_EL1, causing KVM to treat certain EL2 control bits as RES0 on hardware that implements the feature. The second patch is a trivial typo fix in comments. The third patch fixes feature detection for FEAT_SPE_FnE, which was also checking the wrong field. The last three fix bugs in the pKVM vCPU and hypervisor initialisation paths: a latent macro parameter bug, a pin-reference leak with a publication ordering issue in __pkvm_init_vcpu(), and a call-ordering hazard in __pkvm_init_finalise() that is benign today but becomes a crash once fix_host_ownership() is extended to operate on a non-empty page-table. [1] https://lore.kernel.org/all/20260105154939.11041-1-will@kernel.org/ Cheers, /fuad Fuad Tabba (5): KVM: arm64: Fix FEAT_Debugv8p9 to check DebugVer, not PMUVer KVM: arm64: Fix typo in feature check comments KVM: arm64: Fix FEAT_SPE_FnE to use PMSIDR_EL1.FnE, not PMSVer KVM: arm64: Fix kvm_vcpu_initialized() macro parameter KVM: arm64: Fix pin leak and publication ordering in __pkvm_init_vcpu() Quentin Perret (1): KVM: arm64: Fix initialisation order in __pkvm_init_finalise() arch/arm64/include/asm/kvm_host.h | 2 +- arch/arm64/kvm/config.c | 23 +++++++++++++------ arch/arm64/kvm/hyp/nvhe/pkvm.c | 38 ++++++++++++++++++++----------- arch/arm64/kvm/hyp/nvhe/setup.c | 8 +++---- 4 files changed, 46 insertions(+), 25 deletions(-) -- 2.54.0.rc2.544.gc7ae2d5bb8-goog