From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C689E2D94A6 for ; Thu, 9 Oct 2025 10:25:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.176.79.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760005538; cv=none; b=nvUwjigMqAnGeySrsWwW2WsinEFL5mt+fP9KTP9mWgeHUIqT6nwmvMTf68IqcMe2WwwrukwOSB8mR8X0whwLr8uApzE+umSdUWEWg4J46HpsNxqRcWcoQTV1CqV+sGXPuP59+DJzmuNnldkB7JoL9oB2M3R9o4jTyk4kDX+2cTA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760005538; c=relaxed/simple; bh=ZrmCf5EyoHPRNw8k1PRAHmD4BI5qSX9aWBvSf7QYYC8=; h=Date:From:To:CC:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=mrAWGMZcj8gY4UUc6Znn09+35i7+zgsaOdt0n7XgMh7EBhH11kdBYFVghUW5IlwakupiaVkUzt0tLY3NHLMnD3XGTKCryOgrBNyckA7exArk6pNsCgUPGuOLJoySXd5Gcl2tfrc/eePSFJ8lrrvDkM2T4jykDOdEcc3edU44tkE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=185.176.79.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.18.186.216]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4cj5bQ1ZCgz6FGkL; Thu, 9 Oct 2025 18:24:50 +0800 (CST) Received: from dubpeml100005.china.huawei.com (unknown [7.214.146.113]) by mail.maildlp.com (Postfix) with ESMTPS id 6FABA1400CA; Thu, 9 Oct 2025 18:25:32 +0800 (CST) Received: from localhost (10.203.177.15) by dubpeml100005.china.huawei.com (7.214.146.113) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Thu, 9 Oct 2025 11:25:31 +0100 Date: Thu, 9 Oct 2025 11:25:29 +0100 From: Jonathan Cameron To: "Aneesh Kumar K.V (Arm)" CC: , , , Catalin Marinas , Will Deacon , Steven Price , "Gavin Shan" , Suzuki K Poulose , "Jeremy Linton" , Sami Mujawar Subject: Re: [PATCH] coco: guest: arm64: Update ARM CCA guest driver Message-ID: <20251009112529.00001b41@huawei.com> In-Reply-To: <20251008132758.784275-1-aneesh.kumar@kernel.org> References: <20251008132758.784275-1-aneesh.kumar@kernel.org> X-Mailer: Claws Mail 4.3.0 (GTK 3.24.42; x86_64-w64-mingw32) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: lhrpeml500011.china.huawei.com (7.191.174.215) To dubpeml100005.china.huawei.com (7.214.146.113) On Wed, 8 Oct 2025 18:57:58 +0530 "Aneesh Kumar K.V (Arm)" wrote: > Make preparatory updates to the ARM CCA guest driver: > > - Switch from using a platform device to a faux device (based on > feedback in [1]) > - Rename the device from `arm-cca-dev` to `arm-rsi-dev`, so that the > host driver can register an equivalent `arm-rmi-dev` > > These changes are purely structural and introduce no new functionality. > Subsequent patches will extend this driver to add guest device > assignment support. > > [1] https://lore.kernel.org/all/2025073035-bulginess-rematch-b92e@gregkh > Slight preference for: Link: https://lore.kernel.org/all/2025073035-bulginess-rematch-b92e@gregkh #1 > Signed-off-by: Aneesh Kumar K.V (Arm) > --- > NOTE: > This patch is sent early outside the patchseries to avoid userspace from > depending on the presence of the newly introduced platform device. > The platform device was added in v6.14-rc1. > A few trivial things inline. With those in mind. Reviewed-by: Jonathan Cameron > diff --git a/drivers/virt/coco/arm-cca-guest/Makefile b/drivers/virt/coco/arm-cca-guest/Makefile > index 69eeba08e98a..609462ea9438 100644 > --- a/drivers/virt/coco/arm-cca-guest/Makefile > +++ b/drivers/virt/coco/arm-cca-guest/Makefile > @@ -1,2 +1,5 @@ > # SPDX-License-Identifier: GPL-2.0-only > +# Unrelated change. I'd drop it. > obj-$(CONFIG_ARM_CCA_GUEST) += arm-cca-guest.o > + > +arm-cca-guest-$(CONFIG_TSM) += arm-cca.o extra space after = seems a bit odd. > diff --git a/drivers/virt/coco/arm-cca-guest/arm-cca-guest.c b/drivers/virt/coco/arm-cca-guest/arm-cca.c > similarity index 85% > rename from drivers/virt/coco/arm-cca-guest/arm-cca-guest.c > rename to drivers/virt/coco/arm-cca-guest/arm-cca.c > index 0c9ea24a200c..89d9e7f8eb5d 100644 > --- a/drivers/virt/coco/arm-cca-guest/arm-cca-guest.c > +++ b/drivers/virt/coco/arm-cca-guest/arm-cca.c > @@ -1,8 +1,9 @@ > // SPDX-License-Identifier: GPL-2.0-only > /* > - * Copyright (C) 2023 ARM Ltd. > + * Copyright (C) 2025 ARM Ltd. I'd expect a date range rather than updating copyright for whole file like this. The untouched bit will still be 2023 era code. > */ > +static int cca_tsm_probe(struct faux_device *fdev) > { > int ret; > > if (!is_realm_world()) > return -ENODEV; > > - ret = tsm_report_register(&arm_cca_tsm_ops, NULL); > - if (ret < 0) > + ret = tsm_report_register(&arm_cca_tsm_report_ops, NULL); > + if (ret < 0) { > pr_err("Error %d registering with TSM\n", ret); > + return ret; > + } > + > + ret = devm_add_action_or_reset(&fdev->dev, unregister_cca_tsm_report, NULL); > + if (ret < 0) { > + pr_err("Error %d registering devm action\n", ret); I believe (not checked today) that devm_add_action_or_reset() can only fail with -ENOMEM due to an allocation failure and we generally don't print extra error messages if that happens. So I would drop this pr_err. > + unregister_cca_tsm_report(NULL); > + return ret; > + } > > return ret; > }