Commit graph

968250 commits

Author SHA1 Message Date
Masami Hiramatsu ab4200c17b perf probe: Fix to die_entrypc() returns error correctly
Fix die_entrypc() to return error correctly if the DIE has no
DW_AT_ranges attribute. Since dwarf_ranges() will treat the case as an
empty ranges and return 0, we have to check it by ourselves.

Fixes: 91e2f539ee ("perf probe: Fix to show function entry line as probe-able")
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com>
Cc: Thomas Richter <tmricht@linux.ibm.com>
Link: http://lore.kernel.org/lkml/160645612634.2824037.5284932731175079426.stgit@devnote2
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2020-11-27 14:33:17 -03:00
Namhyung Kim c0ee1d5ae8 perf stat: Use proper cpu for shadow stats
Currently perf stat shows some metrics (like IPC) for defined events.
But when no aggregation mode is used (-A option), it shows incorrect
values since it used a value from a different cpu.

Before:

  $ perf stat -aA -e cycles,instructions sleep 1

   Performance counter stats for 'system wide':

  CPU0      116,057,380      cycles
  CPU1       86,084,722      cycles
  CPU2       99,423,125      cycles
  CPU3       98,272,994      cycles
  CPU0       53,369,217      instructions      #    0.46  insn per cycle
  CPU1       33,378,058      instructions      #    0.29  insn per cycle
  CPU2       58,150,086      instructions      #    0.50  insn per cycle
  CPU3       40,029,703      instructions      #    0.34  insn per cycle

       1.001816971 seconds time elapsed

So the IPC for CPU1 should be 0.38 (= 33,378,058 / 86,084,722)
but it was 0.29 (= 33,378,058 / 116,057,380) and so on.

After:

  $ perf stat -aA -e cycles,instructions sleep 1

   Performance counter stats for 'system wide':

  CPU0      109,621,384      cycles
  CPU1      159,026,454      cycles
  CPU2       99,460,366      cycles
  CPU3      124,144,142      cycles
  CPU0       44,396,706      instructions      #    0.41  insn per cycle
  CPU1      120,195,425      instructions      #    0.76  insn per cycle
  CPU2       44,763,978      instructions      #    0.45  insn per cycle
  CPU3       69,049,079      instructions      #    0.56  insn per cycle

       1.001910444 seconds time elapsed

Fixes: 44d49a6002 ("perf stat: Support metrics in --per-core/socket mode")
Reported-by: Sam Xi <xyzsam@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lore.kernel.org/lkml/20201127041404.390276-1-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2020-11-27 14:31:37 -03:00
Namhyung Kim aa50d953c1 perf record: Synthesize cgroup events only if needed
It didn't check the tool->cgroup_events bit which is set when the
--all-cgroups option is given.  Without it, samples will not have cgroup
info so no reason to synthesize.

We can check the PERF_RECORD_CGROUP records after running perf record
*WITHOUT* the --all-cgroups option:

Before:

  $ perf report -D | grep CGROUP
  0 0 0x8430 [0x38]: PERF_RECORD_CGROUP cgroup: 1 /
          CGROUP events:          1
          CGROUP events:          0
          CGROUP events:          0

After:

  $ perf report -D | grep CGROUP
          CGROUP events:          0
          CGROUP events:          0
          CGROUP events:          0

Committer testing:

Before:

  # perf record -a sleep 1
  [ perf record: Woken up 1 times to write data ]
  [ perf record: Captured and wrote 2.208 MB perf.data (10003 samples) ]
  # perf report -D | grep "CGROUP events"
            CGROUP events:        146
            CGROUP events:          0
            CGROUP events:          0
  #

After:

  # perf record -a sleep 1
  [ perf record: Woken up 1 times to write data ]
  [ perf record: Captured and wrote 2.208 MB perf.data (10448 samples) ]
  # perf report -D | grep "CGROUP events"
            CGROUP events:          0
            CGROUP events:          0
            CGROUP events:          0
  #

With all-cgroups:

  # perf record --all-cgroups -a sleep 1
  [ perf record: Woken up 1 times to write data ]
  [ perf record: Captured and wrote 2.374 MB perf.data (11526 samples) ]
  # perf report -D | grep "CGROUP events"
            CGROUP events:        146
            CGROUP events:          0
            CGROUP events:          0
  #

Fixes: 8fb4b67939 ("perf record: Add --all-cgroups option")
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lore.kernel.org/lkml/20201127054356.405481-1-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2020-11-27 14:26:33 -03:00
Zhen Lei 9713070028 perf diff: Fix error return value in __cmd_diff()
An appropriate return value should be set on the failed path.

Fixes: 2a09a84c72 ("perf diff: Support hot streams comparison")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lore.kernel.org/lkml/20201124103652.438-1-thunder.leizhen@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2020-11-27 14:21:23 -03:00
Arnaldo Carvalho de Melo 3b13eaf0ba perf tools: Update copy of libbpf's hashmap.c
To pick the changes in:

  7a078d2d18 ("libbpf, hashmap: Fix undefined behavior in hash_bits")

That don't entail any changes in tools/perf.

This addresses this perf build warning:

  Warning: Kernel ABI header at 'tools/perf/util/hashmap.h' differs from latest version at 'tools/lib/bpf/hashmap.h'
  diff -u tools/perf/util/hashmap.h tools/lib/bpf/hashmap.h

Not a kernel ABI, its just that this uses the mechanism in place for
checking kernel ABI files drift.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2020-11-27 14:19:33 -03:00
Arnd Bergmann ae597565d1 Add writeback to valid OP-TEE shared memory types
Allows OP-TEE to work with ARMv7 based single CPU systems by allowing
 writeback cache policy for shared memory.
 -----BEGIN PGP SIGNATURE-----
 
 iQJOBAABCgA4FiEEFV+gSSXZJY9ZyuB5LinzTIcAHJcFAl++RYIaHGplbnMud2lr
 bGFuZGVyQGxpbmFyby5vcmcACgkQLinzTIcAHJf4AQ/8DtO6CixvM9VKOwfwb+I+
 ww5oLpWCfqxI7/Mnr6pGN3OmLKC972lD+KbbsrWMpT13KwY5Uk7s7NQfHAz4Qy2e
 c9eO9ntCfrcUCezkL/+CVFPoBFAFRZC+0wKxK2/q0e7W7um8LSEXAkFhQbg21VqR
 e5fIn9MZE4cazOsV1Cs4Gz7Qtebt8qjmAQLNxm7Pck3zv/XupPDikRQobsdEL+qn
 FA6wGVP8S7rFR+zQnaZHTAk90BxRPmFT/1Fod6z7CSVPwHUxUTUkUVNey2kXALK+
 LVTvcdjiHtdaSqjw/Oax3Y2RDaJ3RSOLSxzTKugmHYlOg4f25dJn8MNrERBekHSn
 6hJOGSlaMs4Mmbe1jiyreRsB2tLwUhWlS8EqSj2SmefBIKJJic9Vek3mwp1aPGX3
 gdSmxGrdOhLLy80Szdpjp9zir+i7dKdVzm6oAO/0JHT9VpIUIx6ciGgB6wSFYxDJ
 0EA0j5Ab18K7PGunL1m1boYh0ck/+438GYycSF2CkLkSy8CHp7N8XdTfBW4jljAa
 4ugH7kZmry6XEBbLltMDdNGXAM9wE38ma3Viz9XZ80TfnWmzII3lhwX3/rAnDNbV
 XYc+baLNBpEJvV+R944hbcTEfbcWkRXM3zvvVa1ZFv5ES7Sx2eupNSedE9tXSAFl
 JrkTej9xXtF1rEYqMcwRTRM=
 =umMU
 -----END PGP SIGNATURE-----

