Skip to content

Commit

Permalink
Merge 4.4.244 into android-msm-wahoo-4.4
Browse files Browse the repository at this point in the history
Changes in 4.4.244: (64 commits)
        ring-buffer: Fix recursion protection transitions between interrupt context
        gfs2: Wake up when sd_glock_disposal becomes zero
        mm: mempolicy: fix potential pte_unmap_unlock pte error
        time: Prevent undefined behaviour in timespec64_to_ns()
        btrfs: reschedule when cloning lots of extents
        net: xfrm: fix a race condition during allocing spi
        perf tools: Add missing swap for ino_generation
        ALSA: hda: prevent undefined shift in snd_hdac_ext_bus_get_link()
        can: dev: can_get_echo_skb(): prevent call to kfree_skb() in hard IRQ context
        can: dev: __can_get_echo_skb(): fix real payload length return value for RTR frames
        can: can_create_echo_skb(): fix echo skb generation: always use skb_clone()
        can: peak_usb: add range checking in decode operations
        can: peak_usb: peak_usb_get_ts_time(): fix timestamp wrapping
        Btrfs: fix missing error return if writeback for extent buffer never started
        pinctrl: devicetree: Avoid taking direct reference to device name string
        i40e: Wrong truncation from u16 to u8
        i40e: Fix of memory leak and integer truncation in i40e_virtchnl.c
        geneve: add transport ports in route lookup for geneve
        ath9k_htc: Use appropriate rs_datalen type
        usb: gadget: goku_udc: fix potential crashes in probe
        gfs2: Free rd_bits later in gfs2_clear_rgrpd to fix use-after-free
        gfs2: check for live vs. read-only file system in gfs2_fitrim
        drm/amdgpu: perform srbm soft reset always on SDMA resume
        mac80211: fix use of skb payload instead of header
        cfg80211: regulatory: Fix inconsistent format argument
        iommu/amd: Increase interrupt remapping table limit to 512 entries
        xfs: fix a missing unlock on error in xfs_fs_map_blocks
        of/address: Fix of_node memory leak in of_dma_is_coherent
        cosa: Add missing kfree in error path of cosa_write
        perf: Fix get_recursion_context()
        ext4: correctly report "not supported" for {usr,grp}jquota when !CONFIG_QUOTA
        ext4: unlock xattr_sem properly in ext4_inline_data_truncate()
        usb: cdc-acm: Add DISABLE_ECHO for Renesas USB Download mode
        mei: protect mei_cl_mtu from null dereference
        ocfs2: initialize ip_next_orphan
        don't dump the threads that had been already exiting when zapped.
        drm/gma500: Fix out-of-bounds access to struct drm_device.vblank[]
        pinctrl: amd: use higher precision for 512 RtcClk
        pinctrl: amd: fix incorrect way to disable debounce filter
        swiotlb: fix "x86: Don't panic if can not alloc buffer for swiotlb"
        IPv6: Set SIT tunnel hard_header_len to zero
        net/af_iucv: fix null pointer dereference on shutdown
        net/x25: Fix null-ptr-deref in x25_connect
        net: Update window_clamp if SOCK_RCVBUF is set
        random32: make prandom_u32() output unpredictable
        x86/speculation: Allow IBPB to be conditionally enabled on CPUs with always-on STIBP
        xen/events: avoid removing an event channel while handling it
        xen/events: add a proper barrier to 2-level uevent unmasking
        xen/events: fix race in evtchn_fifo_unmask()
        xen/events: add a new "late EOI" evtchn framework
        xen/blkback: use lateeoi irq binding
        xen/netback: use lateeoi irq binding
        xen/scsiback: use lateeoi irq binding
        xen/pciback: use lateeoi irq binding
        xen/events: switch user event channels to lateeoi model
        xen/events: use a common cpu hotplug hook for event channels
        xen/events: defer eoi in case of excessive number of events
        xen/events: block rogue events for some time
        perf/core: Fix race in the perf_mmap_close() function
        Revert "kernel/reboot.c: convert simple_strtoul to kstrtoint"
        reboot: fix overflow parsing reboot cpu number
        ext4: fix leaking sysfs kobject after failed mount
        Convert trailing spaces and periods in path components
        Linux 4.4.244

Signed-off-by: Nathan Chancellor <[email protected]>
  • Loading branch information
nathanchance committed Nov 19, 2020
2 parents ad26613 + b71e57a commit de02d35
Show file tree
Hide file tree
Showing 67 changed files with 1,412 additions and 521 deletions.
8 changes: 8 additions & 0 deletions Documentation/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4517,6 +4517,14 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
Disables the PV optimizations forcing the HVM guest to
run as generic HVM guest with no PV drivers.

