From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f73.google.com (mail-wr1-f73.google.com [209.85.221.73]) (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 090BF3E3DB8 for ; Fri, 26 Jun 2026 07:45:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782459958; cv=none; b=EUu6aliVfbw0wSs/OxqAPaIY+6fBQYPAAH0eXqDps+YMcD1sXUHud2lNwBE3X18+XMmXMaRWimMgYdQVPhMO/nWOpkrbRRfhSK0xFEpwnMEyI6ni26Hwug0SqxbMEDjFJIPCtU7iMhaCOxGpOPY0HTzHC2isr3ueU3AfwO++Usw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782459958; c=relaxed/simple; bh=PctLykWCghmyUisAVpQ4wOoWl4Aaqh6+hWz130v9m+Y=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=qQn1kbTvtGeZfh3+RWXyMgspN7wN4+HFhvtdH6oN1+bcnJw/qJi2x+7FAWIQJAHgnk74pookH9Fw/9N/qh10fSEAdqnTxncplsL2wIef6H4MMCQ8YoOYrpBDiFy6Dtgo2LyPQzic+q8v93vyF6t63QLq8amCTj6VLWhT1ngcxQ4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--sebastianene.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=uq0A6/xA; arc=none smtp.client-ip=209.85.221.73 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--sebastianene.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="uq0A6/xA" Received: by mail-wr1-f73.google.com with SMTP id ffacd0b85a97d-4639f122c38so412373f8f.1 for ; Fri, 26 Jun 2026 00:45:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1782459955; x=1783064755; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=zeJOCZLhCVkiT1VK2WkmVo/4/mMU1YIiY4Y789TDXh0=; b=uq0A6/xAq5MlUdx8xWnt9ruoa5YON82y3JBtuXBWnr269/mhTil4peSvsI3WQunHiG O+FDHuVLAASc0LGBr/t1ypmUUGSLuNPZRCboWAarD6lM5I44Kq+S0dPt+GTFCGoUteWR EM0KmQMlz/B80thEqEQCxOLOlJE9PQF/AaABnytc+YjTZY4Iq8gTDr0dwRAKxc0PeVCx tYJzREoVo1QyU11yAIY2FYKYsxKGq/2dWN+Ve3lq42M7n0WIWZAty1o7XqmxkNz9zlJf V3Gg9kLxJ0R6OCuYXRkDUm9kDgOLBISqQAnFRrt0hOFByXy/x/LeAQewqj1/FO7vrd3H FSCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782459955; x=1783064755; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=zeJOCZLhCVkiT1VK2WkmVo/4/mMU1YIiY4Y789TDXh0=; b=dPpwArXGMmiwR7V3USfv2n3swEKFWAyS8ieA97690f0N+1cCj3RJXmU01RU5xs6OHL +65WH15UkQ+vjue5M4A3T8hdgtEB3PaCAf9feXgyg3RrOUPaSDS8IiPU7fHN5/+4sYD7 qIs1C824PVlEd9XIw4GU16w3TxbTV0Z+AlU+a5W46rlJPm6ywc8NkGGRHQObA3MJ7ZHu gQhYrhHjw+QpWif6TJjBmdSeRop17yXyVTyieYFoONCr2g+QN3iOSE/eAkUNBEHmmJQd AJ//1dRh1UlPUlmOr9CzIohNDY5U5xh3Y6CRsx10V5hx/N1Ji/SADqCvsvHRM2X2Pu4s iFkg== X-Forwarded-Encrypted: i=1; AHgh+RrBdSza573CAup+XmoJjtn/c4xKnHi9IGIjTJBJvwc3Rh459OzNyNGvXFv+XBlb39JXeDOHn7imG55/d7U=@vger.kernel.org X-Gm-Message-State: AOJu0YzEZSNKxnfPhjzBq1omKm47VyMKhzU+xhZ07Pxo0ol339gzdh0j rGgyxG19R6AZkYUAbX9l3/c8v3F+jOb9dak3gKQ3Uul2F6HzHOR9x3jM4j8j257kNigX3xNktDT rBNChZXT4jTo3QEeoy4BCX2zhf+AiCg== X-Received: from wrpl17.prod.google.com ([2002:a5d:4111:0:b0:46d:fd7:d50c]) (user=sebastianene job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6000:4608:b0:462:1a7a:9846 with SMTP id ffacd0b85a97d-46dbec3fd27mr8598500f8f.8.1782459955083; Fri, 26 Jun 2026 00:45:55 -0700 (PDT) Date: Fri, 26 Jun 2026 07:45:38 +0000 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.55.0.rc0.799.gd6f94ed593-goog Message-ID: <20260626074545.433234-1-sebastianene@google.com> Subject: [PATCH v6 0/7] KVM: arm64: Forward FFA_NOTIFICATION* calls to TrustZone From: Sebastian Ene To: catalin.marinas@arm.com, maz@kernel.org, oupton@kernel.org, will@kernel.org Cc: joey.gouly@arm.com, korneld@google.com, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, android-kvm@google.com, mrigendra.chaubey@gmail.com, perlarsen@google.com, sebastianene@google.com, suzuki.poulose@arm.com, vdonnefort@google.com, yuzenghui@huawei.com Content-Type: text/plain; charset="UTF-8" Remove the FFA_NOTIFICATION* calls from the blocklist used by the pKVM FF-A proxy. This restriction was preventing the use of asynchronous signaling mechanisms defined by the Arm FF-A specification to communicate with the secure services. While these calls are markes as optional, there is no reason why the hypervisor proxy would block them because: 1. Host is the Sole Non-Secure Endpoint: The Host operates as the only Non-Secure VM ID (VM ID 0) recognized by the Secure World. Because all forwarded notifications are inherently attributed to the Host by the SPMC, there is no risk of VM ID spoofing originating from the Normal World. 2. No Memory Pointers or Addresses: The FFA_NOTIFICATION_* ABIs operate strictly via register-based parameters, passing only VM IDs, VCPU IDs, flags, and bitmaps. Because these calls do not contain memory addresses, offsets, or pointers, forwarding them doesn't pose a risk of memory-based confused deputy attack (e.g., tricking the SPMC into overwriting protected memory). While the pKVM proxy behaves as a relayer, it doesn't currently have its own FF-A ID(only the host has the ID 0). The behavior of the setup flow is covered by the spec in the: '10.9 Notification support without a Hypervisor'. --- Changes in v6: - applied Will's feedback and re-ordered the patch series so that we apply the MBZ enforcement at the end of the series - update ffa_check_unused_args_sbz so that we take into account the FF-A version because the spec changed the list of unused parameter registers for 64-bit SMCs from v1.1 to v1.2 Changes in v5: - handle 32-bit smc variants correctly when doing the MBZ enforcement - add check for FFA_FEATURES - handle missing FFA_FN64_NOTIFICATION_INFO_GET - collected the Review tags from Vincent, thank you Changes in v4: - previous series(v3) had serious issues with the patch number and it appeared like it used a mixed bag from v2 as well. Resend this to restore the correct order of the patches. - fix strict check in ffa_check_unused_args_sbz and make it "<= 17" - check the receiver endpoint Id in FFA_NOTIFICATION_BIND/FFA_NOTIFICATION_UNBIND instead of the sender - use hyp_smccc_1_2_smc all along - check the receiver endpoit Id when doing FFA_NOTIFICATION_GET Changes in v3: - applied Will's suggestion to use the introduced method ffa_check_unused_args_sbz for existing calls and added a new patch in the beggining of the series to do this. - merged the handling of FFA_NOTIFICATION_BITMAP_CREATE/FFA_NOTIFICATION_BITMAP_DESTROY into one patch as Vincent suggested and create one handler for both. Changes in v2: - enforce the MBZ/SBZ fields - split the calls into separate patches - rebase on 7.1-rc7 Link to v5: https://lore.kernel.org/all/20260623115354.632361-1-sebastianene@google.com/ Link to v4: https://lore.kernel.org/all/20260616154149.2763214-1-sebastianene@google.com/ Link to v3: https://lore.kernel.org/all/20260616105417.2578670-1-sebastianene@google.com/ Link to v2: https://lore.kernel.org/all/20260608165549.1479409-1-sebastianene@google.com/ Link to v1: https://lore.kernel.org/all/20260501114447.2389222-2-sebastianene@google.com/ Sebastian Ene (7): KVM: arm64: Forward FFA_NOTIFICATION_BITMAP calls to Trustzone KVM: arm64: Support FFA_NOTIFICATION_BIND in host handler KVM: arm64: Support FFA_NOTIFICATION_UNBIND in host handler KVM: arm64: Support FFA_NOTIFICATION_SET in host handler KVM: arm64: Support FFA_NOTIFICATION_GET in host handler KVM: arm64: Support FFA_NOTIFICATION_INFO_GET in host handler KVM: arm64: Enforce strict SBZ checks in the FF-A proxy arch/arm64/kvm/hyp/nvhe/ffa.c | 220 ++++++++++++++++++++++++++++++++-- 1 file changed, 212 insertions(+), 8 deletions(-) -- 2.55.0.rc0.799.gd6f94ed593-goog