Merge tag 'optee-valid-memory-type-for-v5.11' of git://git.linaro.org/people/jens.wiklander/linux-tee into arm/fixes

Add writeback to valid OP-TEE shared memory types

Allows OP-TEE to work with ARMv7 based single CPU systems by allowing
writeback cache policy for shared memory.

* tag 'optee-valid-memory-type-for-v5.11' of git://git.linaro.org/people/jens.wiklander/linux-tee:
  optee: add writeback to valid memory type

Link: https://lore.kernel.org/r/20201125120134.GA1642471@jade
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2020-11-27 17:45:45 +01:00
Gabriele Paoloni 25bc65d8dd x86/mce: Do not overwrite no_way_out if mce_end() fails
Currently, if mce_end() fails, no_way_out - the variable denoting
whether the machine can recover from this MCE - is determined by whether
the worst severity that was found across the MCA banks associated with
the current CPU, is of panic severity.

However, at this point no_way_out could have been already set by
mca_start() after looking at all severities of all CPUs that entered the
MCE handler. If mce_end() fails, check first if no_way_out is already
set and, if so, stick to it, otherwise use the local worst value.

 [ bp: Massage. ]

Signed-off-by: Gabriele Paoloni <gabriele.paoloni@intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Cc: <stable@vger.kernel.org>
Link: https://lkml.kernel.org/r/20201127161819.3106432-2-gabriele.paoloni@intel.com
2020-11-27 17:38:36 +01:00
Vitaly Kuznetsov 9a2a0d3ca1 kvm: x86/mmu: Fix get_mmio_spte() on CPUs supporting 5-level PT
Commit 95fb5b0258 ("kvm: x86/mmu: Support MMIO in the TDP MMU") caused
the following WARNING on an Intel Ice Lake CPU:

 get_mmio_spte: detect reserved bits on spte, addr 0xb80a0, dump hierarchy:
 ------ spte 0xb80a0 level 5.
 ------ spte 0xfcd210107 level 4.
 ------ spte 0x1004c40107 level 3.
 ------ spte 0x1004c41107 level 2.
 ------ spte 0x1db00000000b83b6 level 1.
 WARNING: CPU: 109 PID: 10254 at arch/x86/kvm/mmu/mmu.c:3569 kvm_mmu_page_fault.cold.150+0x54/0x22f [kvm]
...
 Call Trace:
  ? kvm_io_bus_get_first_dev+0x55/0x110 [kvm]
  vcpu_enter_guest+0xaa1/0x16a0 [kvm]
  ? vmx_get_cs_db_l_bits+0x17/0x30 [kvm_intel]
  ? skip_emulated_instruction+0xaa/0x150 [kvm_intel]
  kvm_arch_vcpu_ioctl_run+0xca/0x520 [kvm]

The guest triggering this crashes. Note, this happens with the traditional
MMU and EPT enabled, not with the newly introduced TDP MMU. Turns out,
there was a subtle change in the above mentioned commit. Previously,
walk_shadow_page_get_mmio_spte() was setting 'root' to 'iterator.level'
which is returned by shadow_walk_init() and this equals to
'vcpu->arch.mmu->shadow_root_level'. Now, get_mmio_spte() sets it to
'int root = vcpu->arch.mmu->root_level'.

The difference between 'root_level' and 'shadow_root_level' on CPUs
supporting 5-level page tables is that in some case we don't want to
use 5-level, in particular when 'cpuid_maxphyaddr(vcpu) <= 48'
kvm_mmu_get_tdp_level() returns '4'. In case upper layer is not used,
the corresponding SPTE will fail '__is_rsvd_bits_set()' check.

Revert to using 'shadow_root_level'.

Fixes: 95fb5b0258 ("kvm: x86/mmu: Support MMIO in the TDP MMU")
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Message-Id: <20201126110206.2118959-1-vkuznets@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-11-27 11:14:27 -05:00
Peng Fan 3311bf1846 nvmem: imx-ocotp: add support for the unaliged word count
When offset is not 4 bytes aligned, directly shift righty by 2 bits
will cause reading out wrong data. Since imx ocotp only supports
4 bytes reading once, we need handle offset is not 4 bytes aligned
and enlarge the bytes to 4 bytes aligned. After reading finished,
copy the needed data from buffer to caller and free buffer.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20201127102837.19366-6-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-27 16:10:07 +01:00
Evan Green 044ee8f852 nvmem: qfprom: Don't touch certain fuses
Some fuse ranges are protected by the XPU such that the AP cannot
access them. Attempting to do so causes an SError. Use the newly
introduced per-soc compatible string, and the newly introduced
nvmem keepout support to attach the set of regions
we should not access.

Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Evan Green <evgreen@chromium.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20201127102837.19366-5-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-27 16:10:06 +01:00
Evan Green c8b336bb1a dt-bindings: nvmem: Add soc qfprom compatible strings
Add SoC-specific compatible strings so that data can be attached
to it in the driver.

Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Evan Green <evgreen@chromium.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20201127102837.19366-4-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-27 16:10:06 +01:00
Evan Green fd3bb8f54a nvmem: core: Add support for keepout regions
Introduce support into the nvmem core for arrays of register ranges
that should not result in actual device access. For these regions a
constant byte (repeated) is returned instead on read, and writes are
quietly ignored and returned as successful.

This is useful for instance if certain efuse regions are protected
from access by Linux because they contain secret info to another part
of the system (like an integrated modem).

Signed-off-by: Evan Green <evgreen@chromium.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20201127102837.19366-3-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-27 16:10:06 +01:00
Fabien Parent 8f3991f066 dt-bindings: nvmem: mtk-efuse: add documentation for MT8516 SoC
Add binding documentation for MT8516 SoCs.

Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Fabien Parent <fparent@baylibre.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20201127102837.19366-2-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-27 16:10:06 +01:00
Srinivas Kandagatla d3bb5fe9ca slimbus: qcom-ngd-ctrl: remove redundant out of memory messages
Failure of dma_alloc_coherent will already throw a error message,
so addition message is really redundant here. Remove it!

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20201127102451.17114-8-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-27 16:03:43 +01:00
Bjorn Andersson 39014ce6d6 slimbus: qcom-ngd-ctrl: Avoid sending power requests without QMI
Attempting to send a power request during PM operations, when the QMI
handle isn't initialized results in a NULL pointer dereference. So check
if the QMI handle has been initialized before attempting to post the
power requests.

