You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "CV-Bowen (via GitHub)" <gi...@apache.org> on 2024/09/18 15:08:19 UTC
[PR] Rptun framework update and related driver update [nuttx]
CV-Bowen opened a new pull request, #13526:
URL: https://github.com/apache/nuttx/pull/13526
## Summary
commit 5b227a23bd3baff9110f18f4d0df7a521d949e2f (HEAD -> rptun-new, wbw/rptun-new)
Author: mazhuang <ma...@xiaomi.com>
Date: Tue Aug 20 16:32:38 2024 +0800
rptun/rptun_ivshmem:add restart cmd to reboot slave
Master can send restart command to slave to reboot the slave core
Signed-off-by: mazhuang <ma...@xiaomi.com>
Signed-off-by: Yongrong Wang <wa...@xiaomi.com>
commit 2e717920c90a48e1f11701506f9bb1a683b35caf
Author: xuxingliang <xu...@xiaomi.com>
Date: Fri Aug 23 19:44:11 2024 +0800
rptun: fix memleak on failure
Leak backtrace:
1 14 2096 9886 0x4318d768 [0x040320744] <romfs_fileconfigure+184> romfs/fs_romfsutil.c:1039
[0x04031fd3e] <romfs_open+378> romfs/fs_romfs.c:281
[0x04027fa9e] <file_open+446> vfs/fs_open.c:244
[0x0402ab986] <rptun_store_open+26> rptun/rptun.c:955
[0x04034cc88] <remoteproc_load+120> open-amp/lib/remoteproc/remoteproc.c:452
[0x0402ac8ac] <rptun_dev_start+176> rptun/rptun.c:748
[0x0402ad038] <rptun_ioctl+416> rptun/rptun.c:618
Signed-off-by: xuxingliang <xu...@xiaomi.com>
commit 09b4804d8c95551aa59037ecdbb68266675306d4
Author: Bowen Wang <wa...@xiaomi.com>
Date: Wed Aug 14 15:01:42 2024 +0800
:...skipping...
commit 5b227a23bd3baff9110f18f4d0df7a521d949e2f (HEAD -> rptun-new, wbw/rptun-new)
Author: mazhuang <ma...@xiaomi.com>
Date: Tue Aug 20 16:32:38 2024 +0800
rptun/rptun_ivshmem:add restart cmd to reboot slave
Master can send restart command to slave to reboot the slave core
Signed-off-by: mazhuang <ma...@xiaomi.com>
Signed-off-by: Yongrong Wang <wa...@xiaomi.com>
commit 2e717920c90a48e1f11701506f9bb1a683b35caf
Author: xuxingliang <xu...@xiaomi.com>
Date: Fri Aug 23 19:44:11 2024 +0800
rptun: fix memleak on failure
Leak backtrace:
1 14 2096 9886 0x4318d768 [0x040320744] <romfs_fileconfigure+184> romfs/fs_romfsutil.c:1039
[0x04031fd3e] <romfs_open+378> romfs/fs_romfs.c:281
[0x04027fa9e] <file_open+446> vfs/fs_open.c:244
[0x0402ab986] <rptun_store_open+26> rptun/rptun.c:955
[0x04034cc88] <remoteproc_load+120> open-amp/lib/remoteproc/remoteproc.c:452
[0x0402ac8ac] <rptun_dev_start+176> rptun/rptun.c:748
[0x0402ad038] <rptun_ioctl+416> rptun/rptun.c:618
Signed-off-by: xuxingliang <xu...@xiaomi.com>
commit 09b4804d8c95551aa59037ecdbb68266675306d4
Author: Bowen Wang <wa...@xiaomi.com>
Date: Wed Aug 14 15:01:42 2024 +0800
rptun: move rptun cmd definition before the resource table
Because locate the command at the end the resource table is unfriendly
when we want to support multi virtio devices instead only one virtio
rpmsg device.
Signed-off-by: Bowen Wang <wa...@xiaomi.com>
commit 2ec7b89977f891de6301a3f39e2a52db52d1a19f
Author: Yongrong Wang <wa...@xiaomi.com>
Date: Tue Aug 6 11:32:14 2024 +0800
rptun/rpmsg_virtio: remove chip cmd and reuse the common ones
Add more common command for rptun and rpmsg_virtio frameworks,
also modify the rptun and rpmsg_virtio driver to use the common
commands.
Signed-off-by: Yongrong Wang <wa...@xiaomi.com>
commit 11430f7411360af0aac56475b7ac438ab49709cd
Author: Yongrong Wang <wa...@xiaomi.com>
Date: Mon Aug 5 20:00:12 2024 +0800
sim_rptun.c: remove sim_rptun_panic
Because we can use the common part implemented in rptun
Signed-off-by: Yongrong Wang <wa...@xiaomi.com>
commit 9f4f470217371f84d0094e3320fc61ecd1785532
Author: Yongrong Wang <wa...@xiaomi.com>
Date: Fri Jul 26 16:57:58 2024 +0800
rptun.c/rpmsg_virtio.c: move panic logic from chip to rptun/rpmsg_virtio
Move the panic logic in common places, later we can move more logic to
the framework instead of having the drivers implement it repeatedly.
Signed-off-by: Yongrong Wang <wa...@xiaomi.com>
commit f2278f5f4addab04cefb1ff8b8035d8ded9f794f
Author: Bowen Wang <wa...@xiaomi.com>
Date: Tue Jun 11 15:53:15 2024 +0800
sim/sim_rptun: add 64-bit support for sim_rptun
add remote addrenv to make the da is start from 0, so the uint32_t
da in resource table can store the correct address
Signed-off-by: Bowen Wang <wa...@xiaomi.com>
commit 884396021c365dc16fa7fd75fcf8fbcad167595b
Author: wangyongrong <wa...@xiaomi.com>
Date: Wed May 22 16:41:21 2024 +0800
rptun_ivshmem.c: Replace work queue with wdog
wdog has better performance than work queue
Signed-off-by: wangyongrong <wa...@xiaomi.com>
commit 9d2e70ec950aae107a090f4a08c5079eca414fc2
Author: Bowen Wang <wa...@xiaomi.com>
Date: Sat Aug 3 18:27:44 2024 +0800
drivers/rptun/rptun.c: move headrx out of CONFIG_RPTUN_PM
headrx is very convient to check weather current core miss interrupt
by comparing the headrx with the rx vring avail.idx for slave side or
rx vring used.idx for master side.
So move headrx out of the CONFIG_RPTUN_PM range.
Signed-off-by: Bowen Wang <wa...@xiaomi.com>
commit 462f7d7513bff0cb06b326d25d2af5d828f29840
Author: Bowen Wang <wa...@xiaomi.com>
Date: Fri Feb 23 19:57:25 2024 +0800
rptun: rptun pm and rptun dump support cacheable memory
Should invalidate the memory when the data is located in shared
memory and write by remote core.
Signed-off-by: Bowen Wang <wa...@xiaomi.com>
commit 7aa295cd26c4a5f2cc13351d905334cd2bf62db6
Author: Xiang Xiao <xi...@xiaomi.com>
Date: Sun Feb 18 20:38:46 2024 +0800
rptun: Rename rptun_panic_ to rptun_panic
The function name rptun_panic_ is not consistent with other functions
Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
commit 218530953e8731c54607811c7cf5129d867ec7a7
Author: ligd <li...@xiaomi.com>
Date: Wed Apr 27 16:58:02 2022 +0800
rptun: add timeout to wait_tx_buffer callback
Signed-off-by: ligd <li...@xiaomi.com>
commit 62ca344eb2d11e9876b6b87bd217d6a417c576e7
Author: Bowen Wang <wa...@xiaomi.com>
Date: Wed Sep 18 17:26:16 2024 +0800
rptun/rptun_dump: remove unused rptun_dump.c
rptun_dump related code has been moved to rptun.c from rptun_dump.c,
but file rptun_dump.c is not deleted in PR:
https://github.com/apache/nuttx/pull/11712
So delete this file.
Signed-off-by: Bowen Wang <wa...@xiaomi.com>
commit e8e64e6377abfee5b8df16f76640792fe9fd0755
Author: Bowen Wang <wa...@xiaomi.com>
Date: Wed Sep 18 17:20:56 2024 +0800
rptun: BUG fix, should not destory the semaphore twice
This BUG is introduced in PR: https://github.com/apache/nuttx/pull/13172
Signed-off-by: Bowen Wang <wa...@xiaomi.com>
commit f79daeddd4fe90b689169908e9c4d1077b5e2902
Author: ligd <li...@xiaomi.com>
Date: Mon Jun 20 21:47:20 2022 +0800
rptun: use detail name for pm wakelock
So we can distinguish the pm wakelock
Signed-off-by: ligd <li...@xiaomi.com>
commit e8ad329319878c6e5ffeeba0b465ef4455c24d6c
Author: Bowen Wang <wa...@xiaomi.com>
Date: Thu Mar 28 15:16:40 2024 +0800
drivers/rptun: flush the image memory when read from the file system
Flush the image memory to make sure the remote core access the correct
image.
Signed-off-by: Bowen Wang <wa...@xiaomi.com>
commit 29c8a585777137cdcb2e025112f62aa145898255
Author: ligd <li...@xiaomi.com>
Date: Fri Apr 7 23:38:33 2023 +0800
rptun: add RPTUN_PM_AUTORELAX method.
Signed-off-by: ligd <li...@xiaomi.com>
commit afb0ea8a803f8f45abb24c325b2bc5080aa78d50
Author: ligd <li...@xiaomi.com>
Date: Thu Jun 16 20:38:51 2022 +0800
rptun/pm: use pm_wakelock
Signed-off-by: ligd <li...@xiaomi.com>
commit abe9fd4d4bb7034f94950ff837cd6d53578f54ef
Author: ligd <li...@xiaomi.com>
Date: Thu Jan 5 12:08:04 2023 +0800
rptun/pm: add check to rptun_pm_callback() incase of start early
Signed-off-by: ligd <li...@xiaomi.com>
commit 95d3611e1c70fc2ace5507884d73b0d5d605d122
Author: ligd <li...@xiaomi.com>
Date: Sat Apr 30 12:46:27 2022 +0800
rptun: use local rx virtqueue idx to resolve remote low power
Store the rx virtqueue idx to the local headrx index, and only
process the data when the rx virtqueue has data to avoid access
the ram in low power mode.
Signed-off-by: ligd <li...@xiaomi.com>
commit abd56789cccd0f8b076b54ca43a828c9779ad800
Author: yanghuatao <ya...@xiaomi.com>
Date: Thu Dec 21 21:24:41 2023 +0800
nuttx/rptun_secure: Fix warning
rptun/rptun_secure.c:127:37: warning: passing argument 2 of 'up_trigger_irq' makes integer from pointer without a cast [-Wint-conversion]
127 | up_trigger_irq(priv->irq_trigger, &cpuset);
| ^~~~~~~
| |
| volatile cpu_set_t * {aka volatile unsigned char *}
Signed-off-by: yanghuatao <ya...@xiaomi.com>
commit dab9e6664395ae7d332f6abb5e0eb0649f0ef4dd
Author: yanghuatao <ya...@xiaomi.com>
Date: Thu Aug 10 16:06:57 2023 +0800
nuttx/dirvers: Add secure rptun file
rptun secure is a rptun driver used for the rpmsg communication
between REE and TEE.
Signed-off-by: yanghuatao <ya...@xiaomi.com>
## Impact
rptun
## Testing
sim:rpserver, rpproxy and qemu
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Rptun framework update and related driver update [nuttx]
Posted by "CV-Bowen (via GitHub)" <gi...@apache.org>.
CV-Bowen commented on code in PR #13526:
URL: https://github.com/apache/nuttx/pull/13526#discussion_r1772495368
##########
drivers/rptun/Kconfig:
##########
@@ -12,6 +12,12 @@ menuconfig RPTUN
if RPTUN
+config RPTUN_SECURE
+ bool "rptun secure support"
+ default n
+ ---help---
+ This is for secure rptun support.
Review Comment:
Done
##########
drivers/rptun/rptun.c:
##########
@@ -280,6 +370,30 @@ static bool rptun_is_recursive(FAR struct rptun_priv_s *priv)
return nxsched_gettid() == priv->tid;
}
+static void rptun_command(struct rptun_priv_s *priv)
+{
+ FAR struct rptun_cmd_s *rptun_cmd = RPTUN_RSC2CMD(priv->rproc.rsc_table);
+ uint32_t cmd;
+
+ if (RPTUN_IS_MASTER(priv->dev))
+ {
+ cmd = rptun_cmd->cmd_slave;
+ rptun_cmd->cmd_slave = 0;
+ }
+ else
+ {
+ cmd = rptun_cmd->cmd_master;
+ rptun_cmd->cmd_master = 0;
+ }
+
+ switch (RPTUN_GET_CMD(cmd))
+ {
+ case RPTUN_CMD_PANIC:
+ PANIC();
+ break;
Review Comment:
Done
##########
drivers/rptun/rptun_secure.c:
##########
@@ -0,0 +1,221 @@
+/****************************************************************************
+ * drivers/rptun/rptun_secure.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership. The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/rptun/rptun.h>
+#include <nuttx/rptun/rptun_secure.h>
+#include <nuttx/sched.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+struct rptun_secure_dev_s
+{
+ struct rptun_dev_s rptun;
+ rptun_callback_t callback;
+ FAR void *arg;
+ bool master;
+ FAR struct rptun_rsc_s *rsc;
+ char cpuname[RPMSG_NAME_SIZE + 1];
+ int irq_event;
+ int irq_trigger;
+};
+
+/****************************************************************************
+ * Private Function Prototypes
+ ****************************************************************************/
+
+static const char *rptun_secure_get_cpuname(FAR struct rptun_dev_s *dev);
+static struct
+rptun_rsc_s *rptun_secure_get_resource(FAR struct rptun_dev_s *dev);
Review Comment:
Done
##########
drivers/rptun/rptun_secure.c:
##########
@@ -0,0 +1,221 @@
+/****************************************************************************
+ * drivers/rptun/rptun_secure.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership. The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/rptun/rptun.h>
+#include <nuttx/rptun/rptun_secure.h>
+#include <nuttx/sched.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+struct rptun_secure_dev_s
+{
+ struct rptun_dev_s rptun;
+ rptun_callback_t callback;
+ FAR void *arg;
+ bool master;
+ FAR struct rptun_rsc_s *rsc;
+ char cpuname[RPMSG_NAME_SIZE + 1];
+ int irq_event;
+ int irq_trigger;
+};
+
+/****************************************************************************
+ * Private Function Prototypes
+ ****************************************************************************/
+
+static const char *rptun_secure_get_cpuname(FAR struct rptun_dev_s *dev);
Review Comment:
Done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Rptun framework update and related driver update [nuttx]
Posted by "CV-Bowen (via GitHub)" <gi...@apache.org>.
CV-Bowen commented on code in PR #13526:
URL: https://github.com/apache/nuttx/pull/13526#discussion_r1772495462
##########
drivers/rptun/rptun_secure.c:
##########
@@ -0,0 +1,221 @@
+/****************************************************************************
+ * drivers/rptun/rptun_secure.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership. The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/rptun/rptun.h>
+#include <nuttx/rptun/rptun_secure.h>
+#include <nuttx/sched.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+struct rptun_secure_dev_s
+{
+ struct rptun_dev_s rptun;
+ rptun_callback_t callback;
+ FAR void *arg;
+ bool master;
+ FAR struct rptun_rsc_s *rsc;
+ char cpuname[RPMSG_NAME_SIZE + 1];
+ int irq_event;
+ int irq_trigger;
+};
+
+/****************************************************************************
+ * Private Function Prototypes
+ ****************************************************************************/
+
+static const char *rptun_secure_get_cpuname(FAR struct rptun_dev_s *dev);
+static struct
+rptun_rsc_s *rptun_secure_get_resource(FAR struct rptun_dev_s *dev);
+static bool rptun_secure_is_autostart(FAR struct rptun_dev_s *dev);
+static bool rptun_secure_is_master(FAR struct rptun_dev_s *dev);
+static int rptun_secure_start(FAR struct rptun_dev_s *dev);
+static int rptun_secure_stop(FAR struct rptun_dev_s *dev);
+static int rptun_secure_notify(FAR struct rptun_dev_s *dev,
+ uint32_t notifyid);
+static int rptun_secure_register_callback(FAR struct rptun_dev_s *dev,
+ rptun_callback_t callback,
+ FAR void *arg);
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+static const struct rptun_ops_s g_rptun_secure_ops =
+{
+ .get_cpuname = rptun_secure_get_cpuname,
+ .get_resource = rptun_secure_get_resource,
+ .is_autostart = rptun_secure_is_autostart,
+ .is_master = rptun_secure_is_master,
+ .start = rptun_secure_start,
+ .stop = rptun_secure_stop,
+ .notify = rptun_secure_notify,
+ .register_callback = rptun_secure_register_callback,
+};
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+static const char *rptun_secure_get_cpuname(FAR struct rptun_dev_s *dev)
Review Comment:
Done
##########
drivers/rptun/rptun_secure.c:
##########
@@ -0,0 +1,221 @@
+/****************************************************************************
+ * drivers/rptun/rptun_secure.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership. The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/rptun/rptun.h>
+#include <nuttx/rptun/rptun_secure.h>
+#include <nuttx/sched.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+struct rptun_secure_dev_s
+{
+ struct rptun_dev_s rptun;
+ rptun_callback_t callback;
+ FAR void *arg;
+ bool master;
+ FAR struct rptun_rsc_s *rsc;
+ char cpuname[RPMSG_NAME_SIZE + 1];
+ int irq_event;
+ int irq_trigger;
+};
+
+/****************************************************************************
+ * Private Function Prototypes
+ ****************************************************************************/
+
+static const char *rptun_secure_get_cpuname(FAR struct rptun_dev_s *dev);
+static struct
+rptun_rsc_s *rptun_secure_get_resource(FAR struct rptun_dev_s *dev);
+static bool rptun_secure_is_autostart(FAR struct rptun_dev_s *dev);
+static bool rptun_secure_is_master(FAR struct rptun_dev_s *dev);
+static int rptun_secure_start(FAR struct rptun_dev_s *dev);
+static int rptun_secure_stop(FAR struct rptun_dev_s *dev);
+static int rptun_secure_notify(FAR struct rptun_dev_s *dev,
+ uint32_t notifyid);
+static int rptun_secure_register_callback(FAR struct rptun_dev_s *dev,
+ rptun_callback_t callback,
+ FAR void *arg);
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+static const struct rptun_ops_s g_rptun_secure_ops =
+{
+ .get_cpuname = rptun_secure_get_cpuname,
+ .get_resource = rptun_secure_get_resource,
+ .is_autostart = rptun_secure_is_autostart,
+ .is_master = rptun_secure_is_master,
+ .start = rptun_secure_start,
+ .stop = rptun_secure_stop,
+ .notify = rptun_secure_notify,
+ .register_callback = rptun_secure_register_callback,
+};
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+static const char *rptun_secure_get_cpuname(FAR struct rptun_dev_s *dev)
+{
+ FAR struct rptun_secure_dev_s *priv = (FAR struct rptun_secure_dev_s *)dev;
+ return priv->cpuname;
+}
+
+static struct rptun_rsc_s *
Review Comment:
Done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Rptun framework update and related driver update [nuttx]
Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on code in PR #13526:
URL: https://github.com/apache/nuttx/pull/13526#discussion_r1765601177
##########
drivers/rptun/Kconfig:
##########
@@ -12,6 +12,12 @@ menuconfig RPTUN
if RPTUN
+config RPTUN_SECURE
+ bool "rptun secure support"
+ default n
+ ---help---
+ This is for secure rptun support.
Review Comment:
Please include more information here. Why is it considered secure? What is main differences?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Rptun framework update and related driver update [nuttx]
Posted by "lupyuen (via GitHub)" <gi...@apache.org>.
lupyuen commented on PR #13526:
URL: https://github.com/apache/nuttx/pull/13526#issuecomment-2358799404
[**\[Experimental Bot, please feedback here\]**](https://github.com/search?q=repo%3Aapache%2Fnuttx+13494&type=pullrequests)
## NuttX PR Requirements Review
This PR appears to bundle multiple changes related to the `rptun` driver, including bug fixes, feature additions, and refactoring. While the individual commit messages provide some details, the overall PR lacks a cohesive summary and impact analysis.
**Summary:**
* **Why:** The PR description should clearly state the overall motivation and goals for the collection of changes.
* **What:** A high-level overview of the functional areas impacted by the changes (e.g., data types, commands, memory management, etc.) is missing.
* **How:** The PR description should briefly explain how these changes are implemented.
**Impact:**
* The "Impact" section is overly brief. Each bullet point should elaborate on how the changes affect the specified area. For instance:
* **Is new feature added?** Yes, the PR introduces a "restart" command and support for 64-bit in `sim_rptun`. A description of these features is needed.
* **Impact on user?** The PR mentions "Master can send restart command to slave." This needs further explanation on how a user would utilize this command and any potential adaptations required.
* **Impact on build?** If there are no build process changes, state it explicitly. If there are, provide details.
* **Impact on hardware?** The testing section lists "sim:rpserver, rpproxy and qemu." Specify the affected architectures and boards.
* **Impact on documentation?** Clarify if documentation updates are needed and if they are included in the PR.
* **Impact on security?** The PR introduces a `rptun_secure` file. Explain the security implications and any potential risks or mitigations.
* **Impact on compatibility?** Are there any backward or forward compatibility concerns introduced by the changes?
**Testing:**
* The provided testing logs are placeholders. Include actual logs demonstrating the functionality before and after the changes.
* The testing section should be more comprehensive, covering each significant change in the PR.
**Overall:**
This PR requires significant improvements to meet the NuttX requirements. Provide a clear and detailed summary, elaborate on the impact of each change, and include actual testing logs to ensure the changes are thoroughly validated.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Rptun framework update and related driver update [nuttx]
Posted by "pkarashchenko (via GitHub)" <gi...@apache.org>.
pkarashchenko commented on code in PR #13526:
URL: https://github.com/apache/nuttx/pull/13526#discussion_r1765903410
##########
drivers/rptun/rptun.c:
##########
@@ -280,6 +370,30 @@ static bool rptun_is_recursive(FAR struct rptun_priv_s *priv)
return nxsched_gettid() == priv->tid;
}
+static void rptun_command(struct rptun_priv_s *priv)
+{
+ FAR struct rptun_cmd_s *rptun_cmd = RPTUN_RSC2CMD(priv->rproc.rsc_table);
+ uint32_t cmd;
+
+ if (RPTUN_IS_MASTER(priv->dev))
+ {
+ cmd = rptun_cmd->cmd_slave;
+ rptun_cmd->cmd_slave = 0;
+ }
+ else
+ {
+ cmd = rptun_cmd->cmd_master;
+ rptun_cmd->cmd_master = 0;
+ }
+
+ switch (RPTUN_GET_CMD(cmd))
+ {
+ case RPTUN_CMD_PANIC:
+ PANIC();
+ break;
Review Comment:
Good to add explicit `default` case or change to `if`
##########
drivers/rptun/rptun_secure.c:
##########
@@ -0,0 +1,221 @@
+/****************************************************************************
+ * drivers/rptun/rptun_secure.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership. The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/rptun/rptun.h>
+#include <nuttx/rptun/rptun_secure.h>
+#include <nuttx/sched.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+struct rptun_secure_dev_s
+{
+ struct rptun_dev_s rptun;
+ rptun_callback_t callback;
+ FAR void *arg;
+ bool master;
+ FAR struct rptun_rsc_s *rsc;
+ char cpuname[RPMSG_NAME_SIZE + 1];
+ int irq_event;
+ int irq_trigger;
+};
+
+/****************************************************************************
+ * Private Function Prototypes
+ ****************************************************************************/
+
+static const char *rptun_secure_get_cpuname(FAR struct rptun_dev_s *dev);
+static struct
+rptun_rsc_s *rptun_secure_get_resource(FAR struct rptun_dev_s *dev);
+static bool rptun_secure_is_autostart(FAR struct rptun_dev_s *dev);
+static bool rptun_secure_is_master(FAR struct rptun_dev_s *dev);
+static int rptun_secure_start(FAR struct rptun_dev_s *dev);
+static int rptun_secure_stop(FAR struct rptun_dev_s *dev);
+static int rptun_secure_notify(FAR struct rptun_dev_s *dev,
+ uint32_t notifyid);
+static int rptun_secure_register_callback(FAR struct rptun_dev_s *dev,
+ rptun_callback_t callback,
+ FAR void *arg);
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+static const struct rptun_ops_s g_rptun_secure_ops =
+{
+ .get_cpuname = rptun_secure_get_cpuname,
+ .get_resource = rptun_secure_get_resource,
+ .is_autostart = rptun_secure_is_autostart,
+ .is_master = rptun_secure_is_master,
+ .start = rptun_secure_start,
+ .stop = rptun_secure_stop,
+ .notify = rptun_secure_notify,
+ .register_callback = rptun_secure_register_callback,
+};
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+static const char *rptun_secure_get_cpuname(FAR struct rptun_dev_s *dev)
+{
+ FAR struct rptun_secure_dev_s *priv = (FAR struct rptun_secure_dev_s *)dev;
+ return priv->cpuname;
+}
+
+static struct rptun_rsc_s *
Review Comment:
```suggestion
static FAR struct rptun_rsc_s *
```
##########
drivers/rptun/rptun_secure.c:
##########
@@ -0,0 +1,221 @@
+/****************************************************************************
+ * drivers/rptun/rptun_secure.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership. The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/rptun/rptun.h>
+#include <nuttx/rptun/rptun_secure.h>
+#include <nuttx/sched.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+struct rptun_secure_dev_s
+{
+ struct rptun_dev_s rptun;
+ rptun_callback_t callback;
+ FAR void *arg;
+ bool master;
+ FAR struct rptun_rsc_s *rsc;
+ char cpuname[RPMSG_NAME_SIZE + 1];
+ int irq_event;
+ int irq_trigger;
+};
+
+/****************************************************************************
+ * Private Function Prototypes
+ ****************************************************************************/
+
+static const char *rptun_secure_get_cpuname(FAR struct rptun_dev_s *dev);
+static struct
+rptun_rsc_s *rptun_secure_get_resource(FAR struct rptun_dev_s *dev);
+static bool rptun_secure_is_autostart(FAR struct rptun_dev_s *dev);
+static bool rptun_secure_is_master(FAR struct rptun_dev_s *dev);
+static int rptun_secure_start(FAR struct rptun_dev_s *dev);
+static int rptun_secure_stop(FAR struct rptun_dev_s *dev);
+static int rptun_secure_notify(FAR struct rptun_dev_s *dev,
+ uint32_t notifyid);
+static int rptun_secure_register_callback(FAR struct rptun_dev_s *dev,
+ rptun_callback_t callback,
+ FAR void *arg);
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+static const struct rptun_ops_s g_rptun_secure_ops =
+{
+ .get_cpuname = rptun_secure_get_cpuname,
+ .get_resource = rptun_secure_get_resource,
+ .is_autostart = rptun_secure_is_autostart,
+ .is_master = rptun_secure_is_master,
+ .start = rptun_secure_start,
+ .stop = rptun_secure_stop,
+ .notify = rptun_secure_notify,
+ .register_callback = rptun_secure_register_callback,
+};
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+static const char *rptun_secure_get_cpuname(FAR struct rptun_dev_s *dev)
Review Comment:
```suggestion
static FAR const char *rptun_secure_get_cpuname(FAR struct rptun_dev_s *dev)
```
##########
drivers/rptun/rptun.c:
##########
@@ -280,6 +370,30 @@ static bool rptun_is_recursive(FAR struct rptun_priv_s *priv)
return nxsched_gettid() == priv->tid;
}
+static void rptun_command(struct rptun_priv_s *priv)
Review Comment:
```suggestion
static void rptun_command(FAR struct rptun_priv_s *priv)
```
##########
drivers/rptun/rptun_secure.c:
##########
@@ -0,0 +1,221 @@
+/****************************************************************************
+ * drivers/rptun/rptun_secure.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership. The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/rptun/rptun.h>
+#include <nuttx/rptun/rptun_secure.h>
+#include <nuttx/sched.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+struct rptun_secure_dev_s
+{
+ struct rptun_dev_s rptun;
+ rptun_callback_t callback;
+ FAR void *arg;
+ bool master;
+ FAR struct rptun_rsc_s *rsc;
+ char cpuname[RPMSG_NAME_SIZE + 1];
+ int irq_event;
+ int irq_trigger;
+};
+
+/****************************************************************************
+ * Private Function Prototypes
+ ****************************************************************************/
+
+static const char *rptun_secure_get_cpuname(FAR struct rptun_dev_s *dev);
+static struct
+rptun_rsc_s *rptun_secure_get_resource(FAR struct rptun_dev_s *dev);
Review Comment:
```suggestion
FAR rptun_rsc_s *rptun_secure_get_resource(FAR struct rptun_dev_s *dev);
```
##########
drivers/rptun/rptun_secure.c:
##########
@@ -0,0 +1,221 @@
+/****************************************************************************
+ * drivers/rptun/rptun_secure.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership. The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/rptun/rptun.h>
+#include <nuttx/rptun/rptun_secure.h>
+#include <nuttx/sched.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+struct rptun_secure_dev_s
+{
+ struct rptun_dev_s rptun;
+ rptun_callback_t callback;
+ FAR void *arg;
+ bool master;
+ FAR struct rptun_rsc_s *rsc;
+ char cpuname[RPMSG_NAME_SIZE + 1];
+ int irq_event;
+ int irq_trigger;
+};
+
+/****************************************************************************
+ * Private Function Prototypes
+ ****************************************************************************/
+
+static const char *rptun_secure_get_cpuname(FAR struct rptun_dev_s *dev);
Review Comment:
```suggestion
static FAR const char *rptun_secure_get_cpuname(FAR struct rptun_dev_s *dev);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Rptun framework update and related driver update [nuttx]
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 merged PR #13526:
URL: https://github.com/apache/nuttx/pull/13526
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org