Skip to content

Commit 2dca89d

Browse files
committed
Merge tag 'uml-for-6.16-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/uml/linux
Pull UML fixes from Johannes Berg: - fix FP registers in seccomp mode - prevent duplicate devices in VFIO support - don't ignore errors in UBD thread start - reduce stack use with clang 19 * tag 'uml-for-6.16-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/uml/linux: um: vector: Reduce stack usage in vector_eth_configure() um: Use correct data source in fpregs_legacy_set() um: vfio: Prevent duplicate device assignments um: ubd: Add missing error check in start_io_thread()
2 parents 7595b66 + 2d65fc1 commit 2dca89d

File tree

4 files changed

+29
-31
lines changed

4 files changed

+29
-31
lines changed

arch/um/drivers/ubd_user.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ int start_io_thread(struct os_helper_thread **td_out, int *fd_out)
4141
*fd_out = fds[1];
4242

4343
err = os_set_fd_block(*fd_out, 0);
44-
err = os_set_fd_block(kernel_fd, 0);
44+
err |= os_set_fd_block(kernel_fd, 0);
4545
if (err) {
4646
printk("start_io_thread - failed to set nonblocking I/O.\n");
4747
goto out_close;

arch/um/drivers/vector_kern.c

Lines changed: 13 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1625,35 +1625,19 @@ static void vector_eth_configure(
16251625

16261626
device->dev = dev;
16271627

1628-
*vp = ((struct vector_private)
1629-
{
1630-
.list = LIST_HEAD_INIT(vp->list),
1631-
.dev = dev,
1632-
.unit = n,
1633-
.options = get_transport_options(def),
1634-
.rx_irq = 0,
1635-
.tx_irq = 0,
1636-
.parsed = def,
1637-
.max_packet = get_mtu(def) + ETH_HEADER_OTHER,
1638-
/* TODO - we need to calculate headroom so that ip header
1639-
* is 16 byte aligned all the time
1640-
*/
1641-
.headroom = get_headroom(def),
1642-
.form_header = NULL,
1643-
.verify_header = NULL,
1644-
.header_rxbuffer = NULL,
1645-
.header_txbuffer = NULL,
1646-
.header_size = 0,
1647-
.rx_header_size = 0,
1648-
.rexmit_scheduled = false,
1649-
.opened = false,
1650-
.transport_data = NULL,
1651-
.in_write_poll = false,
1652-
.coalesce = 2,
1653-
.req_size = get_req_size(def),
1654-
.in_error = false,
1655-
.bpf = NULL
1656-
});
1628+
INIT_LIST_HEAD(&vp->list);
1629+
vp->dev = dev;
1630+
vp->unit = n;
1631+
vp->options = get_transport_options(def);
1632+
vp->parsed = def;
1633+
vp->max_packet = get_mtu(def) + ETH_HEADER_OTHER;
1634+
/*
1635+
* TODO - we need to calculate headroom so that ip header
1636+
* is 16 byte aligned all the time
1637+
*/
1638+
vp->headroom = get_headroom(def);
1639+
vp->coalesce = 2;
1640+
vp->req_size = get_req_size(def);
16571641

16581642
dev->features = dev->hw_features = (NETIF_F_SG | NETIF_F_FRAGLIST);
16591643
INIT_WORK(&vp->reset_tx, vector_reset_tx);

arch/um/drivers/vfio_kern.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,17 @@ static void uml_vfio_release_device(struct uml_vfio_device *dev)
570570
kfree(dev);
571571
}
572572

573+
static struct uml_vfio_device *uml_vfio_find_device(const char *device)
574+
{
575+
struct uml_vfio_device *dev;
576+
577+
list_for_each_entry(dev, &uml_vfio_devices, list) {
578+
if (!strcmp(dev->name, device))
579+
return dev;
580+
}
581+
return NULL;
582+
}
583+
573584
static int uml_vfio_cmdline_set(const char *device, const struct kernel_param *kp)
574585
{
575586
struct uml_vfio_device *dev;
@@ -582,6 +593,9 @@ static int uml_vfio_cmdline_set(const char *device, const struct kernel_param *k
582593
uml_vfio_container.fd = fd;
583594
}
584595

596+
if (uml_vfio_find_device(device))
597+
return -EEXIST;
598+
585599
dev = kzalloc(sizeof(*dev), GFP_KERNEL);
586600
if (!dev)
587601
return -ENOMEM;

arch/x86/um/ptrace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ static int fpregs_legacy_set(struct task_struct *target,
161161
from = kbuf;
162162
}
163163

164-
return um_fxsr_from_i387(fxsave, &buf);
164+
return um_fxsr_from_i387(fxsave, from);
165165
}
166166
#endif
167167

0 commit comments

Comments
 (0)