Fixes: 917809e228 ("slimbus: ngd: Add qcom SLIMBus NGD driver")
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20201127102451.17114-7-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-27 16:03:43 +01:00
Rikard Falkeborn a35c6e18ab slimbus: qcom-ngd-ctrl: Constify static structs
qcom_slim_qmi_msg_handlers[] and qcom_slim_ngd_qmi_svc_event_ops are
only used as input arguments to qmi_handle_init() which accepts const
pointers to both qmi_ops and qmi_msg_handler. Make them const to allow
the compiler to put them in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20201127102451.17114-6-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-27 16:03:43 +01:00
Gustavo A. R. Silva 50df984203 slimbus: messaging: Fix fall-through warnings for Clang
In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning
by explicitly adding a break statement instead of letting the code fall
through to the next case.

Link: https://github.com/KSPP/linux/issues/115
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20201127102451.17114-5-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-27 16:03:43 +01:00
Srinivas Kandagatla e1ae85e183 slimbus: qcom-ngd-ctrl: add Protection Domain Restart Support
Add support to protection domain restart. Protection domain restart
would also restart the service just like SSR.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20201127102451.17114-4-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-27 16:03:42 +01:00
Srinivas Kandagatla a899d32486 slimbus: qcom-ngd-ctrl: add Sub System Restart support
This patch adds SSR(SubSystem Restart) support which includes, synchronisation
between SSR and QMI server notifications. Also with this patch now NGD is taken
down by SSR instead of QMI server down notification.

NGD up path now relies on both SSR and QMI notifications and particularly
sequence of SSR up followed by QMI server up notification.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20201127102451.17114-3-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-27 16:03:42 +01:00
Mauro Carvalho Chehab abe9af53c0 slimbus: fix a kernel-doc markup
Fix the name of the enum on its kernel-doc markup:
	enum slim_ch_aux_fmt -> enum slim_ch_aux_bit_fmt

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20201127102451.17114-2-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-27 16:03:42 +01:00
Paolo Bonzini 71cc849b70 KVM: x86: Fix split-irqchip vs interrupt injection window request
kvm_cpu_accept_dm_intr and kvm_vcpu_ready_for_interrupt_injection are
a hodge-podge of conditions, hacked together to get something that
more or less works.  But what is actually needed is much simpler;
in both cases the fundamental question is, do we have a place to stash
an interrupt if userspace does KVM_INTERRUPT?

In userspace irqchip mode, that is !vcpu->arch.interrupt.injected.
Currently kvm_event_needs_reinjection(vcpu) covers it, but it is
unnecessarily restrictive.

In split irqchip mode it's a bit more complicated, we need to check
kvm_apic_accept_pic_intr(vcpu) (the IRQ window exit is basically an INTACK
cycle and thus requires ExtINTs not to be masked) as well as
!pending_userspace_extint(vcpu).  However, there is no need to
check kvm_event_needs_reinjection(vcpu), since split irqchip keeps
pending ExtINT state separate from event injection state, and checking
kvm_cpu_has_interrupt(vcpu) is wrong too since ExtINT has higher
priority than APIC interrupts.  In fact the latter fixes a bug:
when userspace requests an IRQ window vmexit, an interrupt in the
local APIC can cause kvm_cpu_has_interrupt() to be true and thus
kvm_vcpu_ready_for_interrupt_injection() to return false.  When this
happens, vcpu_run does not exit to userspace but the interrupt window
vmexits keep occurring.  The VM loops without any hope of making progress.

Once we try to fix these with something like

     return kvm_arch_interrupt_allowed(vcpu) &&
-        !kvm_cpu_has_interrupt(vcpu) &&
-        !kvm_event_needs_reinjection(vcpu) &&
-        kvm_cpu_accept_dm_intr(vcpu);
+        (!lapic_in_kernel(vcpu)
+         ? !vcpu->arch.interrupt.injected
+         : (kvm_apic_accept_pic_intr(vcpu)
+            && !pending_userspace_extint(v)));

we realize two things.  First, thanks to the previous patch the complex
conditional can reuse !kvm_cpu_has_extint(vcpu).  Second, the interrupt
window request in vcpu_enter_guest()

        bool req_int_win =
                dm_request_for_irq_injection(vcpu) &&
                kvm_cpu_accept_dm_intr(vcpu);

should be kept in sync with kvm_vcpu_ready_for_interrupt_injection():
it is unnecessary to ask the processor for an interrupt window
if we would not be able to return to userspace.  Therefore,
kvm_cpu_accept_dm_intr(vcpu) is basically !kvm_cpu_has_extint(vcpu)
ANDed with the existing check for masked ExtINT.  It all makes sense:

- we can accept an interrupt from userspace if there is a place
  to stash it (and, for irqchip split, ExtINTs are not masked).
  Interrupts from userspace _can_ be accepted even if right now
  EFLAGS.IF=0.

