Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp104998lqt; Thu, 18 Apr 2024 09:32:45 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV61/KW9++paSYyMKo0wf+L8sJzcV8mP4NH0HTKfc7BI9OyHA4Hx4otuZZ0Tr6lsSHtkCjPoi47LvLobB1qZNF483W5evsVcLMvI3RNTQ== X-Google-Smtp-Source: AGHT+IFnlkWPukggs1fclC+y8k97WhlJ3lB4TztSuoXAi9yDjjhzZWdsnKUgl3rjEQ9qrRtfaTGU X-Received: by 2002:a17:906:b251:b0:a52:8a8a:59cb with SMTP id ce17-20020a170906b25100b00a528a8a59cbmr1977125ejb.61.1713457964803; Thu, 18 Apr 2024 09:32:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713457964; cv=pass; d=google.com; s=arc-20160816; b=xeON5VMKEsaXKk8RjzNkzcyhnqIny5D9Yjxrquw0zP962lCxhCZuX/obVPe07UtJB7 Qk12IrYPzOWV8VnENGHBjhyrBA/iWxOiv5Z19NwJ0FAsj2MwlUv53+x+Ybr6iwZSlrJW UDDuYlUrtoLtUcVUEzLptCgA11SOV7dyb3jSgbqcUIIrS6XCkfkf8eZky5/YQ/cj9pmx XKG7dBZBNhnq/3aSbd2bSL0Lp7AmkPpO9P7O4MlIbprV/2y2gEmwyviJysX1VofcpJXY d16BALrrqwW1t0/l+11QkiJa4xIZUYOl7lyp7lND/wrtiAFXtsq9rcW9LAQt5h8xT6un HNjA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:references:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:in-reply-to:date :dkim-signature; bh=o/WdHir/Mi2mSDEW62XszsH6Iho8VZ+3enjU3uPIcDs=; fh=n7EhvZHH9ltpgCRp4AoSvWzRowkJ1IdE0TQxl/nM13c=; b=H+X8irJSRF5cRCoK2Rv0T+4otO27zJWNOYf5qh7sSrCVpbvtvKcG2QRWSf2PBMFVxy ArX/cAxmybrmkqlsPe4wT9sR2eFijDv+qtaf1DMd09TVuVN61bUlAw/lqHPmmeDy1UqF TVAnqKQjFarLqiTmmcYuqURTsrFBqwG/sV030RoDxaqQcCDh6Vy5fGSt8vu3KmnRk2UR C9Tep7u4Z9VCBiXjPxTpFUgq3HHmSP1fmbv0HMX0fVGnTi+yoX9TKhSlQw+/bTeBEcc1 SNKwuWvWASnZK/5TOnXzU4Ck9YEVTx8N96y/EQSoY4sy5nRF7SSeuMNOHalG6gzrrCQK Uv6g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=c33FeuoV; arc=pass (i=1 spf=pass spfdomain=flex--sebastianene.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-150486-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-150486-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id dv9-20020a170906b80900b00a4750f3cb5asi1012638ejb.682.2024.04.18.09.32.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 09:32:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-150486-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=c33FeuoV; arc=pass (i=1 spf=pass spfdomain=flex--sebastianene.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-150486-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-150486-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id B4B1A1F22CE9 for ; Thu, 18 Apr 2024 16:32:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E737C17332B; Thu, 18 Apr 2024 16:31:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="c33FeuoV" Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) (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 BC204172BAA for ; Thu, 18 Apr 2024 16:31:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713457914; cv=none; b=AZ/9snKI9sLZFn7NCFvBkpMRGxCGS00cVpmnOsafO4G6kMduBsOf2m6C/saCY2/HTHl66ePxVH9e6fwsa9I/qkn0uqmRR75FBJTApLYFmTHQE3aV5h6WnaHudJ4HeWLqXfKjOuZZSQ8obtgE3cHuMsek7CoFXsyPgi3uB6wKeuI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713457914; c=relaxed/simple; bh=c2CK72lGJDZxhkE+vu1jRDsSGgFezzCof9rwe6Qg764=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=AKL0NwINNOMzSgO8TbKabIs3gpOcMUaUB/OivocxaQSOrvmo0T61oRcKT23L0EZaBur8Si1GDYmX8ABScHq5AC8JFEpHnPfVsO3OrSqDtJ/YZHiR5YCcfdfqLROcHSgSHQzitwJ6t/Nj2U6WmCqcc3To+8bWYpleqZIqBpyjocE= 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=c33FeuoV; arc=none smtp.client-ip=209.85.219.202 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 Received: by mail-yb1-f202.google.com with SMTP id 3f1490d57ef6-dc64f63d768so2014126276.2 for ; Thu, 18 Apr 2024 09:31:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1713457912; x=1714062712; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=o/WdHir/Mi2mSDEW62XszsH6Iho8VZ+3enjU3uPIcDs=; b=c33FeuoVmUcQ0l0C4pwHQaC3m8gGLZAI3AId2TelkMcM8A3JPeBr3ZIsjrioymToj4 Xa0eyWUvWzwJmXR8P54KgR7lERWLP2x17qhZe7TdW/dKgnaRodgKgd+Mb/GbpRBV509p mvoxHfTcmSoHcJCdxnfbDKtCBP9KjFy+VZH4FufagmUzcfzA6fch2CkmHpsMAD95stMM jN6MmrWoTnwjt1SIqsDg2WEMCBKzmm5Lv45mu7WFd9GmdlHLigHUKWV6AVRSHOckCsWQ kthOx/RvFLO81kLzyLApEiRKjncxblJjGkrsSYRMeS3o5+YZyPptIITxeXgRymSh1HD8 8puw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713457912; x=1714062712; h=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; bh=o/WdHir/Mi2mSDEW62XszsH6Iho8VZ+3enjU3uPIcDs=; b=DHjbiLh6ES6ipVxt9j20Ir4aKcjb2df+VF82XmyMl9BZLDiZ0p+aRNlCj9AyBy/ljA YbYj5aEVfjcjQswnGPFymRPtG6EOF4ibNvAkkW3V0d3FW2DKgzoxGTh+Z37fcTSQHDBA ZCm3EA4RnoB4a4gdLgEmG1SynwHFUGddjpiYAjZ0pX5aGEwA6M4LZvblUfv89/HcUaLS 7srtWNwvNTq0eb4NsmKzdESIy3U1C4dNCktrq7GMrIZSRCojybVPC4Ei3omKOskNsqa4 tvkCN5JEZbiWQFiWu6f+yVMMQLXp5cPMX1jdRAtQVcjj+OPtuF7kWmClPulf66sp7NJc cPRg== X-Forwarded-Encrypted: i=1; AJvYcCVsq8vAddY+qZo7PTk9P3xGe47nQFO+n6DFVm2/Dlg1NtrWEM5H2rS+ulddXaEAi16ozqJEumMtD6J9G8QJqmmZafIZ2Y7W35E1ills X-Gm-Message-State: AOJu0YygnvOWDuhwPknBBm3QQh3f3loiSiZfItiuzHWl7urkv5Ncy2zo gENdN6+x/P53nxBRyDgDHnUEvIb5W+tRMU7UxsgmcQ4cpjnWTwGfxLcHiK8n9rz95LuzDBvwh0u WPqCg0J08tkoOMtmx3j5mRVNqtw== X-Received: from sebkvm.c.googlers.com ([fda3:e722:ac3:cc00:28:9cb1:c0a8:cd5]) (user=sebastianene job=sendgmr) by 2002:a05:6902:2b8e:b0:dc6:cd85:bcd7 with SMTP id fj14-20020a0569022b8e00b00dc6cd85bcd7mr831056ybb.3.1713457911701; Thu, 18 Apr 2024 09:31:51 -0700 (PDT) Date: Thu, 18 Apr 2024 16:30:26 +0000 In-Reply-To: <20240418163025.1193763-2-sebastianene@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240418163025.1193763-2-sebastianene@google.com> X-Mailer: git-send-email 2.44.0.769.g3c40516874-goog Message-ID: <20240418163025.1193763-6-sebastianene@google.com> Subject: [PATCH 4/4] KVM: arm64: Use FF-A 1.1 with pKVM From: Sebastian Ene To: catalin.marinas@arm.com, james.morse@arm.com, jean-philippe@linaro.org, maz@kernel.org, oliver.upton@linux.dev, qperret@google.com, qwandor@google.com, sudeep.holla@arm.com, suzuki.poulose@arm.com, tabba@google.com, will@kernel.org, yuzenghui@huawei.com, lpieralisi@kernel.org Cc: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-team@android.com, Sebastian Ene Content-Type: text/plain; charset="UTF-8" Now that the layout of the structures is compatible with 1.1 it is time to probe the 1.1 version of the FF-A protocol inside the hypervisor. If the TEE doesn't support it, it should return the minimum supported version. Signed-off-by: Sebastian Ene --- arch/arm64/kvm/hyp/nvhe/ffa.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm64/kvm/hyp/nvhe/ffa.c b/arch/arm64/kvm/hyp/nvhe/ffa.c index d53f50c73acb..8633c8e0b09b 100644 --- a/arch/arm64/kvm/hyp/nvhe/ffa.c +++ b/arch/arm64/kvm/hyp/nvhe/ffa.c @@ -455,7 +455,7 @@ static __always_inline void do_ffa_mem_xfer(const u64 func_id, memcpy(buf, host_buffers.tx, fraglen); ep_mem_access = (void *)buf + - ffa_mem_desc_offset(buf, 0, FFA_VERSION_1_0); + ffa_mem_desc_offset(buf, 0, host_buffers.ffa_version); offset = ep_mem_access->composite_off; if (!offset || buf->ep_count != 1 || buf->sender_id != HOST_FFA_ID) { ret = FFA_RET_INVALID_PARAMETERS; @@ -534,7 +534,7 @@ static void do_ffa_mem_reclaim(struct arm_smccc_res *res, fraglen = res->a2; ep_mem_access = (void *)buf + - ffa_mem_desc_offset(buf, 0, FFA_VERSION_1_0); + ffa_mem_desc_offset(buf, 0, host_buffers.ffa_version); offset = ep_mem_access->composite_off; /* * We can trust the SPMD to get this right, but let's at least @@ -789,7 +789,7 @@ int hyp_ffa_init(void *pages) if (kvm_host_psci_config.smccc_version < ARM_SMCCC_VERSION_1_2) return 0; - arm_smccc_1_1_smc(FFA_VERSION, FFA_VERSION_1_0, 0, 0, 0, 0, 0, 0, &res); + arm_smccc_1_1_smc(FFA_VERSION, FFA_VERSION_1_1, 0, 0, 0, 0, 0, 0, &res); if (res.a0 == FFA_RET_NOT_SUPPORTED) return 0; -- 2.44.0.769.g3c40516874-goog