From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 10DCCC27C4F for ; Thu, 13 Jun 2024 11:56:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=EE1nN/bbZGwmk0UpB/fAkY4ALv0H3P02C8XfuKC6Rwo=; b=W8Dfh2LNZ9K6NNIfKZNesFmMet RbyMO5hqd/k4xmn7LMqYue2zEknMYzwwczouxBFyXRBMkNnwu4RWOWqvvgULQu+CdOeGJg/FaxjhH 01CY0dW/asUNyznNTgjqLnRz0583qUU4NZR/TNkausXhYSCygUqtSkJxdoe9n0fUFtl0B2HmDUz3E Sm8z3IfI78wwE7kWHz66IVbaa44XE7YG4kx4knNkKmywOgyPG7ip5SvmkpAjZCSmCVt54bzP7FgRb AQFofwv5XYLPXMqMVVFIIEskckuOYH0C7N9u59Jz3iaI2pwOuE9pd63zEHCdWHbpWNkSQ9qDrFL4P 8N+yY2Yw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sHj3Y-0000000GOWs-0aOW; Thu, 13 Jun 2024 11:55:52 +0000 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sHj3V-0000000GOV6-0dRJ for linux-arm-kernel@lists.infradead.org; Thu, 13 Jun 2024 11:55:51 +0000 Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-1f70fdc9645so118475ad.1 for ; Thu, 13 Jun 2024 04:55:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1718279746; x=1718884546; darn=lists.infradead.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=EE1nN/bbZGwmk0UpB/fAkY4ALv0H3P02C8XfuKC6Rwo=; b=aWPKQnPixegqX/y2Z525nYiqCOlhHpQe8s2aNsfZYliDlm/j9dPdVVpRJ+hOoNG75m xkw2qfh9UDStRuUry0VncifFmLz2q5rVxnhw/KzxAACZBfHqwJVfnXjUiwZWa4kobUoI MuN/rODYSElG4q4K2xeViXA794P8HMlG+1m4RaWui778nKM2URB0iof31zC8rOe8O3K0 q057dwEk+S+N/gRenPRJWGG+n9k7sUyjHoSDjwXoO95Alh1wL8RiDEdt60K/8u7kPBLq ChsUtpwUFPNx2wRYKSrC56ck7WOxwN3rhN/sQX/OG7ioWCGfYKqkJl3YU3fvJpFRlFtW A/AQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718279746; x=1718884546; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=EE1nN/bbZGwmk0UpB/fAkY4ALv0H3P02C8XfuKC6Rwo=; b=N0zKSCz+C/pUNPRSqBKj6FMkec8gZWG/jDmMtxazjopPZjd6Gg1/Oe1IJU3lrIiNjy s/RNLKlCxXoMUbdM0Q6FOQn0GZPuRq/lprSwhc5wIFacEa3/+hKfYB3q+SyMFZ1lIPJ0 FRLGEIYWp+7Fw1KkOIu/KsbTootJlRhyYxQKm27/iQZUsQqMydbD2STSsKsISHKJCy/w /zxqZ026nCl+7Q+QI3CSf3M4ojGKTufN3t9cs3qX0LZjYpkS+GvYQ4logSM0M/hJvwME umfuhF2YJm3vbqqpmshXZEIDpqfWsjet80jSjx0P1zDGMISsvGwrW9vOpugpvPnNbO0Y 773g== X-Forwarded-Encrypted: i=1; AJvYcCXhStIckNpQ7VVNjOLyVCrZuG5SHSk8bCdgarlI8wu2hsZODG1Zs6rLACNblfMjc8xmoToegIziQ+2xxB2fsKoLkdk9INdGqNoN7si8QosH6AxE02A= X-Gm-Message-State: AOJu0Yw9IBlidUjHWiYDnG/rSaiZyTTF38gNwHtClwneVuhZsGC7eS1y QbPZpCeRQ95z+xVdLDHJfwQ2ZTTUX5l60aiU2epV5ZN4HDq7nXEmfhAYS0AOKQ== X-Google-Smtp-Source: AGHT+IG5IOEOepR0qdMVRmtxHZM0ZHQKWE+MvnTBo2aRyqmr9Ec2NAfOXkaUKM2+xp4/pE/pves/TA== X-Received: by 2002:a17:902:968d:b0:1f7:3764:1e19 with SMTP id d9443c01a7336-1f84fde613cmr2805325ad.20.1718279745485; Thu, 13 Jun 2024 04:55:45 -0700 (PDT) Received: from google.com (216.131.76.34.bc.googleusercontent.com. [34.76.131.216]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2c4c45f8690sm1455192a91.33.2024.06.13.04.55.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 04:55:44 -0700 (PDT) Date: Thu, 13 Jun 2024 11:55:40 +0000 From: Sebastian Ene To: Sudeep Holla Cc: 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, suzuki.poulose@arm.com, tabba@google.com, will@kernel.org, yuzenghui@huawei.com, lpieralisi@kernel.org, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-team@android.com Subject: Re: [PATCH v2 1/4] KVM: arm64: Trap FFA_VERSION host call in pKVM Message-ID: References: <20240515172258.1680881-1-sebastianene@google.com> <20240515172258.1680881-2-sebastianene@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240613_045549_215465_765640AD X-CRM114-Status: GOOD ( 27.16 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Jun 12, 2024 at 02:58:31PM +0100, Sudeep Holla wrote: > On Wed, May 15, 2024 at 05:22:55PM +0000, Sebastian Ene wrote: > > The pKVM hypervisor initializes with FF-A version 1.0. The spec requires > > that no other FF-A calls to be issued before the version negotiation > > phase is complete. Split the hypervisor proxy initialization code in two > > parts so that we can move the later one after the host negotiates its > > version. > > Blank line here would be nice. > Added blank line. > > Without trapping the call, the host drivers can negotiate a higher > > version number with TEE which can result in a different memory layout > > described during the memory sharing calls. > > > > LGTM(apart from minor nits), > > Reviewed-by: Sudeep Holla > Thanks Sudeep, I will incorporate the tag it in v3. > > Signed-off-by: Sebastian Ene > > --- > > arch/arm64/kvm/hyp/nvhe/ffa.c | 123 +++++++++++++++++++++++++--------- > > 1 file changed, 92 insertions(+), 31 deletions(-) > > > > diff --git a/arch/arm64/kvm/hyp/nvhe/ffa.c b/arch/arm64/kvm/hyp/nvhe/ffa.c > > index 320f2eaa14a9..72f1206c85fb 100644 > > --- a/arch/arm64/kvm/hyp/nvhe/ffa.c > > +++ b/arch/arm64/kvm/hyp/nvhe/ffa.c > > @@ -1,4 +1,5 @@ > > // SPDX-License-Identifier: GPL-2.0-only > > +// > > It should be OK but still spurious for $subject 😉 > > [...] > Dropped this. > > @@ -700,7 +789,6 @@ bool kvm_host_ffa_handler(struct kvm_cpu_context *host_ctxt, u32 func_id) > > int hyp_ffa_init(void *pages) > > { > > struct arm_smccc_res res; > > - size_t min_rxtx_sz; > > void *tx, *rx; > > > > if (kvm_host_psci_config.smccc_version < ARM_SMCCC_VERSION_1_2) > > @@ -726,35 +814,7 @@ int hyp_ffa_init(void *pages) > > if (FFA_MAJOR_VERSION(res.a0) != 1) > > return -EOPNOTSUPP; > > > > - arm_smccc_1_1_smc(FFA_ID_GET, 0, 0, 0, 0, 0, 0, 0, &res); > > - if (res.a0 != FFA_SUCCESS) > > - return -EOPNOTSUPP; > > - > > - if (res.a2 != HOST_FFA_ID) > > - return -EINVAL; > > - > > - arm_smccc_1_1_smc(FFA_FEATURES, FFA_FN64_RXTX_MAP, > > - 0, 0, 0, 0, 0, 0, &res); > > - if (res.a0 != FFA_SUCCESS) > > - return -EOPNOTSUPP; > > - > > - switch (res.a2) { > > - case FFA_FEAT_RXTX_MIN_SZ_4K: > > - min_rxtx_sz = SZ_4K; > > - break; > > - case FFA_FEAT_RXTX_MIN_SZ_16K: > > - min_rxtx_sz = SZ_16K; > > - break; > > - case FFA_FEAT_RXTX_MIN_SZ_64K: > > - min_rxtx_sz = SZ_64K; > > - break; > > - default: > > - return -EINVAL; > > - } > > - > > - if (min_rxtx_sz > PAGE_SIZE) > > - return -EOPNOTSUPP; > > - > > + hyp_ffa_version = FFA_VERSION_1_0; > > tx = pages; > > pages += KVM_FFA_MBOX_NR_PAGES * PAGE_SIZE; > > rx = pages; > > @@ -773,8 +833,9 @@ int hyp_ffa_init(void *pages) > > }; > > > > host_buffers = (struct kvm_ffa_buffers) { > > - .lock = __HYP_SPIN_LOCK_UNLOCKED, > > + .lock = __HYP_SPIN_LOCK_UNLOCKED, > > Spurious or intentional whitespace change ? I can't make out from the mail. > > -- I dropped this, it was a spurious whitespace change. > Regards, > Sudeep Cheers, Seb