- in order to tell userspace we will inject its interrupt ("IRQ
  window open" i.e. kvm_vcpu_ready_for_interrupt_injection), both
  KVM and the vCPU need to be ready to accept the interrupt.

... and this is what the patch implements.

Reported-by: David Woodhouse <dwmw@amazon.co.uk>
Analyzed-by: David Woodhouse <dwmw@amazon.co.uk>
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Nikos Tsironis <ntsironis@arrikto.com>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Tested-by: David Woodhouse <dwmw@amazon.co.uk>
2020-11-27 09:27:28 -05:00
Paolo Bonzini 72c3bcdcda KVM: x86: handle !lapic_in_kernel case in kvm_cpu_*_extint
Centralize handling of interrupts from the userspace APIC
in kvm_cpu_has_extint and kvm_cpu_get_extint, since
userspace APIC interrupts are handled more or less the
same as ExtINTs are with split irqchip.  This removes
duplicated code from kvm_cpu_has_injectable_intr and
kvm_cpu_has_interrupt, and makes the code more similar
between kvm_cpu_has_{extint,interrupt} on one side
and kvm_cpu_get_{extint,interrupt} on the other.

Cc: stable@vger.kernel.org
Reviewed-by: Filippo Sironi <sironi@amazon.de>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Tested-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-11-27 09:19:52 -05:00
Paolo Bonzini 545f63948d KVM/arm64 fixes for v5.10, take #4
- Fix alignment of the new HYP sections
 - Fix GICR_TYPER access from userspace
 -----BEGIN PGP SIGNATURE-----
 
 iQJDBAABCgAtFiEEn9UcU+C1Yxj9lZw9I9DQutE9ekMFAl/A3ZYPHG1hekBrZXJu
 ZWwub3JnAAoJECPQ0LrRPXpDXZAQALpTVjUr0BKjP6t7cZFcBim0x3eG8CQGK65K
 mR1ZGevXawtU62qmPlWYpFIwzB76QGc5w6W46stluXJ5kDA2verzad2RXIEOr93Q
 69uHuhBqClC6stPZRZLw1FaJ0SsxmydF2I14uFWGYkyqzpRXxhfJetMolgjFyeDE
 bd0qtnvA9Phu2ZQHvdxvmSzIPSSw6/irdEyX/Z1/S1UHxFWEJdX9B9x6KaoATYDF
 hlnRaXXfhEhTRVGFpu+O8DEH4MAxbZfu0bqubZnv7ilOes0SqIV4rVXm1BoDVWtP
 1W/zIvOPZDl/zoXylIcqPQJUQgPVfSXdc1MYWBOJxLGKlpTT2cT4iy0YswgNWa8i
 glnV94LoR6bzXYn1ymxLPeg0CwAkstvOIctGmDhm4+kvX/bGPTtyRShKBygwHmEB
 zkBzKKa8LhbVjhBI7kpDlZnLQXdxy1+pR2QFb6mCE/Fq+2YwGdU8KfSTpxNSwjtQ
 5loSzR8is3aZ2ETEcVnI3TxN/oAE30/GUIk762/3sFbqo6O5i/KrRo0YgzNRCiHU
 oZyjGNeJCcprKD4ITfa3UdXjvuee0nAwkTPldriwSYHSNWM8ObBVG+Ek5m35ZFhN
 toHepjYlj2RJLIF+mpqASxBQV5fhAVR2IlK+di4iczMJJTowSIUKAyppoJXg0zAw
 CxOORtWZ
 =oova
 -----END PGP SIGNATURE-----

Merge tag 'kvmarm-fixes-5.10-4' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into kvm-master

KVM/arm64 fixes for v5.10, take #4

- Fix alignment of the new HYP sections
- Fix GICR_TYPER access from userspace
2020-11-27 09:17:13 -05:00
Amelie Delaunay 484cfbe5fb usb: typec: stusb160x: fix power-opmode property with typec-power-opmode
Device tree property is named typec-power-opmode, not power-opmode.

Fixes: da0cb63100 ("usb: typec: add support for STUSB160x Type-C controller family")
Signed-off-by: Amelie Delaunay <amelie.delaunay@st.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20201127131735.28280-1-amelie.delaunay@st.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-27 14:44:26 +01:00
Petr Mladek 739e7116b1 Merge branch 'for-5.10-pr_cont-fixup' into for-linus 2020-11-27 13:41:23 +01:00
Arnd Bergmann 454a079b38 Fixes for omaps for various issues noticed during the -rc cycle:
- Earlier omap4 cpuidle fix was incomplete and needs to use a
   configured idle state instead
 
 - Fix am4 cpsw driver compatible to avoid invalid resource error
   for the legacy driver
 
 - Two kconfig fixes for genpd support that we added for for v5.10
   for proper location of the option and adding missing option
 
 - Fix ti-sysc reset status checking on enabling modules to ignore
   quirky modules with reset status only usable when the quirk is
   activated during reset. Also fix bogus resetdone warning for
   cpsw and modules with no sysst register reset status bit
 
 - Suppress a ti-sysc warning for timers reserved as system timers
 
 - Fix the ordering of clocks for dra7 m_can
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCAAvFiEEkgNvrZJU/QSQYIcQG9Q+yVyrpXMFAl/AozMRHHRvbnlAYXRv
 bWlkZS5jb20ACgkQG9Q+yVyrpXOy0xAA1epgUY0nYa8jsNc4Mv7rM0hkQv2Onm3p
 ZH03iAORiK2mTd/C2QSsq2ByhrpTJh4gVvlQ081JrE6Fh7Zec3YBDcKWCHSjGlOx
 IJcf7q+UJ8zxgBHolT36K68CNQB4U4ro+bUHCBa69ujB90LRM9qJQIexnLEH/tlH
 ApBvQ10ARHe2eod528LJn8R5g6LX3GGvN7CTcfOBIbmvg0OnFpJEzxQ2uK0fZj0K
 m6kawCJ6iHvNvVxzRR35DDQHZaWU/ihPlvuIhthhFdF+26TdEO1qHXU5s8qmZLWN
 WDq3zZ7dd5wuXQNtKiaUUhh3+H4VKpJDzrEVVZytDEoIgMKI8L6FROo6UW5wl7vP
 o3WJpBDchZvAAQWtAuGr0KqresWv9RX8zYwkHDXG6MK2WdErB3GKx750nvSRj1X6
 ZLrFyggYWkAmqCO7moqilKIx6lJPKWBqIRrGyYl8vsVHb9odtS9tB3b3Jnsjjm9H
 D6ahtxdtaZX6kr3o+XszZW15jMxdLDVfvvXzQ+wuIk2MwEUrsf11XkGFVLaTHAD3
 s42Np9+d9KXigOtjrm/+gv7AzIprjZBfG02EUXlcSSoUmIwWZfhMn9KnwMgFzMnC
 gDVnLZ4mEXG40r1gQJeEt5QKgcsZaT/NTcTUNb6PwMUNR8h906P4J2MZYFQrsOjJ
 4jtXur7AOmw=
 =KSUM
 -----END PGP SIGNATURE-----

Merge tag 'omap-for-v5.10/fixes-rc5-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into arm/fixes

Fixes for omaps for various issues noticed during the -rc cycle:

- Earlier omap4 cpuidle fix was incomplete and needs to use a
  configured idle state instead

- Fix am4 cpsw driver compatible to avoid invalid resource error
  for the legacy driver

- Two kconfig fixes for genpd support that we added for for v5.10
  for proper location of the option and adding missing option

- Fix ti-sysc reset status checking on enabling modules to ignore
  quirky modules with reset status only usable when the quirk is
  activated during reset. Also fix bogus resetdone warning for
  cpsw and modules with no sysst register reset status bit

- Suppress a ti-sysc warning for timers reserved as system timers

- Fix the ordering of clocks for dra7 m_can

* tag 'omap-for-v5.10/fixes-rc5-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
  ARM: dts: dra76x: m_can: fix order of clocks
  bus: ti-sysc: suppress err msg for timers used as clockevent/source
  ARM: dts: am437x-l4: fix compatible for cpsw switch dt node
  ARM: OMAP2+: Manage MPU state properly for omap_enter_idle_coupled()
  bus: ti-sysc: Fix bogus resetdone warning on enable for cpsw
  bus: ti-sysc: Fix reset status check for modules with quirks
  ARM: OMAP2+: Fix missing select PM_GENERIC_DOMAINS_OF
  ARM: OMAP2+: Fix location for select PM_GENERIC_DOMAINS

Link: https://lore.kernel.org/r/pull-1606460270-864284@atomide.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2020-11-27 13:18:40 +01:00
John Ogness 4ad9921af4 printk: finalize records with trailing newlines
Any record with a trailing newline (LOG_NEWLINE flag) cannot
be continued because the newline has been stripped and will
not be visible if the message is appended. This was already
handled correctly when committing in log_output() but was
not handled correctly when committing in log_store().

Fixes: f5f022e53b ("printk: reimplement log_cont using record extension")
Link: https://lore.kernel.org/r/20201126114836.14750-1-john.ogness@linutronix.de
Reported-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Tested-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
2020-11-27 11:58:54 +01:00
Oliver Hartkopp d73ff9b7c4 can: af_can: can_rx_unregister(): remove WARN() statement from list operation sanity check
To detect potential bugs in CAN protocol implementations (double removal of
receiver entries) a WARN() statement has been used if no matching list item was
found for removal.

The fault injection issued by syzkaller was able to create a situation where
the closing of a socket runs simultaneously to the notifier call chain for
removing the CAN network device in use.

This case is very unlikely in real life but it doesn't break anything.
Therefore we just replace the WARN() statement with pr_warn() to preserve the
notification for the CAN protocol development.

Reported-by: syzbot+381d06e0c8eaacb8706f@syzkaller.appspotmail.com
Reported-by: syzbot+d0ddd88c9a7432f041e6@syzkaller.appspotmail.com
Reported-by: syzbot+76d62d3b8162883c7d11@syzkaller.appspotmail.com
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Link: https://lore.kernel.org/r/20201126192140.14350-1-socketcan@hartkopp.net
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2020-11-27 10:49:28 +01:00
Pankaj Sharma 5c7d55bded can: m_can: m_can_dev_setup(): add support for bosch mcan version 3.3.0
Add support for mcan bit timing and control mode according to bosch mcan IP
version 3.3.0. The mcan version read from the Core Release field of CREL
register would be 33. Accordingly the properties are to be set for mcan v3.3.0

Signed-off-by: Pankaj Sharma <pankj.sharma@samsung.com>
Link: https://lore.kernel.org/r/1606366302-5520-1-git-send-email-pankj.sharma@samsung.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2020-11-27 10:49:20 +01:00
Marc Kleine-Budde e3409e4192 can: m_can: fix nominal bitiming tseg2 min for version >= 3.1
At lest the revision 3.3.0 of the bosch m_can IP core specifies that valid
register values for "Nominal Time segment after sample point (NTSEG2)" are from
1 to 127. As the hardware uses a value of one more than the programmed value,
mean tseg2_min is 2.

This patch fixes the tseg2_min value accordingly.

Cc: Dan Murphy <dmurphy@ti.com>
Cc: Mario Huettel <mario.huettel@gmx.net>
Acked-by: Sriram Dash <sriram.dash@samsung.com>
Link: https://lore.kernel.org/r/20201124190751.3972238-1-mkl@pengutronix.de
Fixes: b03cfc5bb0 ("can: m_can: Enable M_CAN version dependent initialization")
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2020-11-27 10:49:20 +01:00
Marc Kleine-Budde 865f5b671b can: m_can: m_can_open(): remove IRQF_TRIGGER_FALLING from request_threaded_irq()'s flags
The threaded IRQ handler is used for the tcan4x5x driver only. The IRQ pin of
the tcan4x5x controller is active low, so better not use IRQF_TRIGGER_FALLING
when requesting the IRQ. As this can result in missing interrupts.

Further, if the device tree specified the interrupt as "IRQ_TYPE_LEVEL_LOW",
unloading and reloading of the driver results in the following error during
ifup:

| irq: type mismatch, failed to map hwirq-31 for gpio@20a8000!
| tcan4x5x spi1.1: m_can device registered (irq=0, version=32)
| tcan4x5x spi1.1 can2: TCAN4X5X successfully initialized.
| tcan4x5x spi1.1 can2: failed to request interrupt

This patch fixes the problem by removing the IRQF_TRIGGER_FALLING from the
request_threaded_irq().

Fixes: f524f829b7 ("can: m_can: Create a m_can platform framework")
Cc: Dan Murphy <dmurphy@ti.com>
Cc: Sriram Dash <sriram.dash@samsung.com>
Cc: Pankaj Sharma <pankj.sharma@samsung.com>
Link: https://lore.kernel.org/r/20201127093548.509253-1-mkl@pengutronix.de
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2020-11-27 10:49:20 +01:00
Dave Airlie 9595930db4 A bunch of fixes for vc4 fixing some coexistence issue between wifi and
HDMI, unsupported modes, and vblank timeouts, a fix for ast to reload
 the gamma LUT after changing the plane format and a double-free fix for
 nouveau
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCX79tPAAKCRDj7w1vZxhR
 xdp6AP0Txa4ssBQzkXzPwxeoHIO4KvRNVG4N/s73UEfVr5ovFAEAlEyL4ku0BOlb
 Lyk9MdmhSMl/YRuWzqHK/N1wBk6M5Qk=
 =7635
 -----END PGP SIGNATURE-----

Merge tag 'drm-misc-fixes-2020-11-26' of ssh://git.freedesktop.org/git/drm/drm-misc into drm-fixes

A bunch of fixes for vc4 fixing some coexistence issue between wifi and
HDMI, unsupported modes, and vblank timeouts, a fix for ast to reload
the gamma LUT after changing the plane format and a double-free fix for
nouveau

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20201126085450.r3i7wvj7pizsa4l6@gilmour
2020-11-27 09:39:51 +10:00
Dave Airlie d45618c285 Mediatek DRM Fixes for Linux 5.10
1. Remove unused variable.
 2. Modify horizontal front/back porch byte formula.
 -----BEGIN PGP SIGNATURE-----
 
 iQJMBAABCgA2FiEEACwLKSDmq+9RDv5P4cpzo8lZTiQFAl+7yxgYHGNodW5rdWFu
 Zy5odUBrZXJuZWwub3JnAAoJEOHKc6PJWU4kMeYP/1Yf7l+gvMXnFJkn0b16Fcp/
 RAiBBA8hIhdHZ7igpWfArlXQnaI2JqP/pa7qt9ZxI+hq704R47AmigJ3qXA32sbj
 jJAA2fKBBdRjjpzPjGm9LgNg2BfXHtsI2g5LWwNtTAKlRc1ilfEuxi4aM8EkwB7i
 c+SilBmRCRwuPScOk5NVcEsvNLqNu1/6OAHnfWy3M86ISQuKgio5CO2fJ6DBDfyK
 9vf53534zefpG1aWwERqkgtpIfCxTV+LJiW+y13S1WiADAY2mwfxo2aD1rvob38l
 vz5dgRavnarSyVcslNTIbypSdWrpcIqrBECbhtmDaVNmf84M+mTGlvk+xJiryTnK
 VFWB9X10nFh/ArsDZs1n8j+gChru8rPw7GuyPWuFSwrkdx9VlTuvxh9U2Hh0WCBi
 e4+6sAK5fAdEqO76qYNxzBaalp4NKiui/69xMfT7gYKmk6FKYJjzUc2lQ6P83XC/
 aQ8jhMZCo+HJHxWMZNaSUxm/yaE5czryhSW4FuEOj91QyDSCDcNXmW+6P8tNsU9u
 R7vI8J0CCAdYoBlbh+OXI/FaW6+nhx3YL4oGqFSI21llqKvgbGJdB9u2mXvFkv8S
 dPTHFDoFdMno+Bll5juYCrmAXvXpImyrGY6JUbbDsJ/2mHYGwFpzk+fKkKSL2oTz
 88jxYArH8eFsIPVDAuLu
 =Ns4I
 -----END PGP SIGNATURE-----

Merge tag 'mediatek-drm-fixes-5.10' of https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux into drm-fixes

Mediatek DRM Fixes for Linux 5.10

1. Remove unused variable.
2. Modify horizontal front/back porch byte formula.

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20201123234131.387-1-chunkuang.hu@kernel.org
2020-11-27 09:37:06 +10:00
Dave Airlie 5929dd876b One bug fix
. Add COMMON_CLK dependency to fix a build error below,
 	/usr/bin/mips-linux-gnu-ld: drivers/gpu/drm/exynos/exynos_mixer.o: in function `mixer_bind':
 	exynos_mixer.c:(.text+0x958): undefined reference to `clk_set_parent'
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJfvGyrAAoJEFc4NIkMQxK45jEP/jKnZT981QQ2wSfQQLVYcE/S
 TVGzQ0Ybrykhl07KP5qMkYsSp/u1095duVS7vIjMsxvqanyqSMNUkpvPHONHVfFS
 DnDX7RXiKv5oP9lO+w+Yw5Rkf8Y7It0Rn0mUinql51lRjnb1YT1HWLpvGIBhW5r6
 VUVREXjpIb1WGk/ZwsuJAsQq8KHWgmHbpw0thI0UoT4Bu8HuI8uHKjhoJYeUU4nv
 /ezO1eBOwDKfNgMegJRU39bBEJeUctGrorUWaWZnS97O/oGkDlC8xBwx3rdhN1OB
 YVKH6UyUPvzlbGt2rNtxi/NPKXV3Jj+oyUaDNWq9Y6eiSVWVWN7mi1EI8zD9gvC7
 3CBnef2lGKG6cIhwX4LBaMGK+TtQWREoUmxR8oK/kNC74fZ2p4x+jMiXn2MeMzZC
 njfeQD6e0E/zoaQjNjtGb4vCOsJJH/KFlSsVxgHTzDARPdXeW/+i6JoB2Kwoz5kZ
 uHPt8alA1E06PlFLkKZPyM959oVk3QifCGsKNAppJ0wTn6sc9CF96mO8EjQqZSll
 kAm7SXjamier17waTFJSXiS+w9IwDnQ6d2Su4rGyMjiJHXiHemRKVMMIL7PcmPWN
 emJfNDz3sFe2P7NTOOPK9QFHba8LvEmOrBJ6jG8rq3arvu2pzBTSRWdUmBz7iP/e
 vrQyFgO+GsuAc7P0Qunu
 =rktv
 -----END PGP SIGNATURE-----

Merge tag 'exynos-drm-fixes-for-v5.10-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-fixes

One bug fix
. Add COMMON_CLK dependency to fix a build error below,
	/usr/bin/mips-linux-gnu-ld: drivers/gpu/drm/exynos/exynos_mixer.o: in function `mixer_bind':
	exynos_mixer.c:(.text+0x958): undefined reference to `clk_set_parent'

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Inki Dae <inki.dae@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1606184478-23384-1-git-send-email-inki.dae@samsung.com
2020-11-27 09:23:11 +10:00
Arnd Bergmann 06ceddef30 arm64: tegra: Device tree fixes for v5.10-rc6
This contains a couple of fixes to device trees. Among other things,
 this restores suspend/resume on Jetson TX2 and makes USB OTG work on
 Jetson TX1.
 -----BEGIN PGP SIGNATURE-----
 
 iQJHBAABCAAxFiEEiOrDCAFJzPfAjcif3SOs138+s6EFAl++a2kTHHRyZWRpbmdA
 bnZpZGlhLmNvbQAKCRDdI6zXfz6zoVFkEACQ3FzWZJA4vKXb/O/s6T02zaA3f3oD
 csBB5rEJdP2dYtVoNM0XPaMXzJzHILqjK2gz6QmGfV9LuH4pCangQewa4wnA5QJ1
 Ux6WApKTzTiHxJsiLz3CxPlYOTO5KNFHDFl58Qvhoaghzq4IO/szrWpQLWs9s4Vp
 xV6XcPi8uINBD2HjzeG7F3LJRQijkbI2kic1A3cEJ0rL/iq+yaLsCG1UCubzBQv/
 7cdpPdHOThRvsdfXDmzeFRmwr7EIngPHdBHNDS4nK3TYeiEstJyPFw0ix1ezEH0G
 VtRQIJURPHuXk43ABisnjiVy7qUEmQL2204yaCWMKjUaBg9hmtjFGCLFOoOrSNlC
 6t5LNRErbVW7xJWg8jbKsQPLiWjrUXW7FWYv/padMSTpyB/o6won7Bm5vbngHuwD
 /euY0Mu9HEgjaItHiHCO5akPxZyc1vd1yazs6B49+HEzturlgBK6LOt2GGmqm2T6
 GP1VEsQ48/g3p7MiqH9e/TV4Y7YASGmSLLukSPRRE54BHXHiJngVGVcL20NcjGox
 3EZgFjZqQZci37/y47oLanAooBpyoeVVspbSPwSmnnP0msrLO3F+m5IVghMVtNjx
 JquLDPYSxLJQSuL93iQMyXkVrJzulJvWW1Rnu5a1MaUsxTb2Yuj9WWR9GjdoQS0S
 Dg3ORazr0COvUw==
 =+GCH
 -----END PGP SIGNATURE-----

Merge tag 'tegra-for-5.10-arm64-dt-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/fixes

arm64: tegra: Device tree fixes for v5.10-rc6

This contains a couple of fixes to device trees. Among other things,
this restores suspend/resume on Jetson TX2 and makes USB OTG work on
Jetson TX1.

* tag 'tegra-for-5.10-arm64-dt-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux:
  arm64: tegra: Fix Tegra234 VDK node names
  arm64: tegra: Wrong AON HSP reg property size
  arm64: tegra: Fix USB_VBUS_EN0 regulator on Jetson TX1
  arm64: tegra: Correct the UART for Jetson Xavier NX
  arm64: tegra: Disable the ACONNECT for Jetson TX2

Link: https://lore.kernel.org/r/20201125170306.1095734-1-thierry.reding@gmail.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2020-11-26 22:08:01 +01:00
Arnd Bergmann 3a18293e4a NXP/FSL SoC driver fix for 5.10
DPAA2 DPIO driver
 - Fix non-static cpumask for irq affinity setting
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEhb3UXAyxp6UQ0v6khtxQDvusFVQFAl+9rLUACgkQhtxQDvus
 FVQyXhAAvbV5u+hwJaSPFm2ADFjbycUdEjPSwjc3akgngXzkBLfnWE0HMf+HJPNw
 g/l6onNhhF9Pw4EkgSBFH+eH4liEnzjMlQ8tS5Na5ldrjIn3iC/8Oi5KDeNTA4zX
 whldXLEYmKiTPZgU6Bof7FXStTCCtG6OEYN49crKiOqLZUQ+FT7/ujTlMWqaA8tD
 aGpujGxuhfoOXJf2jG7HJU8hIRGWzAM8IticfI3xNuoYsL0gPR6Dcdn2pjiQf8hq
 PYQgY645+BQIyHvMhVpbe67Y5wPc3mLnD3cO6G1+zomrXjFNPv6BQwZ7Shirrhe/
 TxiIpyyIouR4yYg14d0t1Q0C1Wu9klot231KeEq3x9AL109NfzrDJdo1j0xNJINY
 MVosKKalQ7unx8Ewx/PDyRqg2cgfepO2gWRhsLXZD+Hb+wuQQjWDXxZdGhE68IOD
 K3oP6bU28/b4nTDDKZzej5+eWhKqcz5ahT70RA3XPr3I62zQ5M7nmhl+jNCKECBP
 J2h+llf5TiEpZPPrNi9Pbmt7qZdIJQBZxDdsSksMgqEseIC6SuvHSH8p1sYo7uu5
 4f/jZGfEWwVWfTZYefMMQpe1VEaaPZ4eKcmNIo2ig4SJTG3wmzp/kDWsGkRBuzht
 BFQf0CTBvA+ozT3XuVuXQ1ROpoL0wIe+GduQY+ChZ74XBW2zC7w=
 =oRCF
 -----END PGP SIGNATURE-----

Merge tag 'soc-fsl-fix-v5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/leo/linux into arm/fixes

NXP/FSL SoC driver fix for 5.10

DPAA2 DPIO driver
- Fix non-static cpumask for irq affinity setting

* tag 'soc-fsl-fix-v5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/leo/linux:
  soc: fsl: dpio: Get the cpumask through cpumask_of(cpu)

Link: https://lore.kernel.org/r/20201125165922.15487-1-leoyang.li@nxp.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2020-11-26 22:07:22 +01:00
Arnd Bergmann dbae2736fd arm64: soc: ZynqMP SoC fixes for v5.10-rc6
- Fix SD dll reset issue by using proper macro
 - Fix PM feature checking for Xilinx Versal SoC
 -----BEGIN PGP SIGNATURE-----
 
 iF0EABECAB0WIQQbPNTMvXmYlBPRwx7KSWXLKUoMIQUCX70VSQAKCRDKSWXLKUoM
 ISZ+AJ9IkZ3rto9BOpbuSUu2mZSG12hSBACgnY0S3UCCZ4G4RLbGrFPzvGUKTuM=
 =SwId
 -----END PGP SIGNATURE-----

Merge tag 'zynqmp-soc-fixes-for-v5.10-rc6' of https://github.com/Xilinx/linux-xlnx into arm/fixes

arm64: soc: ZynqMP SoC fixes for v5.10-rc6

- Fix SD dll reset issue by using proper macro
- Fix PM feature checking for Xilinx Versal SoC

* tag 'zynqmp-soc-fixes-for-v5.10-rc6' of https://github.com/Xilinx/linux-xlnx: (337 commits)
  firmware: xilinx: Use hash-table for api feature check
  firmware: xilinx: Fix SD DLL node reset issue
  Linux 5.10-rc4
  kvm: mmu: fix is_tdp_mmu_check when the TDP MMU is not in use
  afs: Fix afs_write_end() when called with copied == 0 [ver #3]
  ocfs2: initialize ip_next_orphan
  panic: don't dump stack twice on warn
  hugetlbfs: fix anon huge page migration race
  mm: memcontrol: fix missing wakeup polling thread
  kernel/watchdog: fix watchdog_allowed_mask not used warning
  reboot: fix overflow parsing reboot cpu number
  Revert "kernel/reboot.c: convert simple_strtoul to kstrtoint"
  compiler.h: fix barrier_data() on clang
  mm/gup: use unpin_user_pages() in __gup_longterm_locked()
  mm/slub: fix panic in slab_alloc_node()
  mailmap: fix entry for Dmitry Baryshkov/Eremin-Solenikov
  mm/vmscan: fix NR_ISOLATED_FILE corruption on 64-bit
  mm/compaction: stop isolation if too many pages are isolated and we have pages to migrate
  mm/compaction: count pages and stop correctly during page isolation
  drm/nouveau/kms/nv50-: Use atomic encoder callbacks everywhere
  ...

Link: https://lore.kernel.org/r/fd5ab967-f3cf-95fb-7947-5477ff85f97e@monstr.eu
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2020-11-26 22:06:50 +01:00
Linus Torvalds 85a2c56cb4 Power management fix for 5.10-rc6
Fix a recently introduced build issue in the cpufreq SCMI
 driver (Sudeep Holla).
 -----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEE4fcc61cGeeHD/fCwgsRv/nhiVHEFAl+/23ISHHJqd0Byand5
 c29ja2kubmV0AAoJEILEb/54YlRxqr8P/0uRfqFXLAkFzVz4myQU7geuL7tL51DG
 G9pitNLq8j5kEF3UM74RstL/NZkg7p+VAyBFF8u9W42V2DAxfuyG6aG4rmDJbnBz
 pCvSk6RvIkneAwQ1lCYV47YRvK8rqkTcpFK5ZA2fq8oIm0bDAfkuLhsY/OoKNtJ9
 sJv/EVBpdQKA8g3H9EQzqOpUpGc6u7xG+zQEa6ZYVNpYaeSVYixsy+wRsjIktmxr
 KzmjYYYBByNz/j0jX+SIq8CJLdzDTjwsCjnh9TB1UTmr2Ii0ZCe222VTLp/uRFR/
 TrsUGuIl/XKdSRHZjiJ9RLubyjL1Z9C2Y47Va/zJ2u/C3k05baPXoU71Vdbu9hTU
 ++7hu2X2CnzCdmN0iQlifr6WchCM4NFAhWnQtbYLa+PPC/v+P2R1RYKCug5oiYnt
 LC8MiqBY7L2caMToTQZS7VYv+vG7Si9pQ6Nomyo+h+kwSAYKlLafiWsnNe2qL5y+
 WN+463tMb7aOaduigoprOn2XJlCvlw1SoKtVMsT2Yt+JinvoQLQXHUsxbd+AiKgq
 lIsmu7R3GO7X+EwN6FfWl83Dr5sD/tHcb5xvj42kHLiASSJ/xao94lFeUYnidzlW
 QBH5HavpbxgJQrKO4LsyozRqYvLv43kqjeqbGt8GoN3vzlr4ctau7cceR+30p/OX
 OTE54bBqod2D
 =QDUD
 -----END PGP SIGNATURE-----

Merge tag 'pm-5.10-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull power management fix from Rafael Wysocki:
 "Fix a recently introduced build issue in the cpufreq SCMI driver
  (Sudeep Holla)"

* tag 'pm-5.10-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  cpufreq: scmi: Fix build for !CONFIG_COMMON_CLK
2020-11-26 11:17:37 -08:00
Feng Tang 4df910620b mm: memcg: relayout structure mem_cgroup to avoid cache interference
0day reported one -22.7% regression for will-it-scale page_fault2
case [1] on a 4 sockets 144 CPU platform, and bisected to it to be
caused by Waiman's optimization (commit bd0b230fe1) of saving one
'struct page_counter' space for 'struct mem_cgroup'.

Initially we thought it was due to the cache alignment change introduced
by the patch, but further debug shows that it is due to some hot data
members ('vmstats_local', 'vmstats_percpu', 'vmstats') sit in 2 adjacent
cacheline (2N and 2N+1 cacheline), and when adjacent cache line prefetch
is enabled, it triggers an "extended level" of cache false sharing for
2 adjacent cache lines.

So exchange the 2 member blocks, while keeping mostly the original
cache alignment, which can restore and even enhance the performance,
and save 64 bytes of space for 'struct mem_cgroup' (from 2880 to 2816,
with 0day's default RHEL-8.3 kernel config)

[1]. https://lore.kernel.org/lkml/20201102091543.GM31092@shao2-debian/

Fixes: bd0b230fe1 ("mm/memcg: unify swap and memsw page counters")
Reported-by: kernel test robot <rong.a.chen@intel.com>
Signed-off-by: Feng Tang <feng.tang@intel.com>
Acked-by: Waiman Long <longman@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-11-26 09:35:49 -08:00
Pavel Begunkov af60470347 io_uring: fix files grab/cancel race
When one task is in io_uring_cancel_files() and another is doing
io_prep_async_work() a race may happen. That's because after accounting
a request inflight in first call to io_grab_identity() it still may fail
and go to io_identity_cow(), which migh briefly keep dangling
work.identity and not only.

Grab files last, so io_prep_async_work() won't fail if it did get into
->inflight_list.

note: the bug shouldn't exist after making io_uring_cancel_files() not
poking into other tasks' requests.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-11-26 08:50:21 -07:00
Yixian Liu 17475e104d RDMA/hns: Bugfix for memory window mtpt configuration
When a memory window is bound to a memory region, the local write access
should be set for its mtpt table.

Fixes: c7c2819140 ("RDMA/hns: Add MW support for hip08")
Link: https://lore.kernel.org/r/1606386372-21094-1-git-send-email-liweihang@huawei.com
Signed-off-by: Yixian Liu <liuyixian@huawei.com>
Signed-off-by: Weihang Li <liweihang@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
2020-11-26 10:57:32 -04:00
Wenpeng Liang ab6f7248cc RDMA/hns: Fix retry_cnt and rnr_cnt when querying QP
The maximum number of retransmission should be returned when querying QP,
not the value of retransmission counter.

Fixes: 99fcf82521 ("RDMA/hns: Fix the wrong value of rnr_retry when querying qp")
Fixes: 926a01dc00 ("RDMA/hns: Add QP operations support for hip08 SoC")
Link: https://lore.kernel.org/r/1606382977-21431-1-git-send-email-liweihang@huawei.com
Signed-off-by: Wenpeng Liang <liangwenpeng@huawei.com>
Signed-off-by: Weihang Li <liweihang@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
2020-11-26 10:57:32 -04:00
Wenpeng Liang ebed7b7ca4 RDMA/hns: Fix wrong field of SRQ number the device supports
The SRQ capacity is got from the firmware, whose field should be ended at
bit 19.

Fixes: ba6bb7e974 ("RDMA/hns: Add interfaces to get pf capabilities from firmware")
Link: https://lore.kernel.org/r/1606382812-23636-1-git-send-email-liweihang@huawei.com
Signed-off-by: Wenpeng Liang <liangwenpeng@huawei.com>
Signed-off-by: Weihang Li <liweihang@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
2020-11-26 10:57:32 -04:00
David Woodhouse d76b42e927 iommu/vt-d: Don't read VCCAP register unless it exists
My virtual IOMMU implementation is whining that the guest is reading a
register that doesn't exist. Only read the VCCAP_REG if the corresponding
capability is set in ECAP_REG to indicate that it actually exists.

Fixes: 3375303e82 ("iommu/vt-d: Add custom allocator for IOASID")
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Liu Yi L <yi.l.liu@intel.com>
Cc: stable@vger.kernel.org # v5.7+
Acked-by: Lu Baolu <baolu.lu@linux.intel.com>
Link: https://lore.kernel.org/r/de32b150ffaa752e0cff8571b17dfb1213fbe71c.camel@infradead.org
Signed-off-by: Will Deacon <will@kernel.org>
2020-11-26 14:50:24 +00:00
Hans de Goede c9aa128080 platform/x86: touchscreen_dmi: Add info for the Irbis TW118 tablet
Add touchscreen info for the Irbis TW118 tablet.

Reported-and-tested-by: russianneuromancer <russianneuromancer@ya.ru>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20201124110454.114286-1-hdegoede@redhat.com
2020-11-26 15:49:16 +01:00
Hans de Goede 0f511edc6a platform/x86: touchscreen_dmi: Add info for the Predia Basic tablet
Add touchscreen info for the Predia Basic tablet.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20201015194949.50566-1-hdegoede@redhat.com
2020-11-26 15:49:02 +01:00
Max Verevkin 8b205d3e1b platform/x86: intel-vbtn: Support for tablet mode on HP Pavilion 13 x360 PC
The Pavilion 13 x360 PC has a chassis-type which does not indicate it is
a convertible, while it is actually a convertible. Add it to the
dmi_switches_allow_list.

Signed-off-by: Max Verevkin <me@maxverevkin.tk>
Link: https://lore.kernel.org/r/20201124131652.11165-1-me@maxverevkin.tk
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2020-11-26 15:48:55 +01:00
Kaixu Xia 2a72c46ac4 platform/x86: toshiba_acpi: Fix the wrong variable assignment
The commit 78429e55e4 ("platform/x86: toshiba_acpi: Clean up
variable declaration") cleans up variable declaration in
video_proc_write(). Seems it does the variable assignment in the
wrong place, this results in dead code and changes the source code
logic. Fix it by doing the assignment at the beginning of the funciton.

Fixes: 78429e55e4 ("platform/x86: toshiba_acpi: Clean up variable declaration")
Reported-by: Tosk Robot <tencent_os_robot@tencent.com>
Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
Link: https://lore.kernel.org/r/1606024177-16481-1-git-send-email-kaixuxia@tencent.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2020-11-26 15:48:46 +01:00
Timo Witte 9e7a005ad5 platform/x86: acer-wmi: add automatic keyboard background light toggle key as KEY_LIGHTS_TOGGLE
Got a dmesg message on my AMD Renoir based Acer laptop:
"acer_wmi: Unknown key number - 0x84" when toggling keyboard
background light

Signed-off-by: Timo Witte <timo.witte@gmail.com>
Reviewed-by: "Lee, Chun-Yi" <jlee@suse.com>
Link: https://lore.kernel.org/r/20200804001423.36778-1-timo.witte@gmail.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2020-11-26 15:48:37 +01:00
Matthias Maier 80a8c3185f platform/x86: thinkpad_acpi: Whitelist P15 firmware for dual fan control
This commit enables dual fan control for the following new Lenovo
models: P15, P15v.

Signed-off-by: Matthias Maier <tamiko@43-1.org>
Link: https://lore.kernel.org/r/20201126000416.2459645-2-tamiko-ibm-acpi-devel@43-1.org
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2020-11-26 15:45:40 +01:00