Commit Graph

1234855 Commits

Author SHA1 Message Date
Viresh Kumar 711cbfc717 docs: rust: Clarify that 'rustup override' applies to build directory
'rustup override' is required to be set for the build directory and not
necessarily the kernel source tree (unless the build directory is its
subdir).

Clarify the same in the Quick Start guide.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Originally-pointed-out-by: Masahiro Yamada <masahiroy@kernel.org>
Link: https://github.com/Rust-for-Linux/linux/commit/f2238e7
Link: https://lore.kernel.org/r/e2b943eca92abebbf035447b3569f09a7176c770.1702366951.git.viresh.kumar@linaro.org
[ Reworded and fixed quotes for `--path` and `set`. ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2023-12-21 22:47:40 +01:00
Dirk Behme be412baf72 docs: rust: Add rusttest info
Searching the Rust kernel documentation all existing Rust Make
targets (rustavailable, rustfmt, rustfmtcheck, rustdoc and
rust-analyzer) are explicitly documented with their Make commands.
While the Make target rusttest is mentioned two times in the
existing documentation, it's Make command is not explicitly
documented, yet. Add a test section to document this.

While at it, add some info about the more important KUnit testing
too.

Reviewed-by: David Gow <davidgow@google.com>
Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com>
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Link: https://lore.kernel.org/r/20231212081313.226120-1-dirk.behme@de.bosch.com
[ Added "the", newline and quotes for `.config`. Expanded "repos". ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2023-12-21 22:47:40 +01:00
Miguel Ojeda 7583ce66dd docs: rust: remove `CC=clang` mentions
Nowadays all architectures except s390 recommend using `LLVM=1` instead of
`CC=clang`, and since commit a3c6bfba44 ("Documentation/llvm: refresh
docs") the Kbuild LLVM documentation makes `LLVM=1` the way to go:

    We want to encourage the use of ``LLVM=1`` rather than just
    ``CC=clang``. Make that suggestion "above the fold" and "front and
    center" in our docs.

In particular, that commit removes the examples with `CC=clang`.

Thus do the same in the Rust Quick Start guide, i.e. remove the `CC=clang`
mentions, especially since the architectures that have had their Rust
support upstreamed (or soon to be upstreamed) are all `LLVM=1` ones.
And perhaps by the time Rust is supported for s390 (or new architectures),
it may have moved to `LLVM=1` anyway. Otherwise, this can be added back
if needed (or perhaps an extra link to Documentation/kbuild/llvm.rst).

This should also help avoiding potential confusion around `CC=clang` [1].

Link: https://lore.kernel.org/rust-for-linux/6df6e8e5-8d5b-4d3d-91b5-bc0e90c424ea@nvidia.com/ [1]
Reviewed-by: Ariel Miculas <amiculas@cisco.com>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Reviewed-by: Justin Stitt <justinstitt@google.com>
Reviewed-by: John Hubbard <jhubbard@nvidia.com>
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Link: https://lore.kernel.org/r/20231215124751.175191-1-ojeda@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2023-12-21 22:47:09 +01:00
Miguel Ojeda bc2e7d5c29 rust: support `srctree`-relative links
Some of our links use relative paths in order to point to files in the
source tree, e.g.:

    //! C header: [`include/linux/printk.h`](../../../../include/linux/printk.h)
    /// [`struct mutex`]: ../../../../include/linux/mutex.h

These are problematic because they are hard to maintain and do not support
`O=` builds.

Instead, provide support for `srctree`-relative links, e.g.:

    //! C header: [`include/linux/printk.h`](srctree/include/linux/printk.h)
    /// [`struct mutex`]: srctree/include/linux/mutex.h

The links are fixed after `rustdoc` generation to be based on the absolute
path to the source tree.

Essentially, this is the automatic version of Tomonori's fix [1],
suggested by Gary [2].

Suggested-by: Gary Guo <gary@garyguo.net>
Reported-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
Closes: https://lore.kernel.org/r/20231026.204058.2167744626131849993.fujita.tomonori@gmail.com [1]
Fixes: 48fadf4400 ("docs: Move rustdoc output, cross-reference it")
Link: https://lore.kernel.org/rust-for-linux/20231026154525.6d14b495@eugeo/ [2]
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Link: https://lore.kernel.org/r/20231215235428.243211-1-ojeda@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2023-12-21 20:54:17 +01:00
Boqun Feng 0a7f5ba73e rust: sync: Makes `CondVar::wait()` an uninterruptible wait
Currently, `CondVar::wait()` is an interruptible wait, and this is
different than `wait_event()` in include/linux/wait.h (which is an
uninterruptible wait). To avoid confusion between different APIs on the
interruptible/uninterruptible, make `CondVar::wait()` an uninterruptible
wait same as `wait_event()`, also rename the old `wait()` to
`CondVar::wait_interruptible()`.

Spotted-by: Tiago Lam <tiagolam@gmail.com>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Tiago Lam <tiagolam@gmail.com>
Link: https://lore.kernel.org/r/20231214200421.690629-1-boqun.feng@gmail.com
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2023-12-21 20:54:17 +01:00
Miguel Ojeda 80fe9e5151 rust: upgrade to Rust 1.74.1
This is the next upgrade to the Rust toolchain, from 1.73.0 to 1.74.1
(i.e. the latest) [1].

See the upgrade policy [2] and the comments on the first upgrade in
commit 3ed03f4da0 ("rust: upgrade to Rust 1.68.2").

# Unstable features

No unstable features (that we use) were stabilized.

Therefore, the only unstable features allowed to be used outside the
`kernel` crate are still `new_uninit,offset_of`, though other code to
be upstreamed may increase the list (e.g. `offset_of` was added recently).

Please see [3] for details.

# Other improvements

Rust 1.74.0 allows to use `#[repr(Rust)]` explicitly [4], which can be
useful to be explicit about particular cases that would normally use
e.g. the C representation, such as silencing lints like the upcoming
additions we requested [5] to the `no_mangle_with_rust_abi` Clippy lint
(which in turn triggered the `#[repr(Rust)]` addition).

Rust 1.74.0 includes a fix for one of the false negative cases we reported
in Clippy's `disallowed_macros` lint [6] that we would like to use in
the future.

Rust 1.74.1 fixes an ICE that the Apple AGX GPU driver was hitting [7].

# Required changes

For this upgrade, no changes were required (i.e. on our side).

# `alloc` upgrade and reviewing

The vast majority of changes are due to our `alloc` fork being upgraded
at once.

There are two kinds of changes to be aware of: the ones coming from
upstream, which we should follow as closely as possible, and the updates
needed in our added fallible APIs to keep them matching the newer
infallible APIs coming from upstream.

Instead of taking a look at the diff of this patch, an alternative
approach is reviewing a diff of the changes between upstream `alloc` and
the kernel's. This allows to easily inspect the kernel additions only,
especially to check if the fallible methods we already have still match
the infallible ones in the new version coming from upstream.

Another approach is reviewing the changes introduced in the additions in
the kernel fork between the two versions. This is useful to spot
potentially unintended changes to our additions.

To apply these approaches, one may follow steps similar to the following
to generate a pair of patches that show the differences between upstream
Rust and the kernel (for the subset of `alloc` we use) before and after
applying this patch:

    # Get the difference with respect to the old version.
    git -C rust checkout $(linux/scripts/min-tool-version.sh rustc)
    git -C linux ls-tree -r --name-only HEAD -- rust/alloc |
        cut -d/ -f3- |
        grep -Fv README.md |
        xargs -IPATH cp rust/library/alloc/src/PATH linux/rust/alloc/PATH
    git -C linux diff --patch-with-stat --summary -R > old.patch
    git -C linux restore rust/alloc

    # Apply this patch.
    git -C linux am rust-upgrade.patch

    # Get the difference with respect to the new version.
    git -C rust checkout $(linux/scripts/min-tool-version.sh rustc)
    git -C linux ls-tree -r --name-only HEAD -- rust/alloc |
        cut -d/ -f3- |
        grep -Fv README.md |
        xargs -IPATH cp rust/library/alloc/src/PATH linux/rust/alloc/PATH
    git -C linux diff --patch-with-stat --summary -R > new.patch
    git -C linux restore rust/alloc

Now one may check the `new.patch` to take a look at the additions (first
approach) or at the difference between those two patches (second
approach). For the latter, a side-by-side tool is recommended.

Link: https://github.com/rust-lang/rust/blob/stable/RELEASES.md#version-1741-2023-12-07 [1]
Link: https://rust-for-linux.com/rust-version-policy [2]
Link: https://github.com/Rust-for-Linux/linux/issues/2 [3]
Link: https://github.com/rust-lang/rust/pull/114201 [4]
Link: https://github.com/rust-lang/rust-clippy/issues/11219 [5]
Link: https://github.com/rust-lang/rust-clippy/issues/11431 [6]
Link: https://github.com/rust-lang/rust/issues/117976#issuecomment-1822225691 [7]
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Tested-by: David Gow <davidgow@google.com>
Link: https://lore.kernel.org/r/20231214092958.377061-1-ojeda@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2023-12-21 19:40:26 +01:00
Matthew Maurer 71479eee9d rust: Suppress searching builtin sysroot
By default, if Rust is passed `--target=foo` rather than a target.json
file, it will infer a default sysroot if that component is installed. As
the proposed aarch64 support [1] uses `aarch64-unknown-none` rather than a
target.json file, this is needed [2] to prevent rustc from being confused
between the custom kernel sysroot and the pre-installed one.

[ Miguel: Applied Boqun's extra case (for `rusttest`) and reworded to add
  links to the arm64 patch series discussion. In addition, fixed the
  `rustdoc` target too (which requires a conditional since `cmd_rustdoc`
  is also used for host crates like `macros`). ]

Signed-off-by: Matthew Maurer <mmaurer@google.com>
Tested-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Link: https://lore.kernel.org/rust-for-linux/20231020155056.3495121-1-Jamie.Cunliffe@arm.com/ [1]
Link: https://lore.kernel.org/rust-for-linux/CAGSQo01pOixiPXkW867h4vPUaAjtKtHGKhkV-rpifJvKxAf4Ww@mail.gmail.com/ [2]
Link: https://lore.kernel.org/r/20231031201752.1189213-1-mmaurer@google.com
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2023-12-14 20:14:01 +01:00
Benno Lossin 88c2e1169f rust: macros: improve `#[vtable]` documentation
Traits marked with `#[vtable]` need to provide default implementations
for optional functions. The C side represents these with `NULL` in the
vtable, so the default functions are never actually called. We do not
want to replicate the default behavior from C in Rust, because that is
not maintainable. Therefore we should use `build_error` in those default
implementations. The error message for that is provided at
`kernel::error::VTABLE_DEFAULT_ERROR`.

Signed-off-by: Benno Lossin <benno.lossin@proton.me>
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Reviewed-by: Andreas Hindborg <a.hindborg@samsung.com>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Finn Behrens <me@kloenk.dev>
Link: https://lore.kernel.org/r/20231026201855.1497680-1-benno.lossin@proton.me
[ Wrapped paragraph to 80 as requested and capitalized sentence. ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2023-12-14 20:14:01 +01:00
Trevor Gross 2dc318ea96 rust: macros: update 'paste!' macro to accept string literals
Enable combining identifiers with literals in the 'paste!' macro. This
allows combining user-specified strings with affixes to create
namespaced identifiers.

This sample code:

    macro_rules! m {
        ($name:lit) => {
            paste!(struct [<_some_ $name _struct_>] {})
        }
    }

    m!("foo_bar");

Would previously cause a compilation error. It will now generate:

    struct _some_foo_bar_struct_ {}

Signed-off-by: Trevor Gross <tmgross@umich.edu>
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Reviewed-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Reviewed-by: Gary Guo <gary@garyguo.net>
Link: https://lore.kernel.org/r/20231118013959.37384-1-tmgross@umich.edu
[ Added `:` before example block. ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2023-12-14 20:14:01 +01:00
Gary Guo 743766565d rust: bindings: rename const binding using sed
Currently, for `const`s that bindgen doesn't recognise, we define a
helper constant with

    const <TYPE> BINDINGS_<NAME> = <NAME>;

in `bindings_helper.h` and then we put

    pub const <NAME>: <TYPE> = BINDINGS_<NAME>;

in `bindings/lib.rs`. This is fine since we currently only have 3
constants that are defined this way, but is going to be more annoying
when more constants are added since every new constant needs to be
defined in two places.

This patch changes the way we define constant helpers to

    const <TYPE> RUST_CONST_HELPER_<NAME> = <NAME>;

and then use `sed` to postprocess Rust code generated by bindgen to
remove the distinct prefix, so users of the `bindings` crate can refer
to the name directly.

Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Reviewed-by: Andreas Hindborg <a.hindborg@samsung.com>
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Signed-off-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Link: https://lore.kernel.org/r/20231104145700.2495176-1-gary@garyguo.net
[ Reworded for typos. ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2023-12-14 20:14:01 +01:00
Matthew Maurer bad098d768 rust: Ignore preserve-most functions
Neither bindgen nor Rust know about the preserve-most calling
convention, and Clang describes it as unstable. Since we aren't using
functions with this calling convention from Rust, blocklist them.

These functions are only added to the build when list hardening is
enabled, which is likely why others didn't notice this yet.

Signed-off-by: Matthew Maurer <mmaurer@google.com>
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Link: https://lore.kernel.org/r/20231031201945.1412345-1-mmaurer@google.com
[ Used Markdown for consistency with the other comments in the file. ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2023-12-13 01:09:55 +01:00
Masahiro Yamada dc92ac9f63 rust: replace <linux/module.h> with <linux/export.h> in rust/exports.c
<linux/export.h> is the right header to include for using
EXPORT_SYMBOL_GPL. <linux/module.h> includes much more bloat.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Link: https://lore.kernel.org/r/20231124142617.713096-1-masahiroy@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2023-12-13 01:09:55 +01:00
Asahi Lina c3f41b0030 rust: kernel: str: Implement Debug for CString
Make it possible to use a `CString` with the `pr_*` macros directly. That
is, instead of:

    pr_debug!("trying to open {:?}\n", &*filename);

we can now write:

    pr_debug!("trying to open {:?}\n", filename);

Signed-off-by: Asahi Lina <lina@asahilina.net>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Link: https://lore.kernel.org/r/20230714-cstring-debug-v1-1-4e7c3018dd4f@asahilina.net
[ Reworded to use Alice's commit message as discussed. ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2023-12-13 00:13:49 +01:00
Linus Torvalds a39b6ac378 Linux 6.7-rc5 2023-12-10 14:33:40 -08:00
Linus Torvalds 3a87498869 - Make sure tasks are thawed exactly and only once to avoid their state
getting corrupted
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEzv7L6UO9uDPlPSfHEsHwGGHeVUoFAmV1nDUACgkQEsHwGGHe
 VUqC3Q/9GF3IjEzKZAwTqw9ir2Nq9fFKkDZVT1ZCkXcg3bc6t5Dp68NcMPEoPdNE
 6ONaEwKhZxqPyivI7u1ExdZnHYDMRWolZmjs/x19c+g3Zo6QzT+6blMdoWvl6nV2
 RD3macPt5w5bcJ8ugSM4ekTQgo4nPU5VhBS52zDARx0W9ufpIk3YKmxmVQjhuV5J
 z/nfewUuUtAHDxnbF8pRvN8WoSg15Z5iERksdcj8Wagjx79cMAR6liuauJNkj9dP
 lldG69ODdJeZc9L/SUkLEgYPVaq+G6BOKgWXbzeiRM9LedHN3iQlT9JUttLHN383
 NdTbQ6lboViP1O64WuoqJFVDYvY0DvVLUll4URywfT3lPbISGvxhg0Xj+4E8F5W9
 A9pB9TDZwRXwrNuRLksaY0v/Glfo7eUr6252aDbgrUovJCDOwfRB+pI4ywpfoL/+
 2eKkJR1mUjoCXirkbYjcm7EhnTSKxiKmCYK7pyol3fJCsK/4bQF7mJ4UyDFIB3Na
 VXVD41KkMsaAdIQp4HbdduYaPSCQvQee6ahtobQwcxyBWGXRzurTw4ubHlzSeN9F
 fIfxF9PfSY+So2J9IrU1uYKPvfbUWfU3b1urQPhPvVlbVlZmfG579ek6+4bhagsg
 UztDRvv9lCxvBskruIMfelAduXsDkDi0UwJ0/TXlPnQGzYlDdeI=
 =07a8
 -----END PGP SIGNATURE-----

Merge tag 'sched_urgent_for_v6.7_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull scheduler fix from Borislav Petkov:

 - Make sure tasks are thawed exactly and only once to avoid their state
   getting corrupted

* tag 'sched_urgent_for_v6.7_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  freezer,sched: Do not restore saved_state of a thawed task
2023-12-10 11:09:16 -08:00
Linus Torvalds 537ccb5d28 - Make sure perf event size validation is done on every event in the
group
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEzv7L6UO9uDPlPSfHEsHwGGHeVUoFAmV1mfQACgkQEsHwGGHe
 VUrW9w/9EVMf1/cu1rY4XN68NbOgdfoic2oPan60WJwiYhYto9uA1quR4Q8ziwVh
 UbuO4e0up1ZCUzutZGFnx0ZHrlQIb0/YTQj8kDKX6m7g8s2Vers7YbkRwneDsNqA
 JDp58yGXdc1TipVYrKqa0leNrezvaEeoVFPIPKoelzi3673xrlslRseJ/n7vJd4u
 SnMjT7LQZIlEe/pecz01nHAo6SSwfI/Ynh2WSorHnhSTuE5gMUzJwBYSXvpZ2gyg
 207keTiIcrvxgT+a32NMeEYsFFFvpYKFHI5nxxV1pB8AWXdWaNpuYHNItTDIh81D
 fSb8hu+EpNSWtZYzXl/esgULfMgHXez+4VknTpX/vsbfcV1Yif4aHlZP8tgP6gZ5
 QyA2NMA5vJypjzLsAgCyZjpTyEVPYQ3f4+iYg4EGlMlgLgoXtHIV+zP765SzDVkC
 yPO4xVf+Ypo9AKcGKjBrxyMlRq40zos40k6l2yOjSUlTE2IfOLMhjgVHeLcgD+uv
 E9pi0/KtfGvrm3nWgIhDtcvd5Jg6vrilaRWl9bAN6g6xgaqLPXuIZbOjPaRpKSNa
 L32XBMg5fUt4eesZv458qu4Zw1ybHCd6qoe3OieFzW5ocR61O946MHX3kkbpmsWC
 PzH1mBsPa3F8/utJ06p+9pank3M5yKHdkDPQXfSvImuZ3DPKEGI=
 =QxHj
 -----END PGP SIGNATURE-----

Merge tag 'perf_urgent_for_v6.7_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull perf event fix from Borislav Petkov:

 - Make sure perf event size validation is done on every event in the
   group

* tag 'perf_urgent_for_v6.7_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  perf: Fix perf_event_validate_size()
2023-12-10 11:03:15 -08:00
Linus Torvalds 5412fed784 - Add a forgotten CPU vendor check in the AMD microcode post-loading
callback so that the callback runs only on AMD
 
 - Make sure SEV-ES protocol negotiation happens only once and on the BSP
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEzv7L6UO9uDPlPSfHEsHwGGHeVUoFAmV1l4MACgkQEsHwGGHe
 VUoESQ//WxIdMb/ATNtBRXEM3GRzd/X2he7kXRGVSUeJZMxEOnpVEmo4NtAzXwI7
 E2yOk4EJ6QlN+p6/eea5X2FJ5IkpiDKj1jVvU6NxTJiF2I5t1XUjdcXiv05Is+bP
 5Cx1ysaznMQYvZUler15NkbLCZvVX5/1V9FthnLpS1d1cvem0NKoH+hVUQHkdHbo
 /QNzEy+dyii8mp+t6D4QEfjq2Ab7bRbx1FufJcvHy9tFt3u8JsuWI/kHLm5Jk3VN
 n7Efynluw1wJC3l/18QzrxUCL5LVwrs2LxC0GH42dq9vBp0EJclgsBOh+43cm+Ey
 ffowP3uJxayngdigRA4ANpfbJL7GHjEtoYlxk/ooI4l2ccNtSdCXn86UVI9q3BiT
 60j/qV9r/o0Wl46/BVrT6SXhHlcKm4YchUa53NbOHcU3hBpUuM78WAcqs+63voMq
 kFqXQVihlJWYYytyFKw6Ng7O6SHR/SMC3uSygG0q2KebiUlVMZSheJin2Od+shhC
 skD0z2EUzUGuNICFHuxwA2uu6jr/KvkEwDfjczwdE2haUfZLCnOfTjxZmqBbuzJ6
 l7lfGjBCpGGtGettjrM8WAuHnL6MzNDI2jVDV3K6bzqQVzk9wjFQjIG9X7c8XjN/
 E2IyQxNuiIKVj3GfFOVM9lgJ4C8qwNDa2A46Kad2dKHioiFfMuM=
 =uIo2
 -----END PGP SIGNATURE-----

Merge tag 'x86_urgent_for_v6.7_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 fixes from Borislav Petkov:

 - Add a forgotten CPU vendor check in the AMD microcode post-loading
   callback so that the callback runs only on AMD

 - Make sure SEV-ES protocol negotiation happens only once and on the
   BSP

* tag 'x86_urgent_for_v6.7_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/CPU/AMD: Check vendor in the AMD microcode callback
  x86/sev: Fix kernel crash due to late update to read-only ghcb_version
2023-12-10 10:53:55 -08:00
Linus Torvalds 0aea22c7ab Generic:
* Set .owner for various KVM file_operations so that files refcount the
   KVM module until KVM is done executing _all_ code, including the last
   few instructions of kvm_put_kvm().  And then revert the misguided
   attempt to rely on "struct kvm" refcounts to pin KVM-the-module.
 
 ARM:
 
 * Do not redo the mapping of vLPIs, if they have already been mapped
 
 s390:
 
 * Do not leave bits behind in PTEs
 
 * Properly catch page invalidations that affect the prefix of a nested
   guest
 
 x86:
 
 * When checking if a _running_ vCPU is "in-kernel", i.e. running at CPL0,
   get the CPL directly instead of relying on preempted_in_kernel (which
   is valid if and only if the vCPU was preempted, i.e. NOT running).
 
 * Fix a benign "return void" that was recently introduced.
 
 Selftests:
 
 * Makefile tweak for dependency generation
 
 * -Wformat fix
 -----BEGIN PGP SIGNATURE-----
 
 iQFIBAABCAAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAmVzhWMUHHBib256aW5p
 QHJlZGhhdC5jb20ACgkQv/vSX3jHroMd3QgArPrc1tHKb5RAv3/OGxUhgmmKcYFz
 AERbxrzcEv25MjCy6wfb+WzOTud/7KM113oVwHpkWbPaOdR/NteCeNrypCOiFnxB
 BzKOdm23A8UmjgFlwYpIlukmn51QT2iMWfIQDetDboRpRPlIZ6AOQpIHph99K0J1
 xMlXKbd4eaeIS+FoqJGD2wlKDkMZmrQD1SjndLp7xtPjRBZQzVTcMg/fKJNcDLAg
 xIfecCeeU4/lJ0fQlnnO5a4L3gCzJnSGLKYvLgBkX4sC1yFr959WAnqSn8mb+1wT
 jQtsmCg7+GCuNF5mn4nF/YnnuD7+xgbpGKVGlHhKCmmvmbi74NVm5SBNgA==
 =aZLl
 -----END PGP SIGNATURE-----

Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm

Pull kvm fixes from Paolo Bonzini:
 "Generic:

   - Set .owner for various KVM file_operations so that files refcount
     the KVM module until KVM is done executing _all_ code, including
     the last few instructions of kvm_put_kvm(). And then revert the
     misguided attempt to rely on "struct kvm" refcounts to pin
     KVM-the-module.

  ARM:

   - Do not redo the mapping of vLPIs, if they have already been mapped

  s390:

   - Do not leave bits behind in PTEs

   - Properly catch page invalidations that affect the prefix of a
     nested guest

  x86:

   - When checking if a _running_ vCPU is "in-kernel", i.e. running at
     CPL0, get the CPL directly instead of relying on
     preempted_in_kernel (which is valid if and only if the vCPU was
     preempted, i.e. NOT running).

   - Fix a benign "return void" that was recently introduced.

  Selftests:

   - Makefile tweak for dependency generation

   - '-Wformat' fix"

* tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
  KVM: SVM: Update EFER software model on CR0 trap for SEV-ES
  KVM: selftests: add -MP to CFLAGS
  KVM: selftests: Actually print out magic token in NX hugepages skip message
  KVM: x86: Remove 'return void' expression for 'void function'
  Revert "KVM: Prevent module exit until all VMs are freed"
  KVM: Set file_operations.owner appropriately for all such structures
  KVM: x86: Get CPL directly when checking if loaded vCPU is in kernel mode
  KVM: arm64: GICv4: Do not perform a map to a mapped vLPI
  KVM: s390/mm: Properly reset no-dat
  KVM: s390: vsie: fix wrong VIR 37 when MSO is used
2023-12-10 10:46:46 -08:00
Linus Torvalds c527f5606a powerpc fixes for 6.7 #4
- Fix stack teardown in ftrace_no_trace, seen as crashes doing CPU hotplug
    while ftrace is active.
 
 Thanks to: Naveen N Rao
 -----BEGIN PGP SIGNATURE-----
 
 iQJHBAABCAAxFiEEJFGtCPCthwEv2Y/bUevqPMjhpYAFAmV1AeMTHG1wZUBlbGxl
 cm1hbi5pZC5hdQAKCRBR6+o8yOGlgB8KEACfm0gd6Z0lSkT8dOO+/aw6SdVUhDHy
 eX0rJt5YSQ14Ob3V+SWOqAa2POkPSs+55MKyB5VmVi2Y3cbWYeXCrLyBEeDFL9Nz
 wFSPI8GhqpAOaDwkmvO7owHfXBQTScmKFBAqCMuoIw+wwGphw+AWiTcCfPkO0r6H
 m/xZ3duc14Jv7wqDTP3FvmYvrPS5ENf6Wt+nqongURCjxKdaTiZr1gbTISq4er6Q
 sQnnX6rLBDQi2aBJVPDV3yJtUTtAZ/MnUyy/fVQVt44hA+BYwRCPlW9j07bC/R+X
 pC3upUHjxNFCT1ePe/pd4yzCZdjGqIx7nTrxyxm/UMRaI7KOLTybw+DEATh2jfMY
 HRtYrs7JEX6qzosk14BfHygZZzXRaVkYzj3n3JOuLJY95O1d2YJBJW+1WyIwozCD
 RFdQf3bDmVAskfMYdfasmFjHAzOtBe7TJUyLIZErfWFltbDx9g6fsBRw3B1hO4Im
 IpcSg7tLhPdu7QuqY7asEyTD0Eg7HoLTCFn42RrfJPQkTT0Zvkq281F/zKWUQTSg
 lX+eVDpPkODY7nnVdkOJ9lwbC/Py4A1tvZ+KgnaHi9fGYKwKzp4HBvuDTeYMn740
 OPJ6Q+e48TgmMflM6ln/FGZFMCUxc5Nzu6taQ8bmmXv+IdHoZFG2uosh0RKux912
 JEgbJFcXk1slvw==
 =RLG4
 -----END PGP SIGNATURE-----

Merge tag 'powerpc-6.7-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux

Pull powerpc fix from Michael Ellerman:

 - Fix stack teardown in ftrace_no_trace, seen as crashes doing CPU
   hotplug while ftrace is active.

   Thanks to Naveen N Rao.

* tag 'powerpc-6.7-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
  powerpc/ftrace: Fix stack teardown in ftrace_no_trace
2023-12-09 19:32:35 -08:00
Linus Torvalds 99d4cf7659 gpio fixes for v6.7-rc5
- fix an error path after a failed export in sysfs code
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEFp3rbAvDxGAT0sefEacuoBRx13IFAmV0wIYACgkQEacuoBRx
 13Jt5A//dcrJanDY/ydioCg7FxGWPktQVsquFWELpT+rzVNxGdUTmE/pn3o5axSE
 +VdwUg6L4kLO85TZkzo3wvGVgf9gSYDXu/sgBRilF9OTmAPCoZrAjMfIYFEelWCs
 n/dk2VfdG+Hbf5S1JuN0svUAmqzW6xrtGXE5enxLPqexWuB+YFhnUmjWZlIMxHYj
 MVATWENwFnzl00K1ApXH/Nt0RHa/FRMkTOr3pa7C21tL9s6c4KKq0wLwR9vYLA2e
 7wMLKgKhL5jRnjx7PgHL3F/V1AEJzNlPFtmPzvIOz1IQBN5jpsbFfhaI/F6yLuKV
 bNT3rrKtMaNfvI/RmVXmTSNdhUg5tmL5y+mC0CBOnoUwVC1/DIlxro0PCO9HM+c0
 elACsdm531Wmz95hXmh6YeMaEgD+zehH/5N4pd1U67fSJsJuxjhbRByLhQpNMJCz
 AoppNb8zKYoPYOkl8MyCxLEje0dsAy3UFEYvnLTrTDx5UgxrgISDw2PqxFNzav20
 AgrQ8NJzLI2tQVyEhf5PZsozEmgNfKZYZYx93fUIVYys17Mfv5W8s2hr0AOVfinz
 V/cuqpkfWtATVbLmoBEc86raHz4KKegPs8Q/Kb10xmjtXh76k+Rap4V+/GQjb+Q5
 4mhGbttp1WUaY/BVxWKd9myCwhn4sasEYgSUvI1CmVeDCDEqkK4=
 =Zzhe
 -----END PGP SIGNATURE-----

Merge tag 'gpio-fixes-for-v6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux

Pull gpio fix from Bartosz Golaszewski:

 - fix an error path after a failed export in sysfs code

* tag 'gpio-fixes-for-v6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux:
  gpiolib: sysfs: Fix error handling on failed export
2023-12-09 19:21:44 -08:00
Linus Torvalds 21b73ffcc6 USB fixes for 6.7-rc5
Here are some small USB fixes for 6.7-rc5 to resolve some reported
 issues.  Included in here are:
   - usb gadget f_hid, and uevent fix
   - xhci driver revert to resolve a much-reported issue
   - typec driver fix
 
 All of these have been in linux-next with no reported issues.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCZXRuNg8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+ymKGgCfSJN2sDwxrExpdUeNkQr0r1DCQpgAn0sx1j65
 uldkw4sWZwv7XuuYbx+b
 =aI4T
 -----END PGP SIGNATURE-----

Merge tag 'usb-6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

Pull USB fixes from Greg KH:
 "Here are some small USB fixes for 6.7-rc5 to resolve some reported
  issues. Included in here are:

   - usb gadget f_hid, and uevent fix

   - xhci driver revert to resolve a much-reported issue

   - typec driver fix

  All of these have been in linux-next with no reported issues"

* tag 'usb-6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
  usb: gadget: f_hid: fix report descriptor allocation
  Revert "xhci: Loosen RPM as default policy to cover for AMD xHC 1.1"
  usb: typec: class: fix typec_altmode_put_partner to put plugs
  USB: gadget: core: adjust uevent timing on gadget unbind
2023-12-09 12:54:58 -08:00
Linus Torvalds 0b5260904b Serial driver fixes for 6.7-rc4
Here are some small serial driver fixes for 6.7-rc4 to resolve some
 reported issues.  Included in here are:
   - pl011 dma support fix
   - sc16is7xx driver fix
   - ma35d1 console index fix
   - 8250 driver fixes for small issues
 
 All of these have been in linux-next with no reported issues.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCZXRtSQ8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+ymdlwCfWxCBdF8hkTzLRH8LvZbjXQgn8NkAn223XULM
 rLiYkIrqk2oQBVC7sC0X
 =ukSJ
 -----END PGP SIGNATURE-----

Merge tag 'tty-6.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty

Pull serial driver fixes from Greg KH:
 "Here are some small serial driver fixes for 6.7-rc4 to resolve some
  reported issues. Included in here are:

   - pl011 dma support fix

   - sc16is7xx driver fix

   - ma35d1 console index fix

   - 8250 driver fixes for small issues

  All of these have been in linux-next with no reported issues"

* tag 'tty-6.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
  serial: 8250_dw: Add ACPI ID for Granite Rapids-D UART
  serial: ma35d1: Validate console index before assignment
  ARM: PL011: Fix DMA support
  serial: sc16is7xx: address RX timeout interrupt errata
  serial: 8250: 8250_omap: Clear UART_HAS_RHR_IT_DIS bit
  serial: 8250_omap: Add earlycon support for the AM654 UART controller
  serial: 8250: 8250_omap: Do not start RX DMA on THRI interrupt
2023-12-09 12:49:22 -08:00
Linus Torvalds ca20f1622b Char/Misc driver fixes for 6.7-rc5
Here are some small fixes for 6.7-rc5 for a variety of small driver
 subsystems.  Included in here are:
   - debugfs revert for reported issue
   - greybus revert for reported issue
   - greybus fixup for endian build warning
   - coresight driver fixes
   - nvmem driver fixes
   - devcoredump fix
   - parport new device id
   - ndtest build fix
 
 All of these have ben in linux-next with no reported issues.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCZXRxAQ8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+ykphwCfaF0Dh6oajneYbo/pq70+an876uYAnjwALPfr
 g2EezrYYUAkkPACOd27t
 =q7gC
 -----END PGP SIGNATURE-----

Merge tag 'char-misc-6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc

Pull char / misc driver fixes from Greg KH:
 "Here are some small fixes for 6.7-rc5 for a variety of small driver
  subsystems. Included in here are:

   - debugfs revert for reported issue

   - greybus revert for reported issue

   - greybus fixup for endian build warning

   - coresight driver fixes

   - nvmem driver fixes

   - devcoredump fix

   - parport new device id

   - ndtest build fix

  All of these have ben in linux-next with no reported issues"

* tag 'char-misc-6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
  nvmem: Do not expect fixed layouts to grab a layout driver
  parport: Add support for Brainboxes IX/UC/PX parallel cards
  Revert "greybus: gb-beagleplay: Ensure le for values in transport"
  greybus: gb-beagleplay: Ensure le for values in transport
  greybus: BeaglePlay driver needs CRC_CCITT
  Revert "debugfs: annotate debugfs handlers vs. removal with lockdep"
  devcoredump: Send uevent once devcd is ready
  ndtest: fix typo class_regster -> class_register
  misc: mei: client.c: fix problem of return '-EOVERFLOW' in mei_cl_write
  misc: mei: client.c: return negative error code in mei_cl_write
  mei: pxp: fix mei_pxp_send_message return value
  coresight: ultrasoc-smb: Fix uninitialized before use buf_hw_base
  coresight: ultrasoc-smb: Config SMB buffer before register sink
  coresight: ultrasoc-smb: Fix sleep while close preempt in enable_smb
  Documentation: coresight: fix `make refcheckdocs` warning
  hwtracing: hisi_ptt: Don't try to attach a task
  hwtracing: hisi_ptt: Handle the interrupt in hardirq context
  hwtracing: hisi_ptt: Add dummy callback pmu::read()
  coresight: Fix crash when Perf and sysfs modes are used concurrently
  coresight: etm4x: Remove bogous __exit annotation for some functions
2023-12-09 12:44:10 -08:00
Linus Torvalds b10a3ccaf6 LoongArch fixes for v6.7-rc5
-----BEGIN PGP SIGNATURE-----
 
 iQJKBAABCAA0FiEEzOlt8mkP+tbeiYy5AoYrw/LiJnoFAmV0HTMWHGNoZW5odWFj
 YWlAa2VybmVsLm9yZwAKCRAChivD8uImehynD/9hWCwZySATfpOaa38pkqfiOrrK
 x5hUVKXkp0/OGksKJ39ocgrxlXgCHB12U6AyPUJfJd8LMVBLGOlSdtJKyc7nQBkM
 IgyY2L0qSb/T7zuOftLxEVnTWLOjgWBUJTJdZjJOTl6LZcW3pyCVK+DCGab1nWVh
 VmXgtV5jatk7fXGJfUsfIrtweAOwfZxgk1/jR2xo8l3qOHrC9nGHUPzaA1cxzJon
 ushqolnk4VCYgZuZHq1tPq87Pq2au2Biv2omO5/u6/eV2tcBirdYpg+zszlRbNbv
 czRQiyPXpLGxR0A21a9/9NHTVWm4YO9EoYvtOnoth2E0pXAphKI51Q07y1RZ/qep
 B2yn+Zt2cpe1Ujl+wF2z0I0v2vC+6UsTwWJf5PC/LT7ala381oAUW+RnYqlMnHQu
 CJw+EfNt0Oi1Vof/uD72/t4Q4cd41d0PLmHuoI4Ap79owAqm7IhgzFnrFp39tmSL
 F6LKymHx66EQleaVK9LSpAaFZqOiowWCc/mxvPIPhOoFnOEmBTN/2fihYwmf57He
 WlzYxN/GRAgkCJr5sCs1hUYAM6jCII1xGqs+HNPOfW+zLIFO7v1ZOweIPwGoalEl
 fi6hwHRV8CCRRy+VswjzLHatt9rLIItI19dnZX4BArqSZ6R/Z/wFPATfjY4OyyuO
 fhYlna7SWjt0qO0o6A==
 =UeJR
 -----END PGP SIGNATURE-----

Merge tag 'loongarch-fixes-6.7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson

Pull LoongArch fixes from Huacai Chen:
 "Preserve syscall nr across execve(), slightly clean up drdtime(), fix
  the Clang built zboot kernel, fix a stack unwinder bug and several bpf
  jit bugs"

* tag 'loongarch-fixes-6.7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson:
  LoongArch: BPF: Fix unconditional bswap instructions
  LoongArch: BPF: Fix sign-extension mov instructions
  LoongArch: BPF: Don't sign extend function return value
  LoongArch: BPF: Don't sign extend memory load operand
  LoongArch: Preserve syscall nr across execve()
  LoongArch: Set unwind stack type to unknown rather than set error flag
  LoongArch: Slightly clean up drdtime()
  LoongArch: Apply dynamic relocations for LLD
2023-12-09 12:25:56 -08:00
Linus Torvalds b8503b2157 - Fixes for broken Loongson firmware
- Fix lockdep splat
 - Fix FPU states when creating kernel threads
 -----BEGIN PGP SIGNATURE-----
 
 iQJOBAABCAA4FiEEbt46xwy6kEcDOXoUeZbBVTGwZHAFAmV0Kj8aHHRzYm9nZW5k
 QGFscGhhLmZyYW5rZW4uZGUACgkQeZbBVTGwZHAlWxAAnIPkgXTlsikLKzcja0zY
 hn0zq07FmLVJ/jhbivr2sUoBRbxZhML4fu0D+IKi3ctrDIn8ulZkUBKCYCmspq6T
 Y4XmwfUEb3iED5zdKe+GKkyxei6y5YQun8iIqDvcoLe80drv/Gqz3FRp+Sdt5i3n
 JuumkYopaYp00lLaSfPOFw48+Kmaqj3eFV0L3RVVTDq2G6lBGwK72h2PvlOlMYx2
 QFT15tS6mNdlUl+3VqxzD8i+lQ4ghCf9bI+WgQ9NNo9SXvVstz4FFU2FLoXvL6x9
 7Bqy/uJ2ICCMPmLy4/QMws49KT4nXzD46paNI3klzvVBfdhsI85j0Zk2VdtTX6mR
 lxXnwHal02vbJJOebQkC4ZEf8tdmeBE5loipFqSDR95BpQC/92S5povGVfbZPKDZ
 Bm8jJSFFH32sL4LPRnQEiZpcZx5h8MfJukb40CmVWaOQqePL1yJwEajBgSOKAfrl
 QiScuk0cXFqbaPfmXDOHZcmpb3Wc3Q/MbID3h7WFeVwXhauKI2Mr3Xa+cpGr7HrT
 LM1WkWlxhCQKMIRY8kEoUWCBjsKNNEGJgC13ta1d1iSVeGQstAVcxTrWpz2xGcbG
 T8tNL2+rhlhO64GZ6MtcJEUy72FTOzNglzCWICZFfwk61PJ6Nm7V9oqJXgSDNL9n
 beHitvV4I/e7PRqR8reTwAg=
 =u0rZ
 -----END PGP SIGNATURE-----

Merge tag 'mips-fixes_6.7_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux

Pull MIPS fixes from Thomas Bogendoerfer:

 - Fixes for broken Loongson firmware

 - Fix lockdep splat

 - Fix FPU states when creating kernel threads

* tag 'mips-fixes_6.7_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux:
  MIPS: kernel: Clear FPU states when setting up kernel threads
  MIPS: Loongson64: Handle more memory types passed from firmware
  MIPS: Loongson64: Enable DMA noncoherent support
  MIPS: Loongson64: Reserve vgabios memory on boot
  mips/smp: Call rcutree_report_cpu_starting() earlier
2023-12-09 12:22:20 -08:00
Linus Torvalds 9d3bc457a2 perf tools fixes for v6.7: 2nd batch
A random set of small bug fixes including:
 
  * Fix segfault on AmpereOne due to missing default metricgroup name.
  * Fix segfault on `perf list --json` due to NULL pointer.
 
 Signed-off-by: Namhyung Kim <namhyung@kernel.org>
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQSo2x5BnqMqsoHtzsmMstVUGiXMgwUCZXOIeAAKCRCMstVUGiXM
 g98/AP9XDmXoOJafRySAz3fCNt25YUMjjsSvtF6/gHK5VgRDmQEAkUjd97BilDfW
 UHWZ6IpYRZHchJ8kwGBYg9BDM8WTtwI=
 =NQQF
 -----END PGP SIGNATURE-----

Merge tag 'perf-tools-fixes-for-v6.7-2-2023-12-08' of git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools

Pull perf tools fixes from Namhyung Kim:
 "A random set of small bug fixes including:

   - Fix segfault on AmpereOne due to missing default metricgroup name

   - Fix segfault on `perf list --json` due to NULL pointer"

* tag 'perf-tools-fixes-for-v6.7-2-2023-12-08' of git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools:
  perf list: Fix JSON segfault by setting the used skip_duplicate_pmus callback
  perf vendor events arm64: AmpereOne: Add missing DefaultMetricgroupName fields
  perf metrics: Avoid segv if default metricgroup isn't set
2023-12-09 12:16:50 -08:00
Linus Torvalds 2099306c4e Six smb3 client fixes
-----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCgAdFiEE6fsu8pdIjtWE/DpLiiy9cAdyT1EFAmVzknIACgkQiiy9cAdy
 T1HIsgwAkpJsKz0ReQB0PDNGQ9/ZHnxhQ5V/E1sCtwbXeu50YffIo+hpABtkK8aK
 ViZAEgpcoO0kWzSr7zvPwxkykbDLV8pBXqvwHTg/KxXpxCEGt2VNCP5oOAFFp1IM
 8XpBkitB1rCuM6P6vJ5nmRK1gpwaGS/qwLWqROejvsouur/w/KfOH6bNEq/PMypo
 sUc7N5WP01grnh9/ipvgUBHSjKpWJFZ7Y2eRXirCXBMEHmosqbam0Fac6njYflLE
 4gc8YSrfxHaBqrgschAzcnwQrGY0lEy/UN9KpUOCKqGxP4ha45ni5t9foiCArhI5
 qzA7Ns//zqRcl+/A5DmJi8brvbHWnDzG4wQ5IyEm81w/8W5HqXt+9kGSxs6q8K0n
 MdVBq2eRl3untIRTXtMpp2xvPyAdKOuYZYfe27nv64Il2Xg3xUnh0viuX5M/BHBH
 kIqhMcvfFigdjYcgpgAuDeVXXmjUoW/9+Ybdc19d4ypsrxAGqMjQqLKgBLrAewDu
 DS80ihnn
 =LR8C
 -----END PGP SIGNATURE-----

Merge tag '6.7-rc4-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6

Pull smb client fixes from Steve French:
 "Six smb3 client fixes:

   - Fixes for copy_file_range and clone (cache invalidation and file
     size), also addresses an xfstest failure

   - Fix to return proper error if REMAP_FILE_DEDUP set (also fixes
     xfstest generic/304)

   - Fix potential null pointer reference with DFS

   - Multichannel fix addressing (reverting an earlier patch) some of
     the problems with enabling/disabling channels dynamically

  Still working on a followon multichannel fix to address another issue
  found in reconnect testing that will send next week"

* tag '6.7-rc4-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6:
  cifs: reconnect worker should take reference on server struct unconditionally
  Revert "cifs: reconnect work should have reference on server struct"
  cifs: Fix non-availability of dedup breaking generic/304
  smb: client: fix potential NULL deref in parse_dfs_referrals()
  cifs: Fix flushing, invalidation and file size with FICLONE
  cifs: Fix flushing, invalidation and file size with copy_file_range()
2023-12-09 12:10:56 -08:00
Tiezhu Yang e2f7b3d8b4 LoongArch: BPF: Fix unconditional bswap instructions
We can see that "bswap32: Takes an unsigned 32-bit number in either big-
or little-endian format and returns the equivalent number with the same
bit width but opposite endianness" in BPF Instruction Set Specification,
so it should clear the upper 32 bits in "case 32:" for both BPF_ALU and
BPF_ALU64.

[root@linux fedora]# echo 1 > /proc/sys/net/core/bpf_jit_enable
[root@linux fedora]# modprobe test_bpf

Before:
test_bpf: #313 BSWAP 32: 0x0123456789abcdef -> 0xefcdab89 jited:1 ret 1460850314 != -271733879 (0x5712ce8a != 0xefcdab89)FAIL (1 times)
test_bpf: #317 BSWAP 32: 0xfedcba9876543210 -> 0x10325476 jited:1 ret -1460850316 != 271733878 (0xa8ed3174 != 0x10325476)FAIL (1 times)

After:
test_bpf: #313 BSWAP 32: 0x0123456789abcdef -> 0xefcdab89 jited:1 4 PASS
test_bpf: #317 BSWAP 32: 0xfedcba9876543210 -> 0x10325476 jited:1 4 PASS

Fixes: 4ebf9216e7 ("LoongArch: BPF: Support unconditional bswap instructions")
Acked-by: Hengqi Chen <hengqi.chen@gmail.com>
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
2023-12-09 15:49:16 +08:00
Tiezhu Yang 772cbe948f LoongArch: BPF: Fix sign-extension mov instructions
We can see that "Short form of movsx, dst_reg = (s8,s16,s32)src_reg" in
include/linux/filter.h, additionally, for BPF_ALU64 the value of the
destination register is unchanged whereas for BPF_ALU the upper 32 bits
of the destination register are zeroed, so it should clear the upper 32
bits for BPF_ALU.

[root@linux fedora]# echo 1 > /proc/sys/net/core/bpf_jit_enable
[root@linux fedora]# modprobe test_bpf

Before:
test_bpf: #81 ALU_MOVSX | BPF_B jited:1 ret 2 != 1 (0x2 != 0x1)FAIL (1 times)
test_bpf: #82 ALU_MOVSX | BPF_H jited:1 ret 2 != 1 (0x2 != 0x1)FAIL (1 times)

After:
test_bpf: #81 ALU_MOVSX | BPF_B jited:1 6 PASS
test_bpf: #82 ALU_MOVSX | BPF_H jited:1 6 PASS

By the way, the bpf selftest case "./test_progs -t verifier_movsx" can
also be fixed with this patch.

Fixes: f48012f161 ("LoongArch: BPF: Support sign-extension mov instructions")
Acked-by: Hengqi Chen <hengqi.chen@gmail.com>
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
2023-12-09 15:49:16 +08:00
Hengqi Chen 5d47ec2e6f LoongArch: BPF: Don't sign extend function return value
The `cls_redirect` test triggers a kernel panic like:

  # ./test_progs -t cls_redirect
  Can't find bpf_testmod.ko kernel module: -2
  WARNING! Selftests relying on bpf_testmod.ko will be skipped.
  [   30.938489] CPU 3 Unable to handle kernel paging request at virtual address fffffffffd814de0, era == ffff800002009fb8, ra == ffff800002009f9c
  [   30.939331] Oops[#1]:
  [   30.939513] CPU: 3 PID: 1260 Comm: test_progs Not tainted 6.7.0-rc2-loong-devel-g2f56bb0d2327 #35 a896aca3f4164f09cc346f89f2e09832e07be5f6
  [   30.939732] Hardware name: QEMU QEMU Virtual Machine, BIOS unknown 2/2/2022
  [   30.939901] pc ffff800002009fb8 ra ffff800002009f9c tp 9000000104da4000 sp 9000000104da7ab0
  [   30.940038] a0 fffffffffd814de0 a1 9000000104da7a68 a2 0000000000000000 a3 9000000104da7c10
  [   30.940183] a4 9000000104da7c14 a5 0000000000000002 a6 0000000000000021 a7 00005555904d7f90
  [   30.940321] t0 0000000000000110 t1 0000000000000000 t2 fffffffffd814de0 t3 0004c4b400000000
  [   30.940456] t4 ffffffffffffffff t5 00000000c3f63600 t6 0000000000000000 t7 0000000000000000
  [   30.940590] t8 000000000006d803 u0 0000000000000020 s9 9000000104da7b10 s0 900000010504c200
  [   30.940727] s1 fffffffffd814de0 s2 900000010504c200 s3 9000000104da7c10 s4 9000000104da7ad0
  [   30.940866] s5 0000000000000000 s6 90000000030e65bc s7 9000000104da7b44 s8 90000000044f6fc0
  [   30.941015]    ra: ffff800002009f9c bpf_prog_846803e5ae81417f_cls_redirect+0xa0/0x590
  [   30.941535]   ERA: ffff800002009fb8 bpf_prog_846803e5ae81417f_cls_redirect+0xbc/0x590
  [   30.941696]  CRMD: 000000b0 (PLV0 -IE -DA +PG DACF=CC DACM=CC -WE)
  [   30.942224]  PRMD: 00000004 (PPLV0 +PIE -PWE)
  [   30.942330]  EUEN: 00000003 (+FPE +SXE -ASXE -BTE)
  [   30.942453]  ECFG: 00071c1c (LIE=2-4,10-12 VS=7)
  [   30.942612] ESTAT: 00010000 [PIL] (IS= ECode=1 EsubCode=0)
  [   30.942764]  BADV: fffffffffd814de0
  [   30.942854]  PRID: 0014c010 (Loongson-64bit, Loongson-3A5000)
  [   30.942974] Modules linked in:
  [   30.943078] Process test_progs (pid: 1260, threadinfo=00000000ce303226, task=000000007d10bb76)
  [   30.943306] Stack : 900000010a064000 90000000044f6fc0 9000000104da7b48 0000000000000000
  [   30.943495]         0000000000000000 9000000104da7c14 9000000104da7c10 900000010504c200
  [   30.943626]         0000000000000001 ffff80001b88c000 9000000104da7b70 90000000030e6668
  [   30.943785]         0000000000000000 9000000104da7b58 ffff80001b88c048 9000000003d05000
  [   30.943936]         900000000303ac88 0000000000000000 0000000000000000 9000000104da7b70
  [   30.944091]         0000000000000000 0000000000000001 0000000731eeab00 0000000000000000
  [   30.944245]         ffff80001b88c000 0000000000000000 0000000000000000 54b99959429f83b8
  [   30.944402]         ffff80001b88c000 90000000044f6fc0 9000000101d70000 ffff80001b88c000
  [   30.944538]         000000000000005a 900000010504c200 900000010a064000 900000010a067000
  [   30.944697]         9000000104da7d88 0000000000000000 9000000003d05000 90000000030e794c
  [   30.944852]         ...
  [   30.944924] Call Trace:
  [   30.945120] [<ffff800002009fb8>] bpf_prog_846803e5ae81417f_cls_redirect+0xbc/0x590
  [   30.945650] [<90000000030e6668>] bpf_test_run+0x1ec/0x2f8
  [   30.945958] [<90000000030e794c>] bpf_prog_test_run_skb+0x31c/0x684
  [   30.946065] [<90000000026d4f68>] __sys_bpf+0x678/0x2724
  [   30.946159] [<90000000026d7288>] sys_bpf+0x20/0x2c
  [   30.946253] [<90000000032dd224>] do_syscall+0x7c/0x94
  [   30.946343] [<9000000002541c5c>] handle_syscall+0xbc/0x158
  [   30.946492]
  [   30.946549] Code: 0015030e  5c0009c0  5001d000 <28c00304> 02c00484  29c00304  00150009  2a42d2e4  0280200d
  [   30.946793]
  [   30.946971] ---[ end trace 0000000000000000 ]---
  [   32.093225] Kernel panic - not syncing: Fatal exception in interrupt
  [   32.093526] Kernel relocated by 0x2320000
  [   32.093630]  .text @ 0x9000000002520000
  [   32.093725]  .data @ 0x9000000003400000
  [   32.093792]  .bss  @ 0x9000000004413200
  [   34.971998] ---[ end Kernel panic - not syncing: Fatal exception in interrupt ]---

This is because we signed-extend function return values. When subprog
mode is enabled, we have:

  cls_redirect()
    -> get_global_metrics() returns pcpu ptr 0xfffffefffc00b480

The pointer returned is later signed-extended to 0xfffffffffc00b480 at
`BPF_JMP | BPF_EXIT`. During BPF prog run, this triggers unhandled page
fault and a kernel panic.

Drop the unnecessary signed-extension on return values like other
architectures do.

With this change, we have:

  # ./test_progs -t cls_redirect
  Can't find bpf_testmod.ko kernel module: -2
  WARNING! Selftests relying on bpf_testmod.ko will be skipped.
  #51/1    cls_redirect/cls_redirect_inlined:OK
  #51/2    cls_redirect/IPv4 TCP accept unknown (no hops, flags: SYN):OK
  #51/3    cls_redirect/IPv6 TCP accept unknown (no hops, flags: SYN):OK
  #51/4    cls_redirect/IPv4 TCP accept unknown (no hops, flags: ACK):OK
  #51/5    cls_redirect/IPv6 TCP accept unknown (no hops, flags: ACK):OK
  #51/6    cls_redirect/IPv4 TCP forward unknown (one hop, flags: ACK):OK
  #51/7    cls_redirect/IPv6 TCP forward unknown (one hop, flags: ACK):OK
  #51/8    cls_redirect/IPv4 TCP accept known (one hop, flags: ACK):OK
  #51/9    cls_redirect/IPv6 TCP accept known (one hop, flags: ACK):OK
  #51/10   cls_redirect/IPv4 UDP accept unknown (no hops, flags: none):OK
  #51/11   cls_redirect/IPv6 UDP accept unknown (no hops, flags: none):OK
  #51/12   cls_redirect/IPv4 UDP forward unknown (one hop, flags: none):OK
  #51/13   cls_redirect/IPv6 UDP forward unknown (one hop, flags: none):OK
  #51/14   cls_redirect/IPv4 UDP accept known (one hop, flags: none):OK
  #51/15   cls_redirect/IPv6 UDP accept known (one hop, flags: none):OK
  #51/16   cls_redirect/cls_redirect_subprogs:OK
  #51/17   cls_redirect/IPv4 TCP accept unknown (no hops, flags: SYN):OK
  #51/18   cls_redirect/IPv6 TCP accept unknown (no hops, flags: SYN):OK
  #51/19   cls_redirect/IPv4 TCP accept unknown (no hops, flags: ACK):OK
  #51/20   cls_redirect/IPv6 TCP accept unknown (no hops, flags: ACK):OK
  #51/21   cls_redirect/IPv4 TCP forward unknown (one hop, flags: ACK):OK
  #51/22   cls_redirect/IPv6 TCP forward unknown (one hop, flags: ACK):OK
  #51/23   cls_redirect/IPv4 TCP accept known (one hop, flags: ACK):OK
  #51/24   cls_redirect/IPv6 TCP accept known (one hop, flags: ACK):OK
  #51/25   cls_redirect/IPv4 UDP accept unknown (no hops, flags: none):OK
  #51/26   cls_redirect/IPv6 UDP accept unknown (no hops, flags: none):OK
  #51/27   cls_redirect/IPv4 UDP forward unknown (one hop, flags: none):OK
  #51/28   cls_redirect/IPv6 UDP forward unknown (one hop, flags: none):OK
  #51/29   cls_redirect/IPv4 UDP accept known (one hop, flags: none):OK
  #51/30   cls_redirect/IPv6 UDP accept known (one hop, flags: none):OK
  #51/31   cls_redirect/cls_redirect_dynptr:OK
  #51/32   cls_redirect/IPv4 TCP accept unknown (no hops, flags: SYN):OK
  #51/33   cls_redirect/IPv6 TCP accept unknown (no hops, flags: SYN):OK
  #51/34   cls_redirect/IPv4 TCP accept unknown (no hops, flags: ACK):OK
  #51/35   cls_redirect/IPv6 TCP accept unknown (no hops, flags: ACK):OK
  #51/36   cls_redirect/IPv4 TCP forward unknown (one hop, flags: ACK):OK
  #51/37   cls_redirect/IPv6 TCP forward unknown (one hop, flags: ACK):OK
  #51/38   cls_redirect/IPv4 TCP accept known (one hop, flags: ACK):OK
  #51/39   cls_redirect/IPv6 TCP accept known (one hop, flags: ACK):OK
  #51/40   cls_redirect/IPv4 UDP accept unknown (no hops, flags: none):OK
  #51/41   cls_redirect/IPv6 UDP accept unknown (no hops, flags: none):OK
  #51/42   cls_redirect/IPv4 UDP forward unknown (one hop, flags: none):OK
  #51/43   cls_redirect/IPv6 UDP forward unknown (one hop, flags: none):OK
  #51/44   cls_redirect/IPv4 UDP accept known (one hop, flags: none):OK
  #51/45   cls_redirect/IPv6 UDP accept known (one hop, flags: none):OK
  #51      cls_redirect:OK
  Summary: 1/45 PASSED, 0 SKIPPED, 0 FAILED

Fixes: 5dc615520c ("LoongArch: Add BPF JIT support")
Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
2023-12-09 15:49:16 +08:00
Hengqi Chen fe5757553b LoongArch: BPF: Don't sign extend memory load operand
The `cgrp_local_storage` test triggers a kernel panic like:

  # ./test_progs -t cgrp_local_storage
  Can't find bpf_testmod.ko kernel module: -2
  WARNING! Selftests relying on bpf_testmod.ko will be skipped.
  [  550.930632] CPU 1 Unable to handle kernel paging request at virtual address 0000000000000080, era == ffff80000200be34, ra == ffff80000200be00
  [  550.931781] Oops[#1]:
  [  550.931966] CPU: 1 PID: 1303 Comm: test_progs Not tainted 6.7.0-rc2-loong-devel-g2f56bb0d2327 #35 a896aca3f4164f09cc346f89f2e09832e07be5f6
  [  550.932215] Hardware name: QEMU QEMU Virtual Machine, BIOS unknown 2/2/2022
  [  550.932403] pc ffff80000200be34 ra ffff80000200be00 tp 9000000108350000 sp 9000000108353dc0
  [  550.932545] a0 0000000000000000 a1 0000000000000517 a2 0000000000000118 a3 00007ffffbb15558
  [  550.932682] a4 00007ffffbb15620 a5 90000001004e7700 a6 0000000000000021 a7 0000000000000118
  [  550.932824] t0 ffff80000200bdc0 t1 0000000000000517 t2 0000000000000517 t3 00007ffff1c06ee0
  [  550.932961] t4 0000555578ae04d0 t5 fffffffffffffff8 t6 0000000000000004 t7 0000000000000020
  [  550.933097] t8 0000000000000040 u0 00000000000007b8 s9 9000000108353e00 s0 90000001004e7700
  [  550.933241] s1 9000000004005000 s2 0000000000000001 s3 0000000000000000 s4 0000555555eb2ec8
  [  550.933379] s5 00007ffffbb15bb8 s6 00007ffff1dafd60 s7 000055555663f610 s8 00007ffff1db0050
  [  550.933520]    ra: ffff80000200be00 bpf_prog_98f1b9e767be2a84_on_enter+0x40/0x200
  [  550.933911]   ERA: ffff80000200be34 bpf_prog_98f1b9e767be2a84_on_enter+0x74/0x200
  [  550.934105]  CRMD: 000000b0 (PLV0 -IE -DA +PG DACF=CC DACM=CC -WE)
  [  550.934596]  PRMD: 00000004 (PPLV0 +PIE -PWE)
  [  550.934712]  EUEN: 00000003 (+FPE +SXE -ASXE -BTE)
  [  550.934836]  ECFG: 00071c1c (LIE=2-4,10-12 VS=7)
  [  550.934976] ESTAT: 00010000 [PIL] (IS= ECode=1 EsubCode=0)
  [  550.935097]  BADV: 0000000000000080
  [  550.935181]  PRID: 0014c010 (Loongson-64bit, Loongson-3A5000)
  [  550.935291] Modules linked in:
  [  550.935391] Process test_progs (pid: 1303, threadinfo=000000006c3b1c41, task=0000000061f84a55)
  [  550.935643] Stack : 00007ffffbb15bb8 0000555555eb2ec8 0000000000000000 0000000000000001
  [  550.935844]         9000000004005000 ffff80001b864000 00007ffffbb15450 90000000029aa034
  [  550.935990]         0000000000000000 9000000108353ec0 0000000000000118 d07d9dfb09721a09
  [  550.936175]         0000000000000001 0000000000000000 9000000108353ec0 0000000000000118
  [  550.936314]         9000000101d46ad0 900000000290abf0 000055555663f610 0000000000000000
  [  550.936479]         0000000000000003 9000000108353ec0 00007ffffbb15450 90000000029d7288
  [  550.936635]         00007ffff1dafd60 000055555663f610 0000000000000000 0000000000000003
  [  550.936779]         9000000108353ec0 90000000035dd1f0 00007ffff1dafd58 9000000002841c5c
  [  550.936939]         0000000000000119 0000555555eea5a8 00007ffff1d78780 00007ffffbb153e0
  [  550.937083]         ffffffffffffffda 00007ffffbb15518 0000000000000040 00007ffffbb15558
  [  550.937224]         ...
  [  550.937299] Call Trace:
  [  550.937521] [<ffff80000200be34>] bpf_prog_98f1b9e767be2a84_on_enter+0x74/0x200
  [  550.937910] [<90000000029aa034>] bpf_trace_run2+0x90/0x154
  [  550.938105] [<900000000290abf0>] syscall_trace_enter.isra.0+0x1cc/0x200
  [  550.938224] [<90000000035dd1f0>] do_syscall+0x48/0x94
  [  550.938319] [<9000000002841c5c>] handle_syscall+0xbc/0x158
  [  550.938477]
  [  550.938607] Code: 580009ae  50016000  262402e4 <28c20085> 14092084  03a00084  16000024  03240084  00150006
  [  550.938851]
  [  550.939021] ---[ end trace 0000000000000000 ]---

Further investigation shows that this panic is triggered by memory
load operations:

  ptr = bpf_cgrp_storage_get(&map_a, task->cgroups->dfl_cgrp, 0,
                             BPF_LOCAL_STORAGE_GET_F_CREATE);

The expression `task->cgroups->dfl_cgrp` involves two memory load.
Since the field offset fits in imm12 or imm14, we use ldd or ldptrd
instructions. But both instructions have the side effect that it will
signed-extended the imm operand. Finally, we got the wrong addresses
and panics is inevitable.

Use a generic ldxd instruction to avoid this kind of issues.

With this change, we have:

  # ./test_progs -t cgrp_local_storage
  Can't find bpf_testmod.ko kernel module: -2
  WARNING! Selftests relying on bpf_testmod.ko will be skipped.
  test_cgrp_local_storage:PASS:join_cgroup /cgrp_local_storage 0 nsec
  #48/1    cgrp_local_storage/tp_btf:OK
  test_attach_cgroup:PASS:skel_open 0 nsec
  test_attach_cgroup:PASS:prog_attach 0 nsec
  test_attach_cgroup:PASS:prog_attach 0 nsec
  libbpf: prog 'update_cookie_tracing': failed to attach: ERROR: strerror_r(-524)=22
  test_attach_cgroup:FAIL:prog_attach unexpected error: -524
  #48/2    cgrp_local_storage/attach_cgroup:FAIL
  test_recursion:PASS:skel_open_and_load 0 nsec
  libbpf: prog 'on_lookup': failed to attach: ERROR: strerror_r(-524)=22
  libbpf: prog 'on_lookup': failed to auto-attach: -524
  test_recursion:FAIL:skel_attach unexpected error: -524 (errno 524)
  #48/3    cgrp_local_storage/recursion:FAIL
  #48/4    cgrp_local_storage/negative:OK
  #48/5    cgrp_local_storage/cgroup_iter_sleepable:OK
  test_yes_rcu_lock:PASS:skel_open 0 nsec
  test_yes_rcu_lock:PASS:skel_load 0 nsec
  libbpf: prog 'yes_rcu_lock': failed to attach: ERROR: strerror_r(-524)=22
  libbpf: prog 'yes_rcu_lock': failed to auto-attach: -524
  test_yes_rcu_lock:FAIL:skel_attach unexpected error: -524 (errno 524)
  #48/6    cgrp_local_storage/yes_rcu_lock:FAIL
  #48/7    cgrp_local_storage/no_rcu_lock:OK
  #48      cgrp_local_storage:FAIL

  All error logs:
  test_cgrp_local_storage:PASS:join_cgroup /cgrp_local_storage 0 nsec
  test_attach_cgroup:PASS:skel_open 0 nsec
  test_attach_cgroup:PASS:prog_attach 0 nsec
  test_attach_cgroup:PASS:prog_attach 0 nsec
  libbpf: prog 'update_cookie_tracing': failed to attach: ERROR: strerror_r(-524)=22
  test_attach_cgroup:FAIL:prog_attach unexpected error: -524
  #48/2    cgrp_local_storage/attach_cgroup:FAIL
  test_recursion:PASS:skel_open_and_load 0 nsec
  libbpf: prog 'on_lookup': failed to attach: ERROR: strerror_r(-524)=22
  libbpf: prog 'on_lookup': failed to auto-attach: -524
  test_recursion:FAIL:skel_attach unexpected error: -524 (errno 524)
  #48/3    cgrp_local_storage/recursion:FAIL
  test_yes_rcu_lock:PASS:skel_open 0 nsec
  test_yes_rcu_lock:PASS:skel_load 0 nsec
  libbpf: prog 'yes_rcu_lock': failed to attach: ERROR: strerror_r(-524)=22
  libbpf: prog 'yes_rcu_lock': failed to auto-attach: -524
  test_yes_rcu_lock:FAIL:skel_attach unexpected error: -524 (errno 524)
  #48/6    cgrp_local_storage/yes_rcu_lock:FAIL
  #48      cgrp_local_storage:FAIL
  Summary: 0/4 PASSED, 0 SKIPPED, 1 FAILED

No panics any more (The test still failed because lack of BPF trampoline
which I am actively working on).

Fixes: 5dc615520c ("LoongArch: Add BPF JIT support")
Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
2023-12-09 15:49:16 +08:00
Hengqi Chen d6c5f06e46 LoongArch: Preserve syscall nr across execve()
Currently, we store syscall nr in pt_regs::regs[11] and syscall execve()
accidentally overrides it during its execution:

    sys_execve()
      -> do_execve()
        -> do_execveat_common()
          -> bprm_execve()
            -> exec_binprm()
              -> search_binary_handler()
                -> load_elf_binary()
                  -> ELF_PLAT_INIT()

ELF_PLAT_INIT() reset regs[11] to 0, so in syscall_exit_to_user_mode()
we later get a wrong syscall nr. This breaks tools like execsnoop since
it relies on execve() tracepoints.

Skip pt_regs::regs[11] reset in ELF_PLAT_INIT() to fix the issue.

Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
2023-12-09 15:49:15 +08:00
Jinyang He 97ceddbc94 LoongArch: Set unwind stack type to unknown rather than set error flag
During unwinding, unwind_done() is used as an end condition. Normally it
unwind to the user stack and then set the stack type to unknown, which
is a normal exit. When something unexpected happens in unwind process
and we cannot unwind anymore, we should set the error flag, and also set
the stack type to unknown to indicate that the unwind process can not
continue. The error flag emphasizes that the unwind process produce an
unexpected error. There is no unexpected things when we unwind the PT_REGS
in the top of IRQ stack and find out that is an user mode PT_REGS. Thus,
we should not set error flag and just set stack type to unknown.

Reported-by: Hengqi Chen <hengqi.chen@gmail.com>
Acked-by: Hengqi Chen <hengqi.chen@gmail.com>
Signed-off-by: Jinyang He <hejinyang@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
2023-12-09 15:49:15 +08:00
Xi Ruoyao 8146c5b349 LoongArch: Slightly clean up drdtime()
As we are just discarding the stable clock ID, simply write it into
$zero instead of allocating a temporary register.

Signed-off-by: Xi Ruoyao <xry111@xry111.site>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
2023-12-09 15:49:15 +08:00
WANG Rui eea673e9d5 LoongArch: Apply dynamic relocations for LLD
For the following assembly code:

     .text
     .global func
 func:
     nop

     .data
 var:
     .dword func

When linked with `-pie`, GNU LD populates the `var` variable with the
pre-relocated value of `func`. However, LLVM LLD does not exhibit the
same behavior. This issue also arises with the `kernel_entry` in arch/
loongarch/kernel/head.S:

 _head:
     .word   MZ_MAGIC                /* "MZ", MS-DOS header */
     .org    0x8
     .dword  kernel_entry            /* Kernel entry point */

The correct kernel entry from the MS-DOS header is crucial for jumping
to vmlinux from zboot. This necessity is why the compressed relocatable
kernel compiled by Clang encounters difficulties in booting.

To address this problem, it is proposed to apply dynamic relocations to
place with `--apply-dynamic-relocs`.

Link: https://github.com/ClangBuiltLinux/linux/issues/1962
Signed-off-by: WANG Rui <wangrui@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
2023-12-09 15:49:15 +08:00
Linus Torvalds f2e8a57ee9 SCSI fixes on 20231208
One tiny fix to the be2iscsi driver fixing a memory leak in an error leg.
 
 Signed-off-by: James E.J. Bottomley <jejb@linux.ibm.com>
 -----BEGIN PGP SIGNATURE-----
 
 iJwEABMIAEQWIQTnYEDbdso9F2cI+arnQslM7pishQUCZXNjACYcamFtZXMuYm90
 dG9tbGV5QGhhbnNlbnBhcnRuZXJzaGlwLmNvbQAKCRDnQslM7pishYz4AQC/yT6c
 gWAr2e6NMUXs0Wx3C25ZFA3MS5OOhnkmIt8e2gEApSuCvlRZmHmR/YCphQD4e1ij
 k0M7kd9jM7v356QTFBE=
 =q8tg
 -----END PGP SIGNATURE-----

Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi

Pull SCSI fix from James Bottomley:
 "One tiny fix to the be2iscsi driver fixing a memory leak in an error
  leg"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
  scsi: be2iscsi: Fix a memleak in beiscsi_init_wrb_handle()
2023-12-08 12:40:38 -08:00
Linus Torvalds d71369dbe0 block-6.7-2023-12-08
-----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCAAuFiEEwPw5LcreJtl1+l5K99NY+ylx4KYFAmVzOGgQHGF4Ym9lQGtl
 cm5lbC5kawAKCRD301j7KXHgprPED/sFJUY31XzGNWlqigwneZYppNYLyfJwTZ5z
 FJyMfN/i9IPWZdBnY/Sed4lp/rWhlEIDNN69bHG7ErK4t8weaGWAV9+ygwRHNmm/
 bAcezY0rJwh23pl/kCYxidhVVFpyhSjFebDUQ6nY4XeTm9OOeeVsTsKVNmN7hF/M
 kGkJU+xZfu63RHcc0NATJPaaZGv0t5tZDnLCOiBy71tckxQlvPqvGnXKoTK1XeEv
 WQu3WgYFhDmRfjnaWPKW8HewcEjZHrRNFiAgKOf1fVCUdEbUrMU9qtGRr0Wv5Fwv
 f5cVqc+K44AE+spz/3Kb07q2/yI9cY3gbB1Ogt1ML1ryOMX9VgmymTxAhHyMJdJF
 +SnDgkUGnkn4mAr93lOad1DL76Ep5fvK3NX799TwkL1RC/78GiGYJWEOA3rC7sD2
 Nfrs5RHxAnjwlT4jKSJ8pbGZa3SQ5g+zn7sePxTRSEARq4Z8YY7WhQpKuW70NVvp
 qkVCZgUEXO7DQcpjPLksOGt4tviXHahuIbq7RQD6OFZ1eNFrljHljymo+4rRRT/B
 QlouVtrdkGA+u2xj0NJ24rtlyVvSg/150UWdtxgkq9zLQudFD9HoIDySjdnwHgIE
 JTjIwH6Wq2y4TqGb4BkOlYMSqJaL0jcac2mT9oLkVoJ4OoQ6P9rtjHnl0yQGsb2R
 a6vKAkWF7Q==
 =Ds8S
 -----END PGP SIGNATURE-----

Merge tag 'block-6.7-2023-12-08' of git://git.kernel.dk/linux

Pull block fixes from Jens Axboe:
 "Nothing major in here, just miscellanous fixes for MD and NVMe:

   - NVMe pull request via Keith:
      - Proper nvme ctrl state setting (Keith)
      - Passthrough command optimization (Keith)
      - Spectre fix (Nitesh)
      - Kconfig clarifications (Shin'ichiro)
      - Frozen state deadlock fix (Bitao)
      - Power setting quirk (Georg)

   - MD pull requests via Song:
      - 6.7 regresisons with recovery/sync (Yu)
      - Reshape fix (David)"

* tag 'block-6.7-2023-12-08' of git://git.kernel.dk/linux:
  md: split MD_RECOVERY_NEEDED out of mddev_resume
  nvme-pci: Add sleep quirk for Kingston drives
  md: fix stopping sync thread
  md: don't leave 'MD_RECOVERY_FROZEN' in error path of md_set_readonly()
  md: fix missing flush of sync_work
  nvme: fix deadlock between reset and scan
  nvme: prevent potential spectre v1 gadget
  nvme: improve NVME_HOST_AUTH and NVME_TARGET_AUTH config descriptions
  nvme-ioctl: move capable() admin check to the end
  nvme: ensure reset state check ordering
  nvme: introduce helper function to get ctrl state
  md/raid6: use valid sector values to determine if an I/O should wait on the reshape
2023-12-08 12:36:45 -08:00
Linus Torvalds 689659c988 io_uring-6.7-2023-12-08
-----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCAAuFiEEwPw5LcreJtl1+l5K99NY+ylx4KYFAmVzOJkQHGF4Ym9lQGtl
 cm5lbC5kawAKCRD301j7KXHgpmYVD/0cx0TTIrip959DLqF/V8sl2BIrt/mjAvS4
 oeVUe5OmqyR2gjjEYewf21MUyzE4tSMO/LFTEr0744zENKNTL84YhIIq30ga+Gue
 n61c4WfPnhpvj8NQHuEf65cPosPSvKi6NSMLRJZCLqHtn8SrTQyCg8zk8GwjN/nl
 fJScbrj4XKfZNlizKfbHQexfi78DZ2braTds0pPZ+uFXDTIrOKAfixfV39qwTFYZ
 zI4FYKH8KzZzuMyyu2B+F3xCMdelUg26i2KMImKBaOsamnucIlyNvr/uWGs2G8tu
 Z7sWGXdY9bFlWfAFxGZeFRWbmqpFz15Mmi2Uqx8wiiYxBAaJKL+Qaq358KbTD0hB
 ZBKdy3AUw5J/445pwIepGp5XVxqn/qJFxGXzLAlncdhf9mXrjmFwNC/Yp5lnyDYy
 S3YhUsjpGX3Mymjd/gWkn1BTZh7zzpKI6LmWJjn89jmTpOzlWmfPu/uM/c/vKvE8
 KajCkZ3nUCmr56GUxvSZcon7vwc8pLUyrF8Vo1vwEEVgiN+IjJVk3dMAz0hyGhtO
 2HxSwOAHllAIyqjmazqESQnWEf1p8idnoR9qZXAiLzbwUFbUY/a/YrCul6vHM4yE
 czat+EGWdfJi0EX0z/bMUVRz05UbNt0JtKf3BnqxWtQlT8yKwCvMgHXuPJbY4y5g
 yXi7ep37JQ==
 =Xta7
 -----END PGP SIGNATURE-----

Merge tag 'io_uring-6.7-2023-12-08' of git://git.kernel.dk/linux

Pull io_uring fixes from Jens Axboe:
 "Two minor fixes for issues introduced in this release cycle, and two
  fixes for issues or potential issues that are heading to stable.

  One of these ends up disabling passing io_uring file descriptors via
  SCM_RIGHTS. There really shouldn't be an overlap between that kind of
  historic use case and modern usage of io_uring, which is why this was
  deemed appropriate"

* tag 'io_uring-6.7-2023-12-08' of git://git.kernel.dk/linux:
  io_uring/af_unix: disable sending io_uring over sockets
  io_uring/kbuf: check for buffer list readiness after NULL check
  io_uring/kbuf: Fix an NULL vs IS_ERR() bug in io_alloc_pbuf_ring()
  io_uring: fix mutex_unlock with unreferenced ctx
2023-12-08 12:32:38 -08:00
Linus Torvalds 8aa74869d2 RDMA first rc pull for v6.7
Primarily rtrs and irdma fixes:
 
 - Fix uninitialized value in ib_get_eth_speed()
 
 - Fix hns refusing to work if userspace doesn't select the correct
   congestion control algorithm
 
 - Several irdma fixes - unreliable Send Queue Drain, use after free, 64k
   page size bugs, device removal races
 
 - Several rtrs bug fixes - crashes, memory leaks, use after free, bad
   credit accounting, bogus WARN_ON
 
 - Typos and a MAINTAINER update
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQRRRCHOFoQz/8F5bUaFwuHvBreFYQUCZXMjNwAKCRCFwuHvBreF
 YdnyAP9h6dQG+KgIl26q7Bk1AmsmoseZ1HmeGRacdHsW0qgXPwD/XRX/IgNpl465
 fdt6Qh877LBEjlMFvyMxFTWG7v1ixwY=
 =Tn3a
 -----END PGP SIGNATURE-----

Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma

Pull rdma fixes from Jason Gunthorpe:
 "Primarily rtrs and irdma fixes:

   - Fix uninitialized value in ib_get_eth_speed()

   - Fix hns refusing to work if userspace doesn't select the correct
     congestion control algorithm

   - Several irdma fixes - unreliable Send Queue Drain, use after free,
     64k page size bugs, device removal races

   - Several rtrs bug fixes - crashes, memory leaks, use after free, bad
     credit accounting, bogus WARN_ON

   - Typos and a MAINTAINER update"

* tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma:
  RDMA/irdma: Avoid free the non-cqp_request scratch
  RDMA/irdma: Fix support for 64k pages
  RDMA/irdma: Ensure iWarp QP queue memory is OS paged aligned
  RDMA/core: Fix umem iterator when PAGE_SIZE is greater then HCA pgsz
  RDMA/irdma: Fix UAF in irdma_sc_ccq_get_cqe_info()
  RDMA/bnxt_re: Correct module description string
  RDMA/rtrs-clt: Remove the warnings for req in_use check
  RDMA/rtrs-clt: Fix the max_send_wr setting
  RDMA/rtrs-srv: Destroy path files after making sure no IOs in-flight
  RDMA/rtrs-srv: Free srv_mr iu only when always_invalidate is true
  RDMA/rtrs-srv: Check return values while processing info request
  RDMA/rtrs-clt: Start hb after path_up
  RDMA/rtrs-srv: Do not unconditionally enable irq
  MAINTAINERS: Add Chengchang Tang as Hisilicon RoCE maintainer
  RDMA/irdma: Add wait for suspend on SQD
  RDMA/irdma: Do not modify to SQD on error
  RDMA/hns: Fix unnecessary err return when using invalid congest control algorithm
  RDMA/core: Fix uninit-value access in ib_get_eth_speed()
2023-12-08 12:27:11 -08:00
Linus Torvalds 081ed90a8c Power management fix for 6.7-rc5
Fix cpufreq reference counting in the DTPM (dynamic thermal and
 power management) power capping framework (Lukasz Luba).
 -----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEE4fcc61cGeeHD/fCwgsRv/nhiVHEFAmVzVpgSHHJqd0Byand5
 c29ja2kubmV0AAoJEILEb/54YlRxVr4P/j2SMo9M5tA39cHJ3nUWXBV23pWXQW/N
 2Gl1oFr6UAHM3sbIAN6MGGGFAPjIxdLisUMDmPsIc1HkLHBV6aG5vOoxvUP9XCAK
 je+kWIAKsIMaf/l3kfD3OdDda3RQlbcTbVyP8vKxcYWyLe1lAO7ddYuvsXuN9gCb
 t+KoWjN5DSYbS+0reIsBGjYQRA6Asf6mciAdvbFkZwQkot/E9jxxH927IN69X2JJ
 dRG6NsfFbX25Xb1i3a+uNCPrc7NeNYn1NHw2QfDEgGxM0sxBhamTJNNOePZwEx50
 4mM8wvtshV9/rSGlXZBpKm0WaDB1exoE9ot9ZOjpeRiBnoNf1adTtsb0EHOA7V8Y
 nRfB5hS4VfuOVuED9ytwAPcxb3s3VKJmmMb2xquODXRZVELIvtYvRia9Fnp3HP98
 J/lUBmzVe3/ieBoUHPznNIinGqHuXMIRyNejybnwVXGf8wD2Te4tRU9DNeUgHkPJ
 yQFQAURNwZxsCAYOv3DnA8eUjDbPXYrBlHSMP05BNUXBe6qmhf1kMJAEW/zz7x1h
 lJ4mNBGVzfSBlUoD3uuf4+qb1VgseqN1VqgimbWahZqErAhToh0aRsfe8cs/7cFq
 86qifoXfFYPUt2pJVF3P2DWPLZKU3HjpqQUrICQx5zc+EkDP9p9sdOvcnidC/UdV
 b/C3KOe1EvfZ
 =slx+
 -----END PGP SIGNATURE-----

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

Pull power management fix from Rafael Wysocki:
 "Fix cpufreq reference counting in the DTPM (dynamic thermal and power
  management) power capping framework (Lukasz Luba)"

* tag 'pm-6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  powercap: DTPM: Fix missing cpufreq_cpu_put() calls
2023-12-08 11:57:55 -08:00
Linus Torvalds c3e2f9bda2 ACPI fix for 6.7-rc5
Fix a possible crash on an attempt to free unallocated memory in the
 error path of acpi_evaluate_reference() that has been introduced by one
 of the recent changes (Rafael Wysocki).
 -----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEE4fcc61cGeeHD/fCwgsRv/nhiVHEFAmVzVyQSHHJqd0Byand5
 c29ja2kubmV0AAoJEILEb/54YlRxh38P/AyhME1sSfnVBFGBs6hbkiqbXkiv53ty
 VSk08bp4r2Be+CruttN7D1lb9Y6RnIcQ0961dSEIwAEzuWy4lGUIAw02ljvZIr2z
 XFbAtusRTAqJBkCuwvs3vFsUIC3AAH//m9wfVo75iTQSKCgbn0C8t92ttOrx9/Ys
 XCPqEb06KeOU5C/twr5EbIUUpP+TARTAjP8CXeAaiYzjeSpNz/wQbkd5sHLJNBBO
 O5hwhey944BIqvY3PXDl6hDiWVKqBs9w7qQmDVMc1dck2WhQ9L2wBsIgf4MICoAh
 8IORi0PbEhsH9yxY8GIuLkYKIeMKx2bd04kDi8GuskP/GJxuZfehs7MH1Et0+glH
 itN6EM7EanznBrKH55ilHi8A25aKI6vW8parMJjyZm66MlGha0FuY5d493PdA8hL
 Zsoo130xVPhzEOXATUhNDRZhEW/vfow++MgFTGXZAj+aizVN6Cj8WNNqAaGjYAyZ
 nvPIY48NVYb1GB0lDfoMiB/PKfMAAEHf9909AYSJnjbH+hc5Rw24+plBlOD9J8e+
 6XfjgHpA9dn43e3HwnkgQb7wqGviCkdwfxkqw3RNpOAYcw2Orp82vs6BTaHcNMC+
 ZxnftjuBoBm4L5hXj1+YbzSCUL+ILsUTvuGQDStgjTzz1mdhGUVIicoNhLL9UqFf
 b/doQTA75g7F
 =1Xw0
 -----END PGP SIGNATURE-----

Merge tag 'acpi-6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI fix from Rafael Wysocki:
 "Fix a possible crash on an attempt to free unallocated memory in the
  error path of acpi_evaluate_reference() that has been introduced by
  one of the recent changes (Rafael Wysocki)"

* tag 'acpi-6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  ACPI: utils: Fix error path in acpi_evaluate_reference()
2023-12-08 11:54:07 -08:00
Linus Torvalds 0dfe14fca9 hwmon fixes for v6.7-rc5
- acpi_power_meter: Fix 4.29 MW output sen if acpi reports bad data
 
 - corsair-psu: Fix ability to probe if the driver is built into the kernel
 
 - ltc2991: Fix spelling mistake "contiuous" -> "continuous"
 
 - max31827: Add missing regulator header file include
 
 - nzxt-kraken2: Fix error handling path in probe function
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEiHPvMQj9QTOCiqgVyx8mb86fmYEFAmVzZNcACgkQyx8mb86f
 mYFCgg/+KwO3QvSY7Mfwl93Xhijix7VC1XjJL4eHZfODiUQWnCgsjFLcA9SzbUsu
 mN2kKVrDWtN+Gp5rPOmCN8JFLxe4uifdg1ThfZ1rVv0xrowiffLgibFM5OVo4ynO
 1RJ8mg8y6JYb/Dy67kYwq2Z2NQPSB+6JourOJ+egXgZutZ7qmEcz81JjN+Dy1FAg
 Wa7bEuIlPChPmWwZRHBSilkoyb9tvMpU/5jG06UWrQOjMNYE2Incw9HRmg5tKVlD
 UVh4QrtP2kuk+M6ChwS4ffjD0Me3KIqQ9aAXb+QqNE0QziLkrLbRwHk1bHxrfjse
 EdKs+X7Ic40U6N7BFbEEiq+MeG3Q+47S8IVDlWIvIR3om13Jswn6wGkHB2WnVGBk
 zGXJ8iXLmxKuNiWvoeGUBvuSr/iaFY1jb8xFf+T92pso52GPVIgIDtS2H6qjSUE9
 iE9hwxLGE5GHNQJNN3dmCvUV22RUOTQVVMqmMOGerufusyb55Am6KHar9HtxAmpe
 SI0KB7i6zaPe0o8pXVMuWmonAsR0YXs57jyKB0lENJSCtjl3XiHEw7KkPZTYyKEo
 3m3xpOGvSnmAK7DHlm2CAP6UvBpikG/JXJnLyT+0LcsC6ifhcAjdossoi4Jyk0fv
 +v0tdhtd0DJTAO2DmVGtfc1WLIFEUq5xBEUhpLKMR2JpyVUTWAY=
 =Bj8e
 -----END PGP SIGNATURE-----

Merge tag 'hwmon-for-v6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging

Pull hwmon fixes from Guenter Roeck:

 - acpi_power_meter: Fix 4.29 MW output seen if acpi reports bad data

 - corsair-psu: Fix ability to probe if the driver is built into the kernel

 - ltc2991: Fix spelling mistake "contiuous" -> "continuous"

 - max31827: Add missing regulator header file include

 - nzxt-kraken2: Fix error handling path in probe function

* tag 'hwmon-for-v6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
  hwmon: (corsair-psu) Fix probe when built-in
  hwmon: (nzxt-kraken2) Fix error handling path in kraken2_probe()
  hwmon: (acpi_power_meter) Fix 4.29 MW bug
  hwmon: max31827: include regulator header
  hwmon: ltc2991: Fix spelling mistake "contiuous" -> "continuous"
2023-12-08 11:46:41 -08:00
Linus Torvalds d650b3beff pwm fixes for v6.7-rc5
This fixes a null pointer exception in the bcm2835 pwm driver. The
 problem was introduced by a combination of two commits merged for
 v6.7-rc1 where each change alone would have been fine.
 
 Thanks to Florian Fainelli for noticing and fixing the issue.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEP4GsaTp6HlmJrf7Tj4D7WH0S/k4FAmVzH2kACgkQj4D7WH0S
 /k7dLgf+IJh7lsXEdZCLhtXuopc+cT84AuM1tgtSE1dcO//QVXDMApCjuPcW8u6v
 V6/ASBFjWuBJZJjW3qJ73XNMkNefYkVN4x0nDw1+u7zmjT2yCfyf2WYO3PzGqXmK
 GTN/enXZuWTJAQhuKAqGbdMOCPyESwIcwZ7NtnOUoJ44tfzD+5bbgmq6UeftyM9R
 bY+GY4TMKlZxJJiVEWaTdUejZViKTwY7GBi+0TCM8v6IVqH8Xqbyo1zt07UoU3R3
 qD0+JnirLAZqweaEkKGLC7ch37qiEZ87traWP5J0OuoK9UoMj2NH056Y2gfOFlAD
 ec9ew8S4Qd+tupMWZYIe2zEPiWPbgw==
 =6v3w
 -----END PGP SIGNATURE-----

Merge tag 'pwm/for-6.7-rc5-fixes' of https://git.pengutronix.de/git/ukl/linux

Pull pwm fix from Uwe Kleine-König:
 "This fixes a null pointer exception in the bcm2835 pwm driver.

  The problem was introduced by a combination of two commits merged for
  v6.7-rc1 where each change alone would have been fine.

  Thanks to Florian Fainelli for noticing and fixing the issue"

* tag 'pwm/for-6.7-rc5-fixes' of https://git.pengutronix.de/git/ukl/linux:
  pwm: bcm2835: Fix NPD in suspend/resume
2023-12-08 11:41:56 -08:00
Linus Torvalds b8b68d2fd4 sound fixes for 6.7-rc5
This is a typical bump in the middle of its way; we've gathered lots
 of fixes (mostly for ASoC) at this time.
 
 - PCM array out-of-bound access fix
 - Correction of SOC PCM merge error
 - Lots of ASoC SOF Intel updates
 - A few ASoC AMD quirks
 - More proper timer handling in PCM test module
 - HD-audio and USB-audio quirks as usual
 - Other device-specific fixes for various ASoC codecs
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCAAsFiEEIXTw5fNLNI7mMiVaLtJE4w1nLE8FAmVy8MkOHHRpd2FpQHN1
 c2UuZGUACgkQLtJE4w1nLE+k9A/9HezmtiuQhxZ4l8AnbkSH1XBvFJjTIflpvuWh
 b2qW3qAoAudoznDpVL4Ad1usK/pJpAQ2KoImR7wkGs22HyryaZ0rjok0Yh2J+emP
 Z6Y4jnXOlgKugmVVzBBnrY6F+rESqm2JnZIfKQ2m8eD28s6WCl9r6uueSlCYnIMV
 bpX7T01BSOmUCSgzG6DMK33aAB+hxZvhT5Dd/F6XIrpHFaqmFPX01r/YAppPq+Az
 c8f4sqClndsEwPGBznUeHEDhwq7I1meeJzaIp+T9L5S/qDVUSueupqVBs8Aso6Cm
 e59al1w/PfFUllWx3n87Q7+ZAW5Lv5IimxhmrKptrCQISYbjNCOW/05sOAJB3tNY
 72acKUj0xFEq8kHr/KfTyOIDG6sYdUXgqCsmEPkMuV1z6R3jyfQuUs3MNBsjDEEx
 z5bbd2OykCYMc3kyNSuaU23UzDOguOoaeNyW+9tV075joDEy9qlskArD+CCA7LMk
 W7EdV5HxBXKMoxRMKuW+zg+dB7w5pkYoAXLdh/l9M6acfvYw69C4EeAa2ELQCJY6
 Pkw0+EMdfRSOqudjbeyDJyOheYuqliiI/rfT8TEIf/CWiPDW0jtL1Nz1hW4a/Qyp
 y+veNAEj6+e7Lww5K2dckp1k+fPqEsSKot7qlQC9ozu3gAPVjgvJJMuOdLAnv1Ym
 nNAhPu0=
 =m2Ci
 -----END PGP SIGNATURE-----

Merge tag 'sound-6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "This is a typical bump in the middle of its way; we've gathered lots
  of fixes (mostly for ASoC) at this time:

   - PCM array out-of-bound access fix

   - Correction of SOC PCM merge error

   - Lots of ASoC SOF Intel updates

   - A few ASoC AMD quirks

   - More proper timer handling in PCM test module

   - HD-audio and USB-audio quirks as usual

   - Other device-specific fixes for various ASoC codecs"

* tag 'sound-6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (39 commits)
  ALSA: hda/realtek: Add quirk for Lenovo Yoga Pro 7
  ALSA: pcmtest: stop timer before buffer is released
  ALSA: hda/realtek: Add Framework laptop 16 to quirks
  ALSA: hda/realtek: add new Framework laptop to quirks
  ALSA: pcm: fix out-of-bounds in snd_pcm_state_names
  ASoC: qcom: sc8280xp: Limit speaker digital volumes
  ASoC: ops: add correct range check for limiting volume
  ALSA: hda/realtek: Enable headset on Lenovo M90 Gen5
  ALSA: hda/realtek: fix speakers on XPS 9530 (2023)
  ALSA: usb-audio: Add Pioneer DJM-450 mixer controls
  ASoC: wm_adsp: fix memleak in wm_adsp_buffer_populate
  ASoC: da7219: Support low DC impedance headset
  ASoC: amd: acp: Add support for a new Huawei Matebook laptop
  ALSA: hda/realtek: Apply quirk for ASUS UM3504DA
  ASoC: SOF: ipc4-topology: Correct data structures for the GAIN module
  ASoC: SOF: ipc4-topology: Correct data structures for the SRC module
  ASoC: hdac_hda: Conditionally register dais for HDMI and Analog
  ASoC: codecs: lpass-tx-macro: set active_decimator correct default value
  ASoC: amd: yc: Fix non-functional mic on ASUS E1504FA
  ASoC: amd: yc: Add DMI entry to support System76 Pangolin 13
  ...
2023-12-08 11:29:45 -08:00
Linus Torvalds 38bafa65b1 drm fixes for v6.7-rc5
atomic-helpers:
 - invoke end_fb_access while owning plane state
 
 i915:
 - fix a missing dep for a previous fix
 - Relax BXT/GLK DSI transcoder hblank limits
 - Fix DP MST .mode_valid_ctx() return values
 - Reject DP MST modes that require bigjoiner (as it's not yet supported on DP MST)
 - Fix _intel_dsb_commit() variable type to allow negative values
 
 nouveau:
 - document some bits of gsp rm
 - flush vmm more on tu102 to avoid hangs
 
 panfrost:
 - fix imported dma-buf objects residency
 - fix device freq update
 
 bridge:
 - tc358768 - fix Kconfig
 
 amdgpu:
 - Disable MCBP on gfx9
 - DC vbios fix
 - eDP fix
 - dml2 UBSAN fix
 - SMU 14 fix
 - RAS fixes
 - dml KASAN/KCSAN fix
 - PSP 13 fix
 - Clockgating fixes
 - Suspend fix
 
 exynos:
 - fix pointer dereference
 - fix wrong error check
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEEKbZHaGwW9KfbeusDHTzWXnEhr4FAmVyoMEACgkQDHTzWXnE
 hr4FlxAAlSOOMsRvrmK5qChAZhqCEqAhVo+N+8BnjR/whHWhGPQWqyrdoJVBAOLh
 ZZtqfRW343V6+HESW+VRoQfv7JnaKZzh2/aimJQbqa/7kxfitKfUxltMkwRR/Hqm
 GwRDIlCYj0rGJrty3NVccYOWC1eL0nwDGIbRXFuQ1KsreQYD/UJ6JU3ZiPaeaNoX
 d2JLGoHwVE1Oa+MQTnOcgAbXxUZfesLc4jGizeh+mRMw1n/h1YutQwJy4xvC5UHB
 529Yc7HW4kim0toGwSLnpnew1PCuld+XiuEU6OgT74drYZ5t7lHwJUxOkrOxK+nU
 j5yW1YW0+3DdIJZgbrOZu1gVee3oZVKO+KZL6zn+A2d4wwY9EonFsCZECqHUeoLC
 eLUCpNwH2HwOsDCsjQ6CqZ/yWFayska5UGmqux7kbIv3FV/vrZsk2ZMRN7+K4ogo
 N5xwhp63Bzg11HEoOFml0egPaNhJSCIuEJ2GoyKCmMmEXibtjm9B4Y9YvhaF3zgx
 LJaLlXwKiuvYM6Mp3enST65FrtziB22NblHJ8y3B04GFq9fLRc5RKAEWPhlIdRh5
 2KSMNJVCYge/hN9M782CBeDjW9u3yDGom58Gqt6nSlQhTCLInWqdueO2jfs/sKR3
 K7UR1jLO+2JmzbukgHjOuL6L4XMBWPchcBymm0Bgh8lZZV3zGxk=
 =c5mf
 -----END PGP SIGNATURE-----

Merge tag 'drm-fixes-2023-12-08' of git://anongit.freedesktop.org/drm/drm

Pull drm fixes from Dave Airlie:
 "Regular weekly fixes, mostly amdgpu and i915 as usual. A couple of
  nouveau, panfrost, one core and one bridge Kconfig.

  Seems about normal for rc5.

  atomic-helpers:
   - invoke end_fb_access while owning plane state

  i915:
   - fix a missing dep for a previous fix
   - Relax BXT/GLK DSI transcoder hblank limits
   - Fix DP MST .mode_valid_ctx() return values
   - Reject DP MST modes that require bigjoiner (as it's not yet
     supported on DP MST)
   - Fix _intel_dsb_commit() variable type to allow negative values

  nouveau:
   - document some bits of gsp rm
   - flush vmm more on tu102 to avoid hangs

  panfrost:
   - fix imported dma-buf objects residency
   - fix device freq update

  bridge:
   - tc358768 - fix Kconfig

  amdgpu:
   - Disable MCBP on gfx9
   - DC vbios fix
   - eDP fix
   - dml2 UBSAN fix
   - SMU 14 fix
   - RAS fixes
   - dml KASAN/KCSAN fix
   - PSP 13 fix
   - Clockgating fixes
   - Suspend fix

  exynos:
   - fix pointer dereference
   - fix wrong error check"

* tag 'drm-fixes-2023-12-08' of git://anongit.freedesktop.org/drm/drm: (27 commits)
  drm/exynos: fix a wrong error checking
  drm/exynos: fix a potential error pointer dereference
  drm/amdgpu: fix buffer funcs setting order on suspend
  drm/amdgpu: Avoid querying DRM MGCG status
  drm/amdgpu: Update HDP 4.4.2 clock gating flags
  drm/amdgpu: Add NULL checks for function pointers
  drm/amdgpu: Restrict extended wait to PSP v13.0.6
  drm/amd/display: Increase frame warning limit with KASAN or KCSAN in dml
  drm/amdgpu: optimize the printing order of error data
  drm/amdgpu: Update fw version for boot time error query
  drm/amd/pm: support new mca smu error code decoding
  drm/amd/swsmu: update smu v14_0_0 driver if version and metrics table
  drm/amd/display: Fix array-index-out-of-bounds in dml2
  drm/amd/display: Add monitor patch for specific eDP
  drm/amd/display: Use channel_width = 2 for vram table 3.0
  drm/amdgpu: disable MCBP by default
  drm/atomic-helpers: Invoke end_fb_access while owning plane state
  drm/i915: correct the input parameter on _intel_dsb_commit()
  drm/i915/mst: Reject modes that require the bigjoiner
  drm/i915/mst: Fix .mode_valid_ctx() return values
  ...
2023-12-08 11:17:44 -08:00
Sean Christopherson 4cdf351d36 KVM: SVM: Update EFER software model on CR0 trap for SEV-ES
In general, activating long mode involves setting the EFER_LME bit in
the EFER register and then enabling the X86_CR0_PG bit in the CR0
register. At this point, the EFER_LMA bit will be set automatically by
hardware.

In the case of SVM/SEV guests where writes to CR0 are intercepted, it's
necessary for the host to set EFER_LMA on behalf of the guest since
hardware does not see the actual CR0 write.

In the case of SEV-ES guests where writes to CR0 are trapped instead of
intercepted, the hardware *does* see/record the write to CR0 before
exiting and passing the value on to the host, so as part of enabling
SEV-ES support commit f1c6366e30 ("KVM: SVM: Add required changes to
support intercepts under SEV-ES") dropped special handling of the
EFER_LMA bit with the understanding that it would be set automatically.

However, since the guest never explicitly sets the EFER_LMA bit, the
host never becomes aware that it has been set. This becomes problematic
when userspace tries to get/set the EFER values via
KVM_GET_SREGS/KVM_SET_SREGS, since the EFER contents tracked by the host
will be missing the EFER_LMA bit, and when userspace attempts to pass
the EFER value back via KVM_SET_SREGS it will fail a sanity check that
asserts that EFER_LMA should always be set when X86_CR0_PG and EFER_LME
are set.

Fix this by always inferring the value of EFER_LMA based on X86_CR0_PG
and EFER_LME, regardless of whether or not SEV-ES is enabled.

Fixes: f1c6366e30 ("KVM: SVM: Add required changes to support intercepts under SEV-ES")
Reported-by: Peter Gonda <pgonda@google.com>
Cc: stable@vger.kernel.org
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20210507165947.2502412-2-seanjc@google.com>
[A two year old patch that was revived after we noticed the failure in
 KVM_SET_SREGS and a similar patch was posted by Michael Roth.  This is
 Sean's patch, but with Michael's more complete commit message. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2023-12-08 13:37:05 -05:00
Armin Wolf 307004e8b2 hwmon: (corsair-psu) Fix probe when built-in
It seems that when the driver is built-in, the HID bus is
initialized after the driver is loaded, which whould cause
module_hid_driver() to fail.
Fix this by registering the driver after the HID bus using
late_initcall() in accordance with other hwmon HID drivers.

Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20231207210723.222552-1-W_Armin@gmx.de
[groeck: Dropped "compile tested" comment; the patch has been tested
 but the tester did not provide a Tested-by: tag]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-12-08 10:36:02 -08:00
David Woodhouse 96f124015f KVM: selftests: add -MP to CFLAGS
Using -MD without -MP causes build failures when a header file is deleted
or moved. With -MP, the compiler will emit phony targets for the header
files it lists as dependencies, and the Makefiles won't refuse to attempt
to rebuild a C unit which no longer includes the deleted header.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Link: https://lore.kernel.org/r/9fc8b5395321abbfcaf5d78477a9a7cd350b08e4.camel@infradead.org
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2023-12-08 13:18:50 -05:00
angquan yu 4a073e8134 KVM: selftests: Actually print out magic token in NX hugepages skip message
Pass MAGIC_TOKEN to __TEST_REQUIRE() when printing the help message about
needing to pass a magic value to manually run the NX hugepages test,
otherwise the help message will contain garbage.

  In file included from x86_64/nx_huge_pages_test.c:15:
  x86_64/nx_huge_pages_test.c: In function ‘main’:
  include/test_util.h:40:32: error: format ‘%d’ expects a matching ‘int’ argument [-Werror=format=]
     40 |                 ksft_exit_skip("- " fmt "\n", ##__VA_ARGS__);   \
        |                                ^~~~
  x86_64/nx_huge_pages_test.c:259:9: note: in expansion of macro ‘__TEST_REQUIRE’
    259 |         __TEST_REQUIRE(token == MAGIC_TOKEN,
        |         ^~~~~~~~~~~~~~

Signed-off-by: angquan yu <angquan21@gmail.com>
Link: https://lore.kernel.org/r/20231128221105.63093-1-angquan21@gmail.com
[sean: rewrite shortlog+changelog]
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2023-12-08 13:18:45 -05:00
Paolo Bonzini 6254eebad4 KVM fixes for 6.7-rcN:
- When checking if a _running_ vCPU is "in-kernel", i.e. running at CPL0,
    get the CPL directly instead of relying on preempted_in_kernel, which
    is valid if and only if the vCPU was preempted, i.e. NOT running.
 
  - Set .owner for various KVM file_operations so that files refcount the
    KVM module until KVM is done executing _all_ code, including the last
    few instructions of kvm_put_kvm().  And then revert the misguided
    attempt to rely on "struct kvm" refcounts to pin KVM-the-module.
 
  - Fix a benign "return void" that was recently introduced.
 -----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCgAwFiEEMHr+pfEFOIzK+KY1YJEiAU0MEvkFAmVyeV0SHHNlYW5qY0Bn
 b29nbGUuY29tAAoJEGCRIgFNDBL5aJIP/izKZivi/kZjuuKp2c1W2XM+mBZlM+Yj
 qYcdV0rZygQJOZXTpMaEVg7iUtvbwAT495nm8sXr/IxXw+omMcP+qyLRCZ6JafYy
 B19buCnAt2DymlJOurFzlIEeWtunkxk/gFLMB/BnSrok88cKz5PMxAVFPPBXsTms
 ZqSFlDhzG0G4Mxhr8t0elyjd4HrCbNjCn1MhJg+uzFHKakfOvbST5jO02LkTeIM2
 VFrqWZo1C6uPDrA8TzWzik54qOrDFrodNv/XvIJ0szgVOc+7Iwxy80A/v7o7jBET
 igH+6F3cbST5uoKFrFn7pPJdTOfX2u18DXcpxiYIu+24ToKyqdE1Np9M5W4ZMX/9
 Im5ilykfylHpRYAL4tECD6Jzd/Q/xIvpe8Uk6HTfFAtb/UdMY35/1keBnnkI2oj8
 /4USM7AHNiqoAs4+OE4kZslrFG8ttv3vIOr7Mtk2UjGyGp8TH8sRFYPJKToXsQIJ
 Gs96rsbiU+oo/IDp3UiRhWtwpwfKGbkDLp4r/3X6UOx6Re5u1ITVIoM14qFQaw3W
 CKdHKN/MoreYLS5gasjaGRSyQNJPonaS10l8SqzWflrUBZYfyjCNKliihjKood2g
 JykH4p69IFTWADT2VbrGCQVKfY1GJCxGwpGePFmChTsPUiQ2P+AbHCmaefnIRRbK
 8UR/OmsDtFRZ
 =gWp0
 -----END PGP SIGNATURE-----

Merge tag 'kvm-x86-fixes-6.7-rcN' of https://github.com/kvm-x86/linux into kvm-master

KVM fixes for 6.7-rcN:

 - When checking if a _running_ vCPU is "in-kernel", i.e. running at CPL0,
   get the CPL directly instead of relying on preempted_in_kernel, which
   is valid if and only if the vCPU was preempted, i.e. NOT running.

 - Set .owner for various KVM file_operations so that files refcount the
   KVM module until KVM is done executing _all_ code, including the last
   few instructions of kvm_put_kvm().  And then revert the misguided
   attempt to rely on "struct kvm" refcounts to pin KVM-the-module.

 - Fix a benign "return void" that was recently introduced.
2023-12-08 13:13:45 -05:00