qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 20/22] Implement shmctl(2)


From: Richard Henderson
Subject: Re: [PATCH 20/22] Implement shmctl(2)
Date: Sat, 9 Sep 2023 10:51:55 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.0

On 9/8/23 18:59, Karim Taha wrote:
Richard Henderson <richard.henderson@linaro.org> wrote:

On 8/19/23 02:48, Karim Taha wrote:
+    switch (cmd) {
+    case IPC_STAT:
+    case IPC_SET:
+        if (target_to_host_shmid_ds(&dsarg, buff)) {
+            return -TARGET_EFAULT;
+        }
+        ret = get_errno(shmctl(shmid, cmd, &dsarg));
+        if (host_to_target_shmid_ds(buff, &dsarg)) {
+            return -TARGET_EFAULT;
+        }
+        break;

IPC_STAT treats buff as output, IPC_SET treats buff as input,
so these cases can't be combined.


r~

I think they can be combined:
1- we marshal the struct `buff` from target to host
2- call `shmctl`
3- marshal the results back.

No.  For IPC_SET, the target page need not be writable, as you assume here.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]