Skip to content

Commit cb27594

Browse files
btw616jmberg-intel
authored andcommitted
um: Remove /proc/sysemu support code
Currently /proc/sysemu will never be registered, as sysemu_supported is initialized to zero implicitly and no code updates it. And there is also nothing to configure via sysemu in UML anymore. Signed-off-by: Tiwei Bie <tiwei.btw@antgroup.com> Link: https://patch.msgid.link/20240527134024.1539848-3-tiwei.btw@antgroup.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent 6fdae1d commit cb27594

1 file changed

Lines changed: 0 additions & 67 deletions

File tree

arch/um/kernel/process.c

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -237,73 +237,6 @@ int copy_from_user_proc(void *to, void __user *from, int size)
237237
return copy_from_user(to, from, size);
238238
}
239239

240-
static atomic_t using_sysemu = ATOMIC_INIT(0);
241-
int sysemu_supported;
242-
243-
static void set_using_sysemu(int value)
244-
{
245-
if (value > sysemu_supported)
246-
return;
247-
atomic_set(&using_sysemu, value);
248-
}
249-
250-
static int get_using_sysemu(void)
251-
{
252-
return atomic_read(&using_sysemu);
253-
}
254-
255-
static int sysemu_proc_show(struct seq_file *m, void *v)
256-
{
257-
seq_printf(m, "%d\n", get_using_sysemu());
258-
return 0;
259-
}
260-
261-
static int sysemu_proc_open(struct inode *inode, struct file *file)
262-
{
263-
return single_open(file, sysemu_proc_show, NULL);
264-
}
265-
266-
static ssize_t sysemu_proc_write(struct file *file, const char __user *buf,
267-
size_t count, loff_t *pos)
268-
{
269-
char tmp[2];
270-
271-
if (copy_from_user(tmp, buf, 1))
272-
return -EFAULT;
273-
274-
if (tmp[0] >= '0' && tmp[0] <= '2')
275-
set_using_sysemu(tmp[0] - '0');
276-
/* We use the first char, but pretend to write everything */
277-
return count;
278-
}
279-
280-
static const struct proc_ops sysemu_proc_ops = {
281-
.proc_open = sysemu_proc_open,
282-
.proc_read = seq_read,
283-
.proc_lseek = seq_lseek,
284-
.proc_release = single_release,
285-
.proc_write = sysemu_proc_write,
286-
};
287-
288-
static int __init make_proc_sysemu(void)
289-
{
290-
struct proc_dir_entry *ent;
291-
if (!sysemu_supported)
292-
return 0;
293-
294-
ent = proc_create("sysemu", 0600, NULL, &sysemu_proc_ops);
295-
296-
if (ent == NULL)
297-
{
298-
printk(KERN_WARNING "Failed to register /proc/sysemu\n");
299-
return 0;
300-
}
301-
302-
return 0;
303-
}
304-
305-
late_initcall(make_proc_sysemu);
306-
307240
int singlestepping(void)
308241
{
309242
return test_thread_flag(TIF_SINGLESTEP);

0 commit comments

Comments
 (0)