~vicamo/+git/ubuntu-kernel:bug-1836993/disable-framebuffer-compression-on-IceLake/disco

Last commit made on 2019-08-27
Get this branch:
git clone -b bug-1836993/disable-framebuffer-compression-on-IceLake/disco https://git.launchpad.net/~vicamo/+git/ubuntu-kernel
Only You-Sheng Yang can upload to this branch. If you are You-Sheng Yang please log in for upload directions.

Branch merges

Branch information

Name:
bug-1836993/disable-framebuffer-compression-on-IceLake/disco
Repository:
lp:~vicamo/+git/ubuntu-kernel

Recent commits

ba18440... by You-Sheng Yang

UBUNTU: SAUCE: drm/i915/fbc: disable framebuffer compression on IceLake

This is the same thing to commit
edf87a92e112ede83916155a156e41787ea11186 but found on IceLake platforms
as well.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111484
Signed-off-by: You-Sheng Yang <email address hidden>

ebf9271... by Kamal Mostafa

UBUNTU: upstream stable to v4.19.55, v5.1.14

BugLink: https://bugs.launchpad.net/bugs/1840076

Ignore: yes
Signed-off-by: Kamal Mostafa <email address hidden>
Signed-off-by: Khalid Elmously <email address hidden>

5e312cd... by Sagi Grimberg <email address hidden>

nvme-tcp: fix queue mapping when queue count is limited

BugLink: https://bugs.launchpad.net/bugs/1840076

commit 6486199378a505c58fddc47459631235c9fb7638 upstream.

When the controller supports less queues than requested, we
should make sure that queue mapping does the right thing and
not assume that all queues are available. This fixes a crash
when the controller supports less queues than requested.

The rules are:
1. if no write queues are requested, we assign the available queues
   to the default queue map. The default and read queue maps share the
   existing queues.
2. if write queues are requested:
  - first make sure that read queue map gets the requested
    nr_io_queues count
  - then grant the default queue map the minimum between the requested
    nr_write_queues and the remaining queues. If there are no available
    queues to dedicate to the default queue map, fallback to (1) and
    share all the queues in the existing queue map.

Also, provide a log indication on how we constructed the different
queue maps.

Reported-by: Harris, James R <email address hidden>
Tested-by: Jim Harris <email address hidden>
Cc: <email address hidden> # v5.0+
Suggested-by: Roy Shterman <email address hidden>
Signed-off-by: Sagi Grimberg <email address hidden>
Signed-off-by: Greg Kroah-Hartman <email address hidden>
Signed-off-by: Kamal Mostafa <email address hidden>
Signed-off-by: Khalid Elmously <email address hidden>

ab6479e... by Sagi Grimberg <email address hidden>

nvme-tcp: fix possible null deref on a timed out io queue connect

BugLink: https://bugs.launchpad.net/bugs/1840076

commit f34e25898a608380a60135288019c4cb6013bec8 upstream.

If I/O queue connect times out, we might have freed the queue socket
already, so check for that on the error path in nvme_tcp_start_queue.

Signed-off-by: Sagi Grimberg <email address hidden>
Signed-off-by: Christoph Hellwig <email address hidden>
Signed-off-by: Greg Kroah-Hartman <email address hidden>
Signed-off-by: Kamal Mostafa <email address hidden>
Signed-off-by: Khalid Elmously <email address hidden>

ccf02c3... by Sagi Grimberg <email address hidden>

nvme-tcp: rename function to have nvme_tcp prefix

BugLink: https://bugs.launchpad.net/bugs/1840076

commit efb973b19b88642bb7e08b8ce8e03b0bbd2a7e2a upstream.

usually nvme_ prefix is for core functions.
While we're cleaning up, remove redundant empty lines

Signed-off-by: Sagi Grimberg <email address hidden>
Reviewed-by: Minwoo Im <email address hidden>
Signed-off-by: Christoph Hellwig <email address hidden>
Signed-off-by: Greg Kroah-Hartman <email address hidden>
Signed-off-by: Kamal Mostafa <email address hidden>
Signed-off-by: Khalid Elmously <email address hidden>

2d2cdbd... by Yang Shi <email address hidden>

mm: mmu_gather: remove __tlb_reset_range() for force flush

BugLink: https://bugs.launchpad.net/bugs/1840076

commit 7a30df49f63ad92318ddf1f7498d1129a77dd4bd upstream.

