From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f73.google.com (mail-ed1-f73.google.com [209.85.208.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 E4F2344D01D for ; Tue, 16 Jun 2026 15:42:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781624523; cv=none; b=RoFwJmDvUwk3EjitRMLjctyAl0NrvjL6/52I2HwxO1lab4l7sGo5eitxVhfM9/LKsgqRIiRsmbm7YCLycISosLK5vKzjtIJjEA2zyLg76ixv82slj5AvTOUZ0cgGJrRyac+NlPu9nLpRaXHrs4VgQZcGH44DDOuATz6rOIkniWY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781624523; c=relaxed/simple; bh=sVmyW2ZCcI5kqJbpqnmxwTzPiRwlsWCVcE00L7W5JWk=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=Wv8qDo63Dilxw5QbkmvjrnA+guOF6AZLXNwEs+vcFOjRCvqkP0aTaCgmz5FSl8v5ZbK+UnH28LKDujdWcBQQf4q+cq1Jv9pzPdekTcEJaJ6v1rk1wymh2P4NFuBPFzqI4d9yM6uclblzJNOgvmbzXT8jyLeFjCyb0kkVHhtgYvE= 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=LrBJnzcB; arc=none smtp.client-ip=209.85.208.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="LrBJnzcB" Received: by mail-ed1-f73.google.com with SMTP id 4fb4d7f45d1cf-68c2fe45057so4349051a12.3 for ; Tue, 16 Jun 2026 08:42:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1781624520; x=1782229320; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=fHtYPZ3p2t9f2nLF/1WXA269aMaG2YVhAxwX4n4X/s0=; b=LrBJnzcBvXC4hXGFq6nFXeFWFnoh7qct9NrY3FmrAlq+oPe3MrWGBT/LrRW4Hy/kcF Hftp8NM+9UwStd09It5j24wdLrItPwoGFkeIDmxBSJgYVRsK9C2Rp2m9sgedGH2+pogi uj0rpD3tOe13eukecp8tpMKK/X+XzkYBKTqXZU6eVz7OI65yLd+OY3WMAw6QnRF6dMAv cpObZ8ig3RR1cmOYKup5A6H2sWBvRlFqSbyFzW26/OVhz/hR751JVWrzWXiZJYBMJZ+I 7aZqOJP5V0bkHpdEezQiA2+61JMjpCo+znaDjWv6TEA6i6VFMkEY2zl4caOWngC1WVS/ H6yA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781624520; x=1782229320; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=fHtYPZ3p2t9f2nLF/1WXA269aMaG2YVhAxwX4n4X/s0=; b=nYxc+I7P5X0TQ2YsiuapTKm0zwtfMMzTsciZ6D5GqmWdyvdewhUkynt9j6zwBBgjQB 9XRvfZBk0t6J5ifSI+krZohLCObDr5u1bB2+dmD6WS10MVejTBDXsgitSGawGYBzlagk AvurgwW08F1f5hS86EzoumIfHByD/M+QwhCFuNL0ndbQUI67dHk3O6XiU5efBjcTmU/X jO2LBiO50Cl+V+1uD3pR3r+5eL0D+/JPoz/+cAhg6//UtORjWFeL138Eu6RNeZm+kQtX i51vHhJrZwX4U0Og7fu9pEpqNJ0VEecleazw1EEtVa9XHkbTlAfKApQANeTUJIdPPwi+ K83w== X-Forwarded-Encrypted: i=1; AFNElJ+YxbNsz7u5KWGIXmH76Mbi9X8HRxwV8LHHCQYyGVwi/r1KOl4J7frXkIi1ePHDR8K7UOsp4Wwijm2vGnk=@vger.kernel.org X-Gm-Message-State: AOJu0YxCaYqXV2boG61zLLW7l5w++otTEwDBpeyVqhaEQiWakNp9W1ZI 9+X4+Lh9Qxf5NBuQYzNVsVmXptaBL4KlGbu1F8h0eQfKVPbIGnbL2oNhTrMwD8yK2M3wXcZ4pHs sKjm/hnQngAUC01ehePPFAQm7HaMOLQ== X-Received: from edrj2.prod.google.com ([2002:aa7:c342:0:b0:695:469a:cfda]) (user=sebastianene job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6402:4498:b0:68c:bf82:884c with SMTP id 4fb4d7f45d1cf-695086dce09mr2519000a12.6.1781624520031; Tue, 16 Jun 2026 08:42:00 -0700 (PDT) Date: Tue, 16 Jun 2026 15:41:42 +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.54.0.1136.gdb2ca164c4-goog Message-ID: <20260616154149.2763214-1-sebastianene@google.com> Subject: [PATCH v4 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 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 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: Enforce strict SBZ checks in the FF-A proxy 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 arch/arm64/kvm/hyp/nvhe/ffa.c | 211 ++++++++++++++++++++++++++++++++-- 1 file changed, 203 insertions(+), 8 deletions(-) -- 2.54.0.1136.gdb2ca164c4-goog