xen.event_eoi_delay= [XEN]
How long to delay EOI handling in case of event
storms (jiffies). Default is 10.

xen.event_loop_timeout= [XEN]
After which time (jiffies) the event handling loop
should start to delay EOI handling. Default is 2.

xirc2ps_cs= [NET,PCMCIA]
Format:
<irq>,<irq_mask>,<io>,<full_duplex>,<do_sound>,<lockup_hack>[,<irq2>[,<irq3>[,<irq4>]]]
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION = 4
PATCHLEVEL = 4
SUBLEVEL = 243
SUBLEVEL = 244
EXTRAVERSION =
NAME = Blurry Fish Butt

Expand Down
52 changes: 33 additions & 19 deletions arch/x86/kernel/cpu/bugs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1223,24 +1223,41 @@ static int ssb_prctl_set(struct task_struct *task, unsigned long ctrl)
return 0;
}

static bool is_spec_ib_user_controlled(void)
{
return spectre_v2_user_ibpb == SPECTRE_V2_USER_PRCTL ||
spectre_v2_user_ibpb == SPECTRE_V2_USER_SECCOMP ||
spectre_v2_user_stibp == SPECTRE_V2_USER_PRCTL ||
spectre_v2_user_stibp == SPECTRE_V2_USER_SECCOMP;
}

