Import of kernel-6.12.0-55.28.1.el10_0
This commit is contained in:
parent
f39292704a
commit
2f9174b65f
@ -12,7 +12,7 @@ RHEL_MINOR = 0
|
|||||||
#
|
#
|
||||||
# Use this spot to avoid future merge conflicts.
|
# Use this spot to avoid future merge conflicts.
|
||||||
# Do not trim this comment.
|
# Do not trim this comment.
|
||||||
RHEL_RELEASE = 55.27.1
|
RHEL_RELEASE = 55.28.1
|
||||||
|
|
||||||
#
|
#
|
||||||
# RHEL_REBASE_NUM
|
# RHEL_REBASE_NUM
|
||||||
|
@ -464,7 +464,43 @@ static vm_fault_t vas_mmap_fault(struct vm_fault *vmf)
|
|||||||
return VM_FAULT_SIGBUS;
|
return VM_FAULT_SIGBUS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* During mmap() paste address, mapping VMA is saved in VAS window
|
||||||
|
* struct which is used to unmap during migration if the window is
|
||||||
|
* still open. But the user space can remove this mapping with
|
||||||
|
* munmap() before closing the window and the VMA address will
|
||||||
|
* be invalid. Set VAS window VMA to NULL in this function which
|
||||||
|
* is called before VMA free.
|
||||||
|
*/
|
||||||
|
static void vas_mmap_close(struct vm_area_struct *vma)
|
||||||
|
{
|
||||||
|
struct file *fp = vma->vm_file;
|
||||||
|
struct coproc_instance *cp_inst = fp->private_data;
|
||||||
|
struct vas_window *txwin;
|
||||||
|
|
||||||
|
/* Should not happen */
|
||||||
|
if (!cp_inst || !cp_inst->txwin) {
|
||||||
|
pr_err("No attached VAS window for the paste address mmap\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
txwin = cp_inst->txwin;
|
||||||
|
/*
|
||||||
|
* task_ref.vma is set in coproc_mmap() during mmap paste
|
||||||
|
* address. So it has to be the same VMA that is getting freed.
|
||||||
|
*/
|
||||||
|
if (WARN_ON(txwin->task_ref.vma != vma)) {
|
||||||
|
pr_err("Invalid paste address mmaping\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
mutex_lock(&txwin->task_ref.mmap_mutex);
|
||||||
|
txwin->task_ref.vma = NULL;
|
||||||
|
mutex_unlock(&txwin->task_ref.mmap_mutex);
|
||||||
|
}
|
||||||
|
|
||||||
static const struct vm_operations_struct vas_vm_ops = {
|
static const struct vm_operations_struct vas_vm_ops = {
|
||||||
|
.close = vas_mmap_close,
|
||||||
.fault = vas_mmap_fault,
|
.fault = vas_mmap_fault,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -555,6 +555,16 @@ static void __init alloc_masks(struct sysinfo_15_1_x *info,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int __init detect_polarization(union topology_entry *tle)
|
||||||
|
{
|
||||||
|
struct topology_core *tl_core;
|
||||||
|
|
||||||
|
while (tle->nl)
|
||||||
|
tle = next_tle(tle);
|
||||||
|
tl_core = (struct topology_core *)tle;
|
||||||
|
return tl_core->pp != POLARIZATION_HRZ;
|
||||||
|
}
|
||||||
|
|
||||||
void __init topology_init_early(void)
|
void __init topology_init_early(void)
|
||||||
{
|
{
|
||||||
struct sysinfo_15_1_x *info;
|
struct sysinfo_15_1_x *info;
|
||||||
@ -574,6 +584,7 @@ void __init topology_init_early(void)
|
|||||||
__func__, PAGE_SIZE, PAGE_SIZE);
|
__func__, PAGE_SIZE, PAGE_SIZE);
|
||||||
info = tl_info;
|
info = tl_info;
|
||||||
store_topology(info);
|
store_topology(info);
|
||||||
|
cpu_management = detect_polarization(info->tle);
|
||||||
pr_info("The CPU configuration topology of the machine is: %d %d %d %d %d %d / %d\n",
|
pr_info("The CPU configuration topology of the machine is: %d %d %d %d %d %d / %d\n",
|
||||||
info->mag[0], info->mag[1], info->mag[2], info->mag[3],
|
info->mag[0], info->mag[1], info->mag[2], info->mag[3],
|
||||||
info->mag[4], info->mag[5], info->mnest);
|
info->mag[4], info->mag[5], info->mnest);
|
||||||
|
@ -44,6 +44,7 @@
|
|||||||
/* list of all detected zpci devices */
|
/* list of all detected zpci devices */
|
||||||
static LIST_HEAD(zpci_list);
|
static LIST_HEAD(zpci_list);
|
||||||
static DEFINE_SPINLOCK(zpci_list_lock);
|
static DEFINE_SPINLOCK(zpci_list_lock);
|
||||||
|
static DEFINE_MUTEX(zpci_add_remove_lock);
|
||||||
|
|
||||||
static DECLARE_BITMAP(zpci_domain, ZPCI_DOMAIN_BITMAP_SIZE);
|
static DECLARE_BITMAP(zpci_domain, ZPCI_DOMAIN_BITMAP_SIZE);
|
||||||
static DEFINE_SPINLOCK(zpci_domain_lock);
|
static DEFINE_SPINLOCK(zpci_domain_lock);
|
||||||
@ -69,6 +70,15 @@ EXPORT_SYMBOL_GPL(zpci_aipb);
|
|||||||
struct airq_iv *zpci_aif_sbv;
|
struct airq_iv *zpci_aif_sbv;
|
||||||
EXPORT_SYMBOL_GPL(zpci_aif_sbv);
|
EXPORT_SYMBOL_GPL(zpci_aif_sbv);
|
||||||
|
|
||||||
|
void zpci_zdev_put(struct zpci_dev *zdev)
|
||||||
|
{
|
||||||
|
if (!zdev)
|
||||||
|
return;
|
||||||
|
mutex_lock(&zpci_add_remove_lock);
|
||||||
|
kref_put_lock(&zdev->kref, zpci_release_device, &zpci_list_lock);
|
||||||
|
mutex_unlock(&zpci_add_remove_lock);
|
||||||
|
}
|
||||||
|
|
||||||
struct zpci_dev *get_zdev_by_fid(u32 fid)
|
struct zpci_dev *get_zdev_by_fid(u32 fid)
|
||||||
{
|
{
|
||||||
struct zpci_dev *tmp, *zdev = NULL;
|
struct zpci_dev *tmp, *zdev = NULL;
|
||||||
@ -831,6 +841,7 @@ int zpci_add_device(struct zpci_dev *zdev)
|
|||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
mutex_lock(&zpci_add_remove_lock);
|
||||||
zpci_dbg(1, "add fid:%x, fh:%x, c:%d\n", zdev->fid, zdev->fh, zdev->state);
|
zpci_dbg(1, "add fid:%x, fh:%x, c:%d\n", zdev->fid, zdev->fh, zdev->state);
|
||||||
rc = zpci_init_iommu(zdev);
|
rc = zpci_init_iommu(zdev);
|
||||||
if (rc)
|
if (rc)
|
||||||
@ -844,12 +855,14 @@ int zpci_add_device(struct zpci_dev *zdev)
|
|||||||
spin_lock(&zpci_list_lock);
|
spin_lock(&zpci_list_lock);
|
||||||
list_add_tail(&zdev->entry, &zpci_list);
|
list_add_tail(&zdev->entry, &zpci_list);
|
||||||
spin_unlock(&zpci_list_lock);
|
spin_unlock(&zpci_list_lock);
|
||||||
|
mutex_unlock(&zpci_add_remove_lock);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error_destroy_iommu:
|
error_destroy_iommu:
|
||||||
zpci_destroy_iommu(zdev);
|
zpci_destroy_iommu(zdev);
|
||||||
error:
|
error:
|
||||||
zpci_dbg(0, "add fid:%x, rc:%d\n", zdev->fid, rc);
|
zpci_dbg(0, "add fid:%x, rc:%d\n", zdev->fid, rc);
|
||||||
|
mutex_unlock(&zpci_add_remove_lock);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -919,60 +932,44 @@ int zpci_deconfigure_device(struct zpci_dev *zdev)
|
|||||||
* @zdev: the zpci_dev that was reserved
|
* @zdev: the zpci_dev that was reserved
|
||||||
*
|
*
|
||||||
* Handle the case that a given zPCI function was reserved by another system.
|
* Handle the case that a given zPCI function was reserved by another system.
|
||||||
* After a call to this function the zpci_dev can not be found via
|
|
||||||
* get_zdev_by_fid() anymore but may still be accessible via existing
|
|
||||||
* references though it will not be functional anymore.
|
|
||||||
*/
|
*/
|
||||||
void zpci_device_reserved(struct zpci_dev *zdev)
|
void zpci_device_reserved(struct zpci_dev *zdev)
|
||||||
{
|
{
|
||||||
/*
|
lockdep_assert_held(&zdev->state_lock);
|
||||||
* Remove device from zpci_list as it is going away. This also
|
/* We may declare the device reserved multiple times */
|
||||||
* makes sure we ignore subsequent zPCI events for this device.
|
if (zdev->state == ZPCI_FN_STATE_RESERVED)
|
||||||
*/
|
return;
|
||||||
spin_lock(&zpci_list_lock);
|
|
||||||
list_del(&zdev->entry);
|
|
||||||
spin_unlock(&zpci_list_lock);
|
|
||||||
zdev->state = ZPCI_FN_STATE_RESERVED;
|
zdev->state = ZPCI_FN_STATE_RESERVED;
|
||||||
zpci_dbg(3, "rsv fid:%x\n", zdev->fid);
|
zpci_dbg(3, "rsv fid:%x\n", zdev->fid);
|
||||||
|
/*
|
||||||
|
* The underlying device is gone. Allow the zdev to be freed
|
||||||
|
* as soon as all other references are gone by accounting for
|
||||||
|
* the removal as a dropped reference.
|
||||||
|
*/
|
||||||
zpci_zdev_put(zdev);
|
zpci_zdev_put(zdev);
|
||||||
}
|
}
|
||||||
|
|
||||||
void zpci_release_device(struct kref *kref)
|
void zpci_release_device(struct kref *kref)
|
||||||
{
|
{
|
||||||
struct zpci_dev *zdev = container_of(kref, struct zpci_dev, kref);
|
struct zpci_dev *zdev = container_of(kref, struct zpci_dev, kref);
|
||||||
int ret;
|
|
||||||
|
|
||||||
if (zdev->has_hp_slot)
|
lockdep_assert_held(&zpci_add_remove_lock);
|
||||||
zpci_exit_slot(zdev);
|
WARN_ON(zdev->state != ZPCI_FN_STATE_RESERVED);
|
||||||
|
/*
|
||||||
if (zdev->zbus->bus)
|
* We already hold zpci_list_lock thanks to kref_put_lock().
|
||||||
zpci_bus_remove_device(zdev, false);
|
* This makes sure no new reference can be taken from the list.
|
||||||
|
*/
|
||||||
if (zdev_enabled(zdev))
|
|
||||||
zpci_disable_device(zdev);
|
|
||||||
|
|
||||||
switch (zdev->state) {
|
|
||||||
case ZPCI_FN_STATE_CONFIGURED:
|
|
||||||
ret = sclp_pci_deconfigure(zdev->fid);
|
|
||||||
zpci_dbg(3, "deconf fid:%x, rc:%d\n", zdev->fid, ret);
|
|
||||||
fallthrough;
|
|
||||||
case ZPCI_FN_STATE_STANDBY:
|
|
||||||
if (zdev->has_hp_slot)
|
|
||||||
zpci_exit_slot(zdev);
|
|
||||||
spin_lock(&zpci_list_lock);
|
|
||||||
list_del(&zdev->entry);
|
list_del(&zdev->entry);
|
||||||
spin_unlock(&zpci_list_lock);
|
spin_unlock(&zpci_list_lock);
|
||||||
zpci_dbg(3, "rsv fid:%x\n", zdev->fid);
|
|
||||||
fallthrough;
|
if (zdev->has_hp_slot)
|
||||||
case ZPCI_FN_STATE_RESERVED:
|
zpci_exit_slot(zdev);
|
||||||
|
|
||||||
if (zdev->has_resources)
|
if (zdev->has_resources)
|
||||||
zpci_cleanup_bus_resources(zdev);
|
zpci_cleanup_bus_resources(zdev);
|
||||||
|
|
||||||
zpci_bus_device_unregister(zdev);
|
zpci_bus_device_unregister(zdev);
|
||||||
zpci_destroy_iommu(zdev);
|
zpci_destroy_iommu(zdev);
|
||||||
fallthrough;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
zpci_dbg(3, "rem fid:%x\n", zdev->fid);
|
zpci_dbg(3, "rem fid:%x\n", zdev->fid);
|
||||||
kfree_rcu(zdev, rcu);
|
kfree_rcu(zdev, rcu);
|
||||||
}
|
}
|
||||||
|
@ -17,11 +17,8 @@ int zpci_bus_scan_device(struct zpci_dev *zdev);
|
|||||||
void zpci_bus_remove_device(struct zpci_dev *zdev, bool set_error);
|
void zpci_bus_remove_device(struct zpci_dev *zdev, bool set_error);
|
||||||
|
|
||||||
void zpci_release_device(struct kref *kref);
|
void zpci_release_device(struct kref *kref);
|
||||||
static inline void zpci_zdev_put(struct zpci_dev *zdev)
|
|
||||||
{
|
void zpci_zdev_put(struct zpci_dev *zdev);
|
||||||
if (zdev)
|
|
||||||
kref_put(&zdev->kref, zpci_release_device);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void zpci_zdev_get(struct zpci_dev *zdev)
|
static inline void zpci_zdev_get(struct zpci_dev *zdev)
|
||||||
{
|
{
|
||||||
|
@ -423,6 +423,8 @@ static void __clp_add(struct clp_fh_list_entry *entry, void *data)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
zdev = zpci_create_device(entry->fid, entry->fh, entry->config_state);
|
zdev = zpci_create_device(entry->fid, entry->fh, entry->config_state);
|
||||||
|
if (IS_ERR(zdev))
|
||||||
|
return;
|
||||||
list_add_tail(&zdev->entry, scan_list);
|
list_add_tail(&zdev->entry, scan_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -335,6 +335,22 @@ static void zpci_event_hard_deconfigured(struct zpci_dev *zdev, u32 fh)
|
|||||||
zdev->state = ZPCI_FN_STATE_STANDBY;
|
zdev->state = ZPCI_FN_STATE_STANDBY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void zpci_event_reappear(struct zpci_dev *zdev)
|
||||||
|
{
|
||||||
|
lockdep_assert_held(&zdev->state_lock);
|
||||||
|
/*
|
||||||
|
* The zdev is in the reserved state. This means that it was presumed to
|
||||||
|
* go away but there are still undropped references. Now, the platform
|
||||||
|
* announced its availability again. Bring back the lingering zdev
|
||||||
|
* to standby. This is safe because we hold a temporary reference
|
||||||
|
* now so that it won't go away. Account for the re-appearance of the
|
||||||
|
* underlying device by incrementing the reference count.
|
||||||
|
*/
|
||||||
|
zdev->state = ZPCI_FN_STATE_STANDBY;
|
||||||
|
zpci_zdev_get(zdev);
|
||||||
|
zpci_dbg(1, "rea fid:%x, fh:%x\n", zdev->fid, zdev->fh);
|
||||||
|
}
|
||||||
|
|
||||||
static void __zpci_event_availability(struct zpci_ccdf_avail *ccdf)
|
static void __zpci_event_availability(struct zpci_ccdf_avail *ccdf)
|
||||||
{
|
{
|
||||||
struct zpci_dev *zdev = get_zdev_by_fid(ccdf->fid);
|
struct zpci_dev *zdev = get_zdev_by_fid(ccdf->fid);
|
||||||
@ -358,8 +374,10 @@ static void __zpci_event_availability(struct zpci_ccdf_avail *ccdf)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if (zdev->state == ZPCI_FN_STATE_RESERVED)
|
||||||
|
zpci_event_reappear(zdev);
|
||||||
/* the configuration request may be stale */
|
/* the configuration request may be stale */
|
||||||
if (zdev->state != ZPCI_FN_STATE_STANDBY)
|
else if (zdev->state != ZPCI_FN_STATE_STANDBY)
|
||||||
break;
|
break;
|
||||||
zdev->state = ZPCI_FN_STATE_CONFIGURED;
|
zdev->state = ZPCI_FN_STATE_CONFIGURED;
|
||||||
}
|
}
|
||||||
@ -375,6 +393,8 @@ static void __zpci_event_availability(struct zpci_ccdf_avail *ccdf)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if (zdev->state == ZPCI_FN_STATE_RESERVED)
|
||||||
|
zpci_event_reappear(zdev);
|
||||||
zpci_update_fh(zdev, ccdf->fh);
|
zpci_update_fh(zdev, ccdf->fh);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -345,6 +345,7 @@ static int amd_i2c_dw_xfer_quirk(struct i2c_adapter *adap, struct i2c_msg *msgs,
|
|||||||
|
|
||||||
dev->msgs = msgs;
|
dev->msgs = msgs;
|
||||||
dev->msgs_num = num_msgs;
|
dev->msgs_num = num_msgs;
|
||||||
|
dev->msg_write_idx = 0;
|
||||||
i2c_dw_xfer_init(dev);
|
i2c_dw_xfer_init(dev);
|
||||||
|
|
||||||
/* Initiate messages read/write transaction */
|
/* Initiate messages read/write transaction */
|
||||||
|
@ -59,16 +59,15 @@ static int disable_slot(struct hotplug_slot *hotplug_slot)
|
|||||||
|
|
||||||
pdev = pci_get_slot(zdev->zbus->bus, zdev->devfn);
|
pdev = pci_get_slot(zdev->zbus->bus, zdev->devfn);
|
||||||
if (pdev && pci_num_vf(pdev)) {
|
if (pdev && pci_num_vf(pdev)) {
|
||||||
pci_dev_put(pdev);
|
|
||||||
rc = -EBUSY;
|
rc = -EBUSY;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = zpci_deconfigure_device(zdev);
|
rc = zpci_deconfigure_device(zdev);
|
||||||
out:
|
out:
|
||||||
mutex_unlock(&zdev->state_lock);
|
|
||||||
if (pdev)
|
if (pdev)
|
||||||
pci_dev_put(pdev);
|
pci_dev_put(pdev);
|
||||||
|
mutex_unlock(&zdev->state_lock);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
#include <linux/idr.h>
|
#include <linux/idr.h>
|
||||||
#include <linux/leds.h>
|
#include <linux/leds.h>
|
||||||
#include <linux/rculist.h>
|
#include <linux/rculist.h>
|
||||||
|
#include <linux/srcu.h>
|
||||||
|
|
||||||
#include <net/bluetooth/hci.h>
|
#include <net/bluetooth/hci.h>
|
||||||
#include <net/bluetooth/hci_sync.h>
|
#include <net/bluetooth/hci_sync.h>
|
||||||
@ -338,6 +339,7 @@ struct adv_monitor {
|
|||||||
|
|
||||||
struct hci_dev {
|
struct hci_dev {
|
||||||
struct list_head list;
|
struct list_head list;
|
||||||
|
struct srcu_struct srcu;
|
||||||
struct mutex lock;
|
struct mutex lock;
|
||||||
|
|
||||||
struct ida unset_handle_ida;
|
struct ida unset_handle_ida;
|
||||||
|
@ -63,7 +63,7 @@ static DEFINE_IDA(hci_index_ida);
|
|||||||
|
|
||||||
/* Get HCI device by index.
|
/* Get HCI device by index.
|
||||||
* Device is held on return. */
|
* Device is held on return. */
|
||||||
struct hci_dev *hci_dev_get(int index)
|
static struct hci_dev *__hci_dev_get(int index, int *srcu_index)
|
||||||
{
|
{
|
||||||
struct hci_dev *hdev = NULL, *d;
|
struct hci_dev *hdev = NULL, *d;
|
||||||
|
|
||||||
@ -76,6 +76,8 @@ struct hci_dev *hci_dev_get(int index)
|
|||||||
list_for_each_entry(d, &hci_dev_list, list) {
|
list_for_each_entry(d, &hci_dev_list, list) {
|
||||||
if (d->id == index) {
|
if (d->id == index) {
|
||||||
hdev = hci_dev_hold(d);
|
hdev = hci_dev_hold(d);
|
||||||
|
if (srcu_index)
|
||||||
|
*srcu_index = srcu_read_lock(&d->srcu);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -83,6 +85,22 @@ struct hci_dev *hci_dev_get(int index)
|
|||||||
return hdev;
|
return hdev;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct hci_dev *hci_dev_get(int index)
|
||||||
|
{
|
||||||
|
return __hci_dev_get(index, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
static struct hci_dev *hci_dev_get_srcu(int index, int *srcu_index)
|
||||||
|
{
|
||||||
|
return __hci_dev_get(index, srcu_index);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void hci_dev_put_srcu(struct hci_dev *hdev, int srcu_index)
|
||||||
|
{
|
||||||
|
srcu_read_unlock(&hdev->srcu, srcu_index);
|
||||||
|
hci_dev_put(hdev);
|
||||||
|
}
|
||||||
|
|
||||||
/* ---- Inquiry support ---- */
|
/* ---- Inquiry support ---- */
|
||||||
|
|
||||||
bool hci_discovery_active(struct hci_dev *hdev)
|
bool hci_discovery_active(struct hci_dev *hdev)
|
||||||
@ -567,9 +585,9 @@ static int hci_dev_do_reset(struct hci_dev *hdev)
|
|||||||
int hci_dev_reset(__u16 dev)
|
int hci_dev_reset(__u16 dev)
|
||||||
{
|
{
|
||||||
struct hci_dev *hdev;
|
struct hci_dev *hdev;
|
||||||
int err;
|
int err, srcu_index;
|
||||||
|
|
||||||
hdev = hci_dev_get(dev);
|
hdev = hci_dev_get_srcu(dev, &srcu_index);
|
||||||
if (!hdev)
|
if (!hdev)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
@ -591,7 +609,7 @@ int hci_dev_reset(__u16 dev)
|
|||||||
err = hci_dev_do_reset(hdev);
|
err = hci_dev_do_reset(hdev);
|
||||||
|
|
||||||
done:
|
done:
|
||||||
hci_dev_put(hdev);
|
hci_dev_put_srcu(hdev, srcu_index);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2440,6 +2458,11 @@ struct hci_dev *hci_alloc_dev_priv(int sizeof_priv)
|
|||||||
if (!hdev)
|
if (!hdev)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
if (init_srcu_struct(&hdev->srcu)) {
|
||||||
|
kfree(hdev);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
hdev->pkt_type = (HCI_DM1 | HCI_DH1 | HCI_HV1);
|
hdev->pkt_type = (HCI_DM1 | HCI_DH1 | HCI_HV1);
|
||||||
hdev->esco_type = (ESCO_HV1);
|
hdev->esco_type = (ESCO_HV1);
|
||||||
hdev->link_mode = (HCI_LM_ACCEPT);
|
hdev->link_mode = (HCI_LM_ACCEPT);
|
||||||
@ -2684,6 +2707,9 @@ void hci_unregister_dev(struct hci_dev *hdev)
|
|||||||
list_del(&hdev->list);
|
list_del(&hdev->list);
|
||||||
write_unlock(&hci_dev_list_lock);
|
write_unlock(&hci_dev_list_lock);
|
||||||
|
|
||||||
|
synchronize_srcu(&hdev->srcu);
|
||||||
|
cleanup_srcu_struct(&hdev->srcu);
|
||||||
|
|
||||||
disable_work_sync(&hdev->rx_work);
|
disable_work_sync(&hdev->rx_work);
|
||||||
disable_work_sync(&hdev->cmd_work);
|
disable_work_sync(&hdev->cmd_work);
|
||||||
disable_work_sync(&hdev->tx_work);
|
disable_work_sync(&hdev->tx_work);
|
||||||
|
@ -660,12 +660,9 @@ static void *bpf_test_init(const union bpf_attr *kattr, u32 user_size,
|
|||||||
void __user *data_in = u64_to_user_ptr(kattr->test.data_in);
|
void __user *data_in = u64_to_user_ptr(kattr->test.data_in);
|
||||||
void *data;
|
void *data;
|
||||||
|
|
||||||
if (size < ETH_HLEN || size > PAGE_SIZE - headroom - tailroom)
|
if (user_size < ETH_HLEN || user_size > PAGE_SIZE - headroom - tailroom)
|
||||||
return ERR_PTR(-EINVAL);
|
return ERR_PTR(-EINVAL);
|
||||||
|
|
||||||
if (user_size > size)
|
|
||||||
return ERR_PTR(-EMSGSIZE);
|
|
||||||
|
|
||||||
size = SKB_DATA_ALIGN(size);
|
size = SKB_DATA_ALIGN(size);
|
||||||
data = kzalloc(size + headroom + tailroom, GFP_USER);
|
data = kzalloc(size + headroom + tailroom, GFP_USER);
|
||||||
if (!data)
|
if (!data)
|
||||||
|
@ -273,6 +273,7 @@ struct sk_buff *__udp_gso_segment(struct sk_buff *gso_skb,
|
|||||||
bool copy_dtor;
|
bool copy_dtor;
|
||||||
__sum16 check;
|
__sum16 check;
|
||||||
__be16 newlen;
|
__be16 newlen;
|
||||||
|
int ret = 0;
|
||||||
|
|
||||||
mss = skb_shinfo(gso_skb)->gso_size;
|
mss = skb_shinfo(gso_skb)->gso_size;
|
||||||
if (gso_skb->len <= sizeof(*uh) + mss)
|
if (gso_skb->len <= sizeof(*uh) + mss)
|
||||||
@ -301,6 +302,10 @@ struct sk_buff *__udp_gso_segment(struct sk_buff *gso_skb,
|
|||||||
if (skb_pagelen(gso_skb) - sizeof(*uh) == skb_shinfo(gso_skb)->gso_size)
|
if (skb_pagelen(gso_skb) - sizeof(*uh) == skb_shinfo(gso_skb)->gso_size)
|
||||||
return __udp_gso_segment_list(gso_skb, features, is_ipv6);
|
return __udp_gso_segment_list(gso_skb, features, is_ipv6);
|
||||||
|
|
||||||
|
ret = __skb_linearize(gso_skb);
|
||||||
|
if (ret)
|
||||||
|
return ERR_PTR(ret);
|
||||||
|
|
||||||
/* Setup csum, as fraglist skips this in udp4_gro_receive. */
|
/* Setup csum, as fraglist skips this in udp4_gro_receive. */
|
||||||
gso_skb->csum_start = skb_transport_header(gso_skb) - gso_skb->head;
|
gso_skb->csum_start = skb_transport_header(gso_skb) - gso_skb->head;
|
||||||
gso_skb->csum_offset = offsetof(struct udphdr, check);
|
gso_skb->csum_offset = offsetof(struct udphdr, check);
|
||||||
|
@ -511,9 +511,8 @@ static int tls_strp_read_sock(struct tls_strparser *strp)
|
|||||||
if (inq < strp->stm.full_len)
|
if (inq < strp->stm.full_len)
|
||||||
return tls_strp_read_copy(strp, true);
|
return tls_strp_read_copy(strp, true);
|
||||||
|
|
||||||
if (!strp->stm.full_len) {
|
|
||||||
tls_strp_load_anchor_with_queue(strp, inq);
|
tls_strp_load_anchor_with_queue(strp, inq);
|
||||||
|
if (!strp->stm.full_len) {
|
||||||
sz = tls_rx_msg_size(strp, strp->anchor);
|
sz = tls_rx_msg_size(strp, strp->anchor);
|
||||||
if (sz < 0) {
|
if (sz < 0) {
|
||||||
tls_strp_abort_strp(strp, sz);
|
tls_strp_abort_strp(strp, sz);
|
||||||
|
@ -23,7 +23,7 @@ static void test_xdp_with_devmap_helpers(void)
|
|||||||
__u32 len = sizeof(info);
|
__u32 len = sizeof(info);
|
||||||
int err, dm_fd, dm_fd_redir, map_fd;
|
int err, dm_fd, dm_fd_redir, map_fd;
|
||||||
struct nstoken *nstoken = NULL;
|
struct nstoken *nstoken = NULL;
|
||||||
char data[10] = {};
|
char data[ETH_HLEN] = {};
|
||||||
__u32 idx = 0;
|
__u32 idx = 0;
|
||||||
|
|
||||||
SYS(out_close, "ip netns add %s", TEST_NS);
|
SYS(out_close, "ip netns add %s", TEST_NS);
|
||||||
@ -58,7 +58,7 @@ static void test_xdp_with_devmap_helpers(void)
|
|||||||
/* send a packet to trigger any potential bugs in there */
|
/* send a packet to trigger any potential bugs in there */
|
||||||
DECLARE_LIBBPF_OPTS(bpf_test_run_opts, opts,
|
DECLARE_LIBBPF_OPTS(bpf_test_run_opts, opts,
|
||||||
.data_in = &data,
|
.data_in = &data,
|
||||||
.data_size_in = 10,
|
.data_size_in = sizeof(data),
|
||||||
.flags = BPF_F_TEST_XDP_LIVE_FRAMES,
|
.flags = BPF_F_TEST_XDP_LIVE_FRAMES,
|
||||||
.repeat = 1,
|
.repeat = 1,
|
||||||
);
|
);
|
||||||
@ -158,7 +158,7 @@ static void test_xdp_with_devmap_helpers_veth(void)
|
|||||||
struct nstoken *nstoken = NULL;
|
struct nstoken *nstoken = NULL;
|
||||||
__u32 len = sizeof(info);
|
__u32 len = sizeof(info);
|
||||||
int err, dm_fd, dm_fd_redir, map_fd, ifindex_dst;
|
int err, dm_fd, dm_fd_redir, map_fd, ifindex_dst;
|
||||||
char data[10] = {};
|
char data[ETH_HLEN] = {};
|
||||||
__u32 idx = 0;
|
__u32 idx = 0;
|
||||||
|
|
||||||
SYS(out_close, "ip netns add %s", TEST_NS);
|
SYS(out_close, "ip netns add %s", TEST_NS);
|
||||||
@ -208,7 +208,7 @@ static void test_xdp_with_devmap_helpers_veth(void)
|
|||||||
/* send a packet to trigger any potential bugs in there */
|
/* send a packet to trigger any potential bugs in there */
|
||||||
DECLARE_LIBBPF_OPTS(bpf_test_run_opts, opts,
|
DECLARE_LIBBPF_OPTS(bpf_test_run_opts, opts,
|
||||||
.data_in = &data,
|
.data_in = &data,
|
||||||
.data_size_in = 10,
|
.data_size_in = sizeof(data),
|
||||||
.flags = BPF_F_TEST_XDP_LIVE_FRAMES,
|
.flags = BPF_F_TEST_XDP_LIVE_FRAMES,
|
||||||
.repeat = 1,
|
.repeat = 1,
|
||||||
);
|
);
|
||||||
|
@ -207,9 +207,11 @@ def bpftool_prog_list_wait(expected=0, n_retry=20):
|
|||||||
raise Exception("Time out waiting for program counts to stabilize want %d, have %d" % (expected, nprogs))
|
raise Exception("Time out waiting for program counts to stabilize want %d, have %d" % (expected, nprogs))
|
||||||
|
|
||||||
def bpftool_map_list_wait(expected=0, n_retry=20, ns=""):
|
def bpftool_map_list_wait(expected=0, n_retry=20, ns=""):
|
||||||
|
nmaps = None
|
||||||
for i in range(n_retry):
|
for i in range(n_retry):
|
||||||
maps = bpftool_map_list(ns=ns)
|
maps = bpftool_map_list(ns=ns)
|
||||||
if len(maps) == expected:
|
nmaps = len(maps)
|
||||||
|
if nmaps == expected:
|
||||||
return maps
|
return maps
|
||||||
time.sleep(0.05)
|
time.sleep(0.05)
|
||||||
raise Exception("Time out waiting for map counts to stabilize want %d, have %d" % (expected, nmaps))
|
raise Exception("Time out waiting for map counts to stabilize want %d, have %d" % (expected, nmaps))
|
||||||
@ -594,8 +596,9 @@ def check_extack_nsim(output, reference, args):
|
|||||||
check_extack(output, "netdevsim: " + reference, args)
|
check_extack(output, "netdevsim: " + reference, args)
|
||||||
|
|
||||||
def check_no_extack(res, needle):
|
def check_no_extack(res, needle):
|
||||||
fail((res[1] + res[2]).count(needle) or (res[1] + res[2]).count("Warning:"),
|
haystack = (res[1] + res[2]).strip()
|
||||||
"Found '%s' in command output, leaky extack?" % (needle))
|
fail(haystack.count(needle) or haystack.count("Warning:"),
|
||||||
|
"Unexpected command output, leaky extack? ('%s', '%s')" % (needle, haystack))
|
||||||
|
|
||||||
def check_verifier_log(output, reference):
|
def check_verifier_log(output, reference):
|
||||||
lines = output.split("\n")
|
lines = output.split("\n")
|
||||||
@ -707,6 +710,7 @@ _, base_maps = bpftool("map")
|
|||||||
base_map_names = [
|
base_map_names = [
|
||||||
'pid_iter.rodata', # created on each bpftool invocation
|
'pid_iter.rodata', # created on each bpftool invocation
|
||||||
'libbpf_det_bind', # created on each bpftool invocation
|
'libbpf_det_bind', # created on each bpftool invocation
|
||||||
|
'libbpf_global',
|
||||||
]
|
]
|
||||||
|
|
||||||
# Check netdevsim
|
# Check netdevsim
|
||||||
|
Loading…
Reference in New Issue
Block a user