A few new fields were added to mmu_gather to make TLB flush smarter for
huge page by telling what level of page table is changed.

__tlb_reset_range() is used to reset all these page table state to
unchanged, which is called by TLB flush for parallel mapping changes for
the same range under non-exclusive lock (i.e. read mmap_sem).

Before commit dd2283f2605e ("mm: mmap: zap pages with read mmap_sem in
munmap"), the syscalls (e.g. MADV_DONTNEED, MADV_FREE) which may update
PTEs in parallel don't remove page tables. But, the forementioned
commit may do munmap() under read mmap_sem and free page tables. This
may result in program hang on aarch64 reported by Jan Stancek. The
problem could be reproduced by his test program with slightly modified
below.

---8<---

static int map_size = 4096;
static int num_iter = 500;
static long threads_total;

static void *distant_area;

void *map_write_unmap(void *ptr)
{
 int *fd = ptr;
 unsigned char *map_address;
 int i, j = 0;

 for (i = 0; i < num_iter; i++) {
  map_address = mmap(distant_area, (size_t) map_size, PROT_WRITE | PROT_READ,
   MAP_SHARED | MAP_ANONYMOUS, -1, 0);
  if (map_address == MAP_FAILED) {
   perror("mmap");
   exit(1);
  }

  for (j = 0; j < map_size; j++)
   map_address[j] = 'b';

  if (munmap(map_address, map_size) == -1) {
   perror("munmap");
   exit(1);
  }
 }

 return NULL;
}

void *dummy(void *ptr)
{
 return NULL;
}

int main(void)
{
 pthread_t thid[2];

 /* hint for mmap in map_write_unmap() */
 distant_area = mmap(0, DISTANT_MMAP_SIZE, PROT_WRITE | PROT_READ,
   MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
 munmap(distant_area, (size_t)DISTANT_MMAP_SIZE);
 distant_area += DISTANT_MMAP_SIZE / 2;

 while (1) {
  pthread_create(&thid[0], NULL, map_write_unmap, NULL);
  pthread_create(&thid[1], NULL, dummy, NULL);

  pthread_join(thid[0], NULL);
  pthread_join(thid[1], NULL);
 }
}
---8<---

The program may bring in parallel execution like below:

        t1 t2
munmap(map_address)
  downgrade_write(&mm->mmap_sem);
  unmap_region()
  tlb_gather_mmu()
    inc_tlb_flush_pending(tlb->mm);
  free_pgtables()
    tlb->freed_tables = 1
    tlb->cleared_pmds = 1

                                        pthread_exit()
                                        madvise(thread_stack, 8M, MADV_DONTNEED)
                                          zap_page_range()
                                            tlb_gather_mmu()
                                              inc_tlb_flush_pending(tlb->mm);

  tlb_finish_mmu()
    if (mm_tlb_flush_nested(tlb->mm))
      __tlb_reset_range()

__tlb_reset_range() would reset freed_tables and cleared_* bits, but this
may cause inconsistency for munmap() which do free page tables. Then it
may result in some architectures, e.g. aarch64, may not flush TLB
completely as expected to have stale TLB entries remained.

Use fullmm flush since it yields much better performance on aarch64 and
non-fullmm doesn't yields significant difference on x86.

The original proposed fix came from Jan Stancek who mainly debugged this
issue, I just wrapped up everything together.

Jan's testing results:

v5.2-rc2-24-gbec7550cca10
--------------------------
         mean stddev
real 37.382 2.780
user 1.420 0.078
sys 54.658 1.855

v5.2-rc2-24-gbec7550cca10 + "mm: mmu_gather: remove __tlb_reset_range() for force flush"
---------------------------------------------------------------------------------------_
         mean stddev
real 37.119 2.105
user 1.548 0.087
sys 55.698 1.357

[<email address hidden>: coding-style fixes]
Link: http://<email address hidden>
Fixes: dd2283f2605e ("mm: mmap: zap pages with read mmap_sem in munmap")
Signed-off-by: Yang Shi <email address hidden>
Signed-off-by: Jan Stancek <email address hidden>
Reported-by: Jan Stancek <email address hidden>
Tested-by: Jan Stancek <email address hidden>
Suggested-by: Will Deacon <email address hidden>
Tested-by: Will Deacon <email address hidden>
Acked-by: Will Deacon <email address hidden>
Cc: Peter Zijlstra <email address hidden>
Cc: Nick Piggin <email address hidden>
Cc: "Aneesh Kumar K.V" <email address hidden>
Cc: Nadav Amit <email address hidden>
Cc: Minchan Kim <email address hidden>
Cc: Mel Gorman <email address hidden>
Cc: <email address hidden> [4.20+]
Signed-off-by: Andrew Morton <email address hidden>
Signed-off-by: Linus Torvalds <email address hidden>
Signed-off-by: Greg Kroah-Hartman <email address hidden>

Signed-off-by: Kamal Mostafa <email address hidden>

Signed-off-by: Khalid Elmously <email address hidden>

ab60120... by Jes Sorensen <email address hidden>

blk-mq: Fix memory leak in error handling

BugLink: https://bugs.launchpad.net/bugs/1840076

[ Upstream commit 41de54c64811bf087c8464fdeb43c6ad8be2686b ]

If blk_mq_init_allocated_queue() fails, make sure to free the poll
stat callback struct allocated.

Signed-off-by: Jes Sorensen <email address hidden>
Signed-off-by: Jens Axboe <email address hidden>
Signed-off-by: Sasha Levin <email address hidden>
Signed-off-by: Kamal Mostafa <email address hidden>
Signed-off-by: Khalid Elmously <email address hidden>

3046c8b... by Paul Mackerras <email address hidden>

KVM: PPC: Book3S HV: Use new mutex to synchronize MMU setup

BugLink: https://bugs.launchpad.net/bugs/1840076

[ Upstream commit 0d4ee88d92884c661fcafd5576da243aa943dc24 ]

Currently the HV KVM code uses kvm->lock in conjunction with a flag,
kvm->arch.mmu_ready, to synchronize MMU setup and hold off vcpu
execution until the MMU-related data structures are ready. However,
this means that kvm->lock is being taken inside vcpu->mutex, which
is contrary to Documentation/virtual/kvm/locking.txt and results in
lockdep warnings.

To fix this, we add a new mutex, kvm->arch.mmu_setup_lock, which nests
inside the vcpu mutexes, and is taken in the places where kvm->lock
was taken that are related to MMU setup.

Additionally we take the new mutex in the vcpu creation code at the
point where we are creating a new vcore, in order to provide mutual
exclusion with kvmppc_update_lpcr() and ensure that an update to
kvm->arch.lpcr doesn't get missed, which could otherwise lead to a
stale vcore->lpcr value.

Signed-off-by: Paul Mackerras <email address hidden>
Signed-off-by: Sasha Levin <email address hidden>
Signed-off-by: Kamal Mostafa <email address hidden>
Signed-off-by: Khalid Elmously <email address hidden>

3d1f327... by Gen Zhang <email address hidden>

dfs_cache: fix a wrong use of kfree in flush_cache_ent()

BugLink: https://bugs.launchpad.net/bugs/1840076

[ Upstream commit 50fbc13dc12666f3604dc2555a47fc8c4e29162b ]

In flush_cache_ent(), 'ce->ce_path' is allocated by kstrdup_const().
It should be freed by kfree_const(), rather than kfree().

Signed-off-by: Gen Zhang <email address hidden>
Reviewed-by: Paulo Alcantara <email address hidden>
Signed-off-by: Steve French <email address hidden>
Signed-off-by: Sasha Levin <email address hidden>
Signed-off-by: Kamal Mostafa <email address hidden>
Signed-off-by: Khalid Elmously <email address hidden>

e4b60ca... by Madalin Bucur <email address hidden>

dpaa_eth: use only online CPU portals

BugLink: https://bugs.launchpad.net/bugs/1840076

[ Upstream commit 7aae703f8096d21e34ce5f34f16715587bc30902 ]

Make sure only the portals for the online CPUs are used.
Without this change, there are issues when someone boots with
maxcpus=n, with n < actual number of cores available as frames
either received or corresponding to the transmit confirmation
path would be offered for dequeue to the offline CPU portals,
getting lost.

Signed-off-by: Madalin Bucur <email address hidden>
Signed-off-by: David S. Miller <email address hidden>
Signed-off-by: Sasha Levin <email address hidden>
Signed-off-by: Kamal Mostafa <email address hidden>
Signed-off-by: Khalid Elmously <email address hidden>