static int ib_prctl_set(struct task_struct *task, unsigned long ctrl)
{
switch (ctrl) {
case PR_SPEC_ENABLE:
if (spectre_v2_user_ibpb == SPECTRE_V2_USER_NONE &&
spectre_v2_user_stibp == SPECTRE_V2_USER_NONE)
return 0;
/*
* Indirect branch speculation is always disabled in strict
* mode. It can neither be enabled if it was force-disabled
* by a previous prctl call.

/*
* With strict mode for both IBPB and STIBP, the instruction
* code paths avoid checking this task flag and instead,
* unconditionally run the instruction. However, STIBP and IBPB
* are independent and either can be set to conditionally
* enabled regardless of the mode of the other.
*
* If either is set to conditional, allow the task flag to be
* updated, unless it was force-disabled by a previous prctl
* call. Currently, this is possible on an AMD CPU which has the
* feature X86_FEATURE_AMD_STIBP_ALWAYS_ON. In this case, if the
* kernel is booted with 'spectre_v2_user=seccomp', then
* spectre_v2_user_ibpb == SPECTRE_V2_USER_SECCOMP and
* spectre_v2_user_stibp == SPECTRE_V2_USER_STRICT_PREFERRED.
*/
if (spectre_v2_user_ibpb == SPECTRE_V2_USER_STRICT ||
spectre_v2_user_stibp == SPECTRE_V2_USER_STRICT ||
spectre_v2_user_stibp == SPECTRE_V2_USER_STRICT_PREFERRED ||
if (!is_spec_ib_user_controlled() ||
task_spec_ib_force_disable(task))
return -EPERM;

task_clear_spec_ib_disable(task);
task_update_spec_tif(task);
break;
Expand All @@ -1253,10 +1270,10 @@ static int ib_prctl_set(struct task_struct *task, unsigned long ctrl)
if (spectre_v2_user_ibpb == SPECTRE_V2_USER_NONE &&
spectre_v2_user_stibp == SPECTRE_V2_USER_NONE)
return -EPERM;
if (spectre_v2_user_ibpb == SPECTRE_V2_USER_STRICT ||
spectre_v2_user_stibp == SPECTRE_V2_USER_STRICT ||
spectre_v2_user_stibp == SPECTRE_V2_USER_STRICT_PREFERRED)

if (!is_spec_ib_user_controlled())
return 0;

task_set_spec_ib_disable(task);
if (ctrl == PR_SPEC_FORCE_DISABLE)
task_set_spec_ib_force_disable(task);
Expand Down Expand Up @@ -1319,20 +1336,17 @@ static int ib_prctl_get(struct task_struct *task)
if (spectre_v2_user_ibpb == SPECTRE_V2_USER_NONE &&
spectre_v2_user_stibp == SPECTRE_V2_USER_NONE)
return PR_SPEC_ENABLE;
else if (spectre_v2_user_ibpb == SPECTRE_V2_USER_STRICT ||
spectre_v2_user_stibp == SPECTRE_V2_USER_STRICT ||
spectre_v2_user_stibp == SPECTRE_V2_USER_STRICT_PREFERRED)
return PR_SPEC_DISABLE;
else if (spectre_v2_user_ibpb == SPECTRE_V2_USER_PRCTL ||
spectre_v2_user_ibpb == SPECTRE_V2_USER_SECCOMP ||
spectre_v2_user_stibp == SPECTRE_V2_USER_PRCTL ||
spectre_v2_user_stibp == SPECTRE_V2_USER_SECCOMP) {
else if (is_spec_ib_user_controlled()) {
if (task_spec_ib_force_disable(task))
return PR_SPEC_PRCTL | PR_SPEC_FORCE_DISABLE;
if (task_spec_ib_disable(task))
return PR_SPEC_PRCTL | PR_SPEC_DISABLE;
return PR_SPEC_PRCTL | PR_SPEC_ENABLE;
} else
} else if (spectre_v2_user_ibpb == SPECTRE_V2_USER_STRICT ||
spectre_v2_user_stibp == SPECTRE_V2_USER_STRICT ||
spectre_v2_user_stibp == SPECTRE_V2_USER_STRICT_PREFERRED)
return PR_SPEC_DISABLE;
else
return PR_SPEC_NOT_AFFECTED;
}

Expand Down
22 changes: 17 additions & 5 deletions drivers/block/xen-blkback/blkback.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ static inline void shrink_free_pagepool(struct xen_blkif *blkif, int num)

#define vaddr(page) ((unsigned long)pfn_to_kaddr(page_to_pfn(page)))

static int do_block_io_op(struct xen_blkif *blkif);
static int do_block_io_op(struct xen_blkif *blkif, unsigned int *eoi_flags);
static int dispatch_rw_block_io(struct xen_blkif *blkif,
struct blkif_request *req,
struct pending_req *pending_req);
Expand Down Expand Up @@ -594,6 +594,8 @@ int xen_blkif_schedule(void *arg)
struct xen_vbd *vbd = &blkif->vbd;
unsigned long timeout;
int ret;
bool do_eoi;
unsigned int eoi_flags = XEN_EOI_FLAG_SPURIOUS;

while (!kthread_should_stop()) {
if (try_to_freeze())
Expand All @@ -617,16 +619,23 @@ int xen_blkif_schedule(void *arg)
if (timeout == 0)
goto purge_gnt_list;

do_eoi = blkif->waiting_reqs;

blkif->waiting_reqs = 0;
smp_mb(); /* clear flag *before* checking for work */

ret = do_block_io_op(blkif);
ret = do_block_io_op(blkif, &eoi_flags);
if (ret > 0)
blkif->waiting_reqs = 1;
if (ret == -EACCES)
wait_event_interruptible(blkif->shutdown_wq,
kthread_should_stop());

if (do_eoi && !blkif->waiting_reqs) {
xen_irq_lateeoi(blkif->irq, eoi_flags);
eoi_flags |= XEN_EOI_FLAG_SPURIOUS;
}

purge_gnt_list:
if (blkif->vbd.feature_gnt_persistent &&
time_after(jiffies, blkif->next_lru)) {
Expand Down Expand Up @@ -1094,7 +1103,7 @@ static void end_block_io_op(struct bio *bio)
* and transmute it to the block API to hand it over to the proper block disk.
*/
static int
__do_block_io_op(struct xen_blkif *blkif)
__do_block_io_op(struct xen_blkif *blkif, unsigned int *eoi_flags)
{
union blkif_back_rings *blk_rings = &blkif->blk_rings;
struct blkif_request req;
Expand All @@ -1117,6 +1126,9 @@ __do_block_io_op(struct xen_blkif *blkif)
if (RING_REQUEST_CONS_OVERFLOW(&blk_rings->common, rc))
break;

/* We've seen a request, so clear spurious eoi flag. */
*eoi_flags &= ~XEN_EOI_FLAG_SPURIOUS;

if (kthread_should_stop()) {
more_to_do = 1;
break;
Expand Down Expand Up @@ -1175,13 +1187,13 @@ __do_block_io_op(struct xen_blkif *blkif)
}

static int
do_block_io_op(struct xen_blkif *blkif)
do_block_io_op(struct xen_blkif *blkif, unsigned int *eoi_flags)
{
union blkif_back_rings *blk_rings = &blkif->blk_rings;
int more_to_do;

do {
more_to_do = __do_block_io_op(blkif);
more_to_do = __do_block_io_op(blkif, eoi_flags);
if (more_to_do)
break;

Expand Down
5 changes: 2 additions & 3 deletions drivers/block/xen-blkback/xenbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,8 @@ static int xen_blkif_map(struct xen_blkif *blkif, grant_ref_t *gref,
BUG();
}

err = bind_interdomain_evtchn_to_irqhandler(blkif->domid, evtchn,
xen_blkif_be_int, 0,
"blkif-backend", blkif);
err = bind_interdomain_evtchn_to_irqhandler_lateeoi(blkif->domid,
evtchn, xen_blkif_be_int, 0, "blkif-backend", blkif);
if (err < 0) {
xenbus_unmap_ring_vfree(blkif->be->dev, blkif->blk_ring);
blkif->blk_rings.common.sring = NULL;
Expand Down
2 changes: 0 additions & 2 deletions drivers/char/random.c
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,6 @@ static void credit_entropy_bits(struct entropy_store *r, int nbits)
r->initialized = 1;
r->entropy_total = 0;
if (r == &nonblocking_pool) {
prandom_reseed_late();
process_random_ready_list();
wake_up_all(&urandom_init_wait);
pr_notice("random: %s pool is initialized\n", r->name);
Expand Down Expand Up @@ -923,7 +922,6 @@ void add_interrupt_randomness(int irq, int irq_flags)

fast_mix(fast_pool);
add_interrupt_bench(cycles);
this_cpu_add(net_rand_state.s1, fast_pool->pool[cycles & 3]);

if ((fast_pool->count < 64) &&
!time_after(now, fast_pool->last + HZ))
Expand Down
27 changes: 12 additions & 15 deletions drivers/gpu/drm/amd/amdgpu/cik_sdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -1118,22 +1118,19 @@ static int cik_sdma_soft_reset(void *handle)
{
u32 srbm_soft_reset = 0;
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
u32 tmp = RREG32(mmSRBM_STATUS2);
u32 tmp;

if (tmp & SRBM_STATUS2__SDMA_BUSY_MASK) {
/* sdma0 */
tmp = RREG32(mmSDMA0_F32_CNTL + SDMA0_REGISTER_OFFSET);
tmp |= SDMA0_F32_CNTL__HALT_MASK;
WREG32(mmSDMA0_F32_CNTL + SDMA0_REGISTER_OFFSET, tmp);
srbm_soft_reset |= SRBM_SOFT_RESET__SOFT_RESET_SDMA_MASK;
}
if (tmp & SRBM_STATUS2__SDMA1_BUSY_MASK) {
/* sdma1 */
tmp = RREG32(mmSDMA0_F32_CNTL + SDMA1_REGISTER_OFFSET);
tmp |= SDMA0_F32_CNTL__HALT_MASK;
WREG32(mmSDMA0_F32_CNTL + SDMA1_REGISTER_OFFSET, tmp);
srbm_soft_reset |= SRBM_SOFT_RESET__SOFT_RESET_SDMA1_MASK;
}
/* sdma0 */
tmp = RREG32(mmSDMA0_F32_CNTL + SDMA0_REGISTER_OFFSET);
tmp |= SDMA0_F32_CNTL__HALT_MASK;
WREG32(mmSDMA0_F32_CNTL + SDMA0_REGISTER_OFFSET, tmp);
srbm_soft_reset |= SRBM_SOFT_RESET__SOFT_RESET_SDMA_MASK;

/* sdma1 */
tmp = RREG32(mmSDMA0_F32_CNTL + SDMA1_REGISTER_OFFSET);
tmp |= SDMA0_F32_CNTL__HALT_MASK;
WREG32(mmSDMA0_F32_CNTL + SDMA1_REGISTER_OFFSET, tmp);
srbm_soft_reset |= SRBM_SOFT_RESET__SOFT_RESET_SDMA1_MASK;

if (srbm_soft_reset) {
cik_sdma_print_status((void *)adev);
Expand Down
34 changes: 12 additions & 22 deletions drivers/gpu/drm/gma500/psb_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ int psb_irq_postinstall(struct drm_device *dev)
{
struct drm_psb_private *dev_priv = dev->dev_private;
unsigned long irqflags;
unsigned int i;

spin_lock_irqsave(&dev_priv->irqmask_lock, irqflags);

Expand All @@ -362,20 +363,12 @@ int psb_irq_postinstall(struct drm_device *dev)
PSB_WVDC32(dev_priv->vdc_irq_mask, PSB_INT_ENABLE_R);
PSB_WVDC32(0xFFFFFFFF, PSB_HWSTAM);

if (dev->vblank[0].enabled)
psb_enable_pipestat(dev_priv, 0, PIPE_VBLANK_INTERRUPT_ENABLE);
else
psb_disable_pipestat(dev_priv, 0, PIPE_VBLANK_INTERRUPT_ENABLE);

if (dev->vblank[1].enabled)
psb_enable_pipestat(dev_priv, 1, PIPE_VBLANK_INTERRUPT_ENABLE);
else
psb_disable_pipestat(dev_priv, 1, PIPE_VBLANK_INTERRUPT_ENABLE);

if (dev->vblank[2].enabled)
psb_enable_pipestat(dev_priv, 2, PIPE_VBLANK_INTERRUPT_ENABLE);
else
psb_disable_pipestat(dev_priv, 2, PIPE_VBLANK_INTERRUPT_ENABLE);
for (i = 0; i < dev->num_crtcs; ++i) {
if (dev->vblank[i].enabled)
psb_enable_pipestat(dev_priv, i, PIPE_VBLANK_INTERRUPT_ENABLE);
else
psb_disable_pipestat(dev_priv, i, PIPE_VBLANK_INTERRUPT_ENABLE);
}

if (dev_priv->ops->hotplug_enable)
dev_priv->ops->hotplug_enable(dev, true);
Expand All @@ -388,6 +381,7 @@ void psb_irq_uninstall(struct drm_device *dev)
{
struct drm_psb_private *dev_priv = dev->dev_private;
unsigned long irqflags;
unsigned int i;

spin_lock_irqsave(&dev_priv->irqmask_lock, irqflags);

Expand All @@ -396,14 +390,10 @@ void psb_irq_uninstall(struct drm_device *dev)

PSB_WVDC32(0xFFFFFFFF, PSB_HWSTAM);

if (dev->vblank[0].enabled)
psb_disable_pipestat(dev_priv, 0, PIPE_VBLANK_INTERRUPT_ENABLE);

if (dev->vblank[1].enabled)
psb_disable_pipestat(dev_priv, 1, PIPE_VBLANK_INTERRUPT_ENABLE);

if (dev->vblank[2].enabled)
psb_disable_pipestat(dev_priv, 2, PIPE_VBLANK_INTERRUPT_ENABLE);
for (i = 0; i < dev->num_crtcs; ++i) {
if (dev->vblank[i].enabled)
psb_disable_pipestat(dev_priv, i, PIPE_VBLANK_INTERRUPT_ENABLE);
}

dev_priv->vdc_irq_mask &= _PSB_IRQ_SGX_FLAG |
_PSB_IRQ_MSVDX_FLAG |
Expand Down
6 changes: 5 additions & 1 deletion drivers/iommu/amd_iommu_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,11 @@ extern bool amd_iommu_np_cache;
/* Only true if all IOMMUs support device IOTLBs */
extern bool amd_iommu_iotlb_sup;

#define MAX_IRQS_PER_TABLE 256
/*
* AMD IOMMU hardware only support 512 IRTEs despite
* the architectural limitation of 2048 entries.
*/
#define MAX_IRQS_PER_TABLE 512
#define IRQ_TABLE_ALIGNMENT 128

struct irq_remap_table {
Expand Down
4 changes: 2 additions & 2 deletions drivers/misc/mei/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,11 @@ static inline u8 mei_cl_me_id(const struct mei_cl *cl)
*
* @cl: host client
*
* Return: mtu
* Return: mtu or 0 if client is not connected
*/
static inline size_t mei_cl_mtu(const struct mei_cl *cl)
{
return cl->me_cl->props.max_msg_length;
return cl->me_cl ? cl->me_cl->props.max_msg_length : 0;
}

/**
Expand Down
14 changes: 11 additions & 3 deletions drivers/net/can/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -439,9 +439,13 @@ struct sk_buff *__can_get_echo_skb(struct net_device *dev, unsigned int idx, u8
*/
struct sk_buff *skb = priv->echo_skb[idx];
struct canfd_frame *cf = (struct canfd_frame *)skb->data;
u8 len = cf->len;

*len_ptr = len;
/* get the real payload length for netdev statistics */
if (cf->can_id & CAN_RTR_FLAG)
*len_ptr = 0;
else
*len_ptr = cf->len;

priv->echo_skb[idx] = NULL;

return skb;
Expand All @@ -466,7 +470,11 @@ unsigned int can_get_echo_skb(struct net_device *dev, unsigned int idx)
if (!skb)
return 0;

netif_rx(skb);
skb_get(skb);
if (netif_rx(skb) == NET_RX_SUCCESS)
dev_consume_skb_any(skb);
else
dev_kfree_skb_any(skb);

return len;
}
Expand Down
Loading

0 comments on commit de02d35

Please sign in to comment.