aboutsummaryrefslogtreecommitdiffstats
diff options
-rw-r--r--queue-6.1/arm64-restrict-pagetable-teardown-to-avoid-false-warning.patch46
-rw-r--r--queue-6.1/firmware-arm_scmi-add-a-common-helper-to-check-if-a-message-is-supported.patch88
-rw-r--r--queue-6.1/firmware-arm_scmi-ensure-that-the-message-id-supports-fastchannel.patch153
-rw-r--r--queue-6.1/io_uring-kbuf-account-ring-io_buffer_list-memory.patch34
-rw-r--r--queue-6.1/nvme-always-punt-polled-uring_cmd-end_io-work-to-task_work.patch60
-rw-r--r--queue-6.1/series5
6 files changed, 386 insertions, 0 deletions
diff --git a/queue-6.1/arm64-restrict-pagetable-teardown-to-avoid-false-warning.patch b/queue-6.1/arm64-restrict-pagetable-teardown-to-avoid-false-warning.patch
new file mode 100644
index 0000000000..8140c70030
--- /dev/null
+++ b/queue-6.1/arm64-restrict-pagetable-teardown-to-avoid-false-warning.patch
@@ -0,0 +1,46 @@
+From 650768c512faba8070bf4cfbb28c95eb5cd203f3 Mon Sep 17 00:00:00 2001
+From: Dev Jain <dev.jain@arm.com>
+Date: Tue, 27 May 2025 13:56:33 +0530
+Subject: arm64: Restrict pagetable teardown to avoid false warning
+
+From: Dev Jain <dev.jain@arm.com>
+
+commit 650768c512faba8070bf4cfbb28c95eb5cd203f3 upstream.
+
+Commit 9c006972c3fe ("arm64: mmu: drop pXd_present() checks from
+pXd_free_pYd_table()") removes the pxd_present() checks because the
+caller checks pxd_present(). But, in case of vmap_try_huge_pud(), the
+caller only checks pud_present(); pud_free_pmd_page() recurses on each
+pmd through pmd_free_pte_page(), wherein the pmd may be none. Thus it is
+possible to hit a warning in the latter, since pmd_none => !pmd_table().
+Thus, add a pmd_present() check in pud_free_pmd_page().
+
+This problem was found by code inspection.
+
+Fixes: 9c006972c3fe ("arm64: mmu: drop pXd_present() checks from pXd_free_pYd_table()")
+Cc: stable@vger.kernel.org
+Reported-by: Ryan Roberts <ryan.roberts@arm.com>
+Acked-by: David Hildenbrand <david@redhat.com>
+Signed-off-by: Dev Jain <dev.jain@arm.com>
+Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
+Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
+Reviewed-by: Ryan Roberts <ryan.roberts@arm.com>
+Link: https://lore.kernel.org/r/20250527082633.61073-1-dev.jain@arm.com
+Signed-off-by: Will Deacon <will@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/arm64/mm/mmu.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/arch/arm64/mm/mmu.c
++++ b/arch/arm64/mm/mmu.c
+@@ -1503,7 +1503,8 @@ int pud_free_pmd_page(pud_t *pudp, unsig
+ next = addr;
+ end = addr + PUD_SIZE;
+ do {
+- pmd_free_pte_page(pmdp, next);
++ if (pmd_present(READ_ONCE(*pmdp)))
++ pmd_free_pte_page(pmdp, next);
+ } while (pmdp++, next += PMD_SIZE, next != end);
+
+ pud_clear(pudp);
diff --git a/queue-6.1/firmware-arm_scmi-add-a-common-helper-to-check-if-a-message-is-supported.patch b/queue-6.1/firmware-arm_scmi-add-a-common-helper-to-check-if-a-message-is-supported.patch
new file mode 100644
index 0000000000..9d6097d316
--- /dev/null
+++ b/queue-6.1/firmware-arm_scmi-add-a-common-helper-to-check-if-a-message-is-supported.patch
@@ -0,0 +1,88 @@
+From 637b6d6cae9c42db5a9525da67c991294924d2cd Mon Sep 17 00:00:00 2001
+From: Cristian Marussi <cristian.marussi@arm.com>
+Date: Mon, 12 Feb 2024 12:32:24 +0000
+Subject: firmware: arm_scmi: Add a common helper to check if a message is supported
+
+From: Cristian Marussi <cristian.marussi@arm.com>
+
+commit 637b6d6cae9c42db5a9525da67c991294924d2cd upstream.
+
+A common helper is provided to check if a specific protocol message is
+supported or not.
+
+Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
+Link: https://lore.kernel.org/r/20240212123233.1230090-3-cristian.marussi@arm.com
+Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/firmware/arm_scmi/driver.c | 34 ++++++++++++++++++++++++++++++++++
+ drivers/firmware/arm_scmi/protocols.h | 4 ++++
+ 2 files changed, 38 insertions(+)
+
+--- a/drivers/firmware/arm_scmi/driver.c
++++ b/drivers/firmware/arm_scmi/driver.c
+@@ -1450,10 +1450,44 @@ static void scmi_common_fastchannel_db_r
+ #endif
+ }
+
++/**
++ * scmi_protocol_msg_check - Check protocol message attributes
++ *
++ * @ph: A reference to the protocol handle.
++ * @message_id: The ID of the message to check.
++ * @attributes: A parameter to optionally return the retrieved message
++ * attributes, in case of Success.
++ *
++ * An helper to check protocol message attributes for a specific protocol
++ * and message pair.
++ *
++ * Return: 0 on SUCCESS
++ */
++static int scmi_protocol_msg_check(const struct scmi_protocol_handle *ph,
++ u32 message_id, u32 *attributes)
++{
++ int ret;
++ struct scmi_xfer *t;
++
++ ret = xfer_get_init(ph, PROTOCOL_MESSAGE_ATTRIBUTES,
++ sizeof(__le32), 0, &t);
++ if (ret)
++ return ret;
++
++ put_unaligned_le32(message_id, t->tx.buf);
++ ret = do_xfer(ph, t);
++ if (!ret && attributes)
++ *attributes = get_unaligned_le32(t->rx.buf);
++ xfer_put(ph, t);
++
++ return ret;
++}
++
+ static const struct scmi_proto_helpers_ops helpers_ops = {
+ .extended_name_get = scmi_common_extended_name_get,
+ .iter_response_init = scmi_iterator_init,
+ .iter_response_run = scmi_iterator_run,
++ .protocol_msg_check = scmi_protocol_msg_check,
+ .fastchannel_init = scmi_common_fastchannel_init,
+ .fastchannel_db_ring = scmi_common_fastchannel_db_ring,
+ };
+--- a/drivers/firmware/arm_scmi/protocols.h
++++ b/drivers/firmware/arm_scmi/protocols.h
+@@ -243,6 +243,8 @@ struct scmi_fc_info {
+ * provided in @ops.
+ * @iter_response_run: A common helper to trigger the run of a previously
+ * initialized iterator.
++ * @protocol_msg_check: A common helper to check is a specific protocol message
++ * is supported.
+ * @fastchannel_init: A common helper used to initialize FC descriptors by
+ * gathering FC descriptions from the SCMI platform server.
+ * @fastchannel_db_ring: A common helper to ring a FC doorbell.
+@@ -255,6 +257,8 @@ struct scmi_proto_helpers_ops {
+ unsigned int max_resources, u8 msg_id,
+ size_t tx_size, void *priv);
+ int (*iter_response_run)(void *iter);
++ int (*protocol_msg_check)(const struct scmi_protocol_handle *ph,
++ u32 message_id, u32 *attributes);
+ void (*fastchannel_init)(const struct scmi_protocol_handle *ph,
+ u8 describe_id, u32 message_id,
+ u32 valid_size, u32 domain,
diff --git a/queue-6.1/firmware-arm_scmi-ensure-that-the-message-id-supports-fastchannel.patch b/queue-6.1/firmware-arm_scmi-ensure-that-the-message-id-supports-fastchannel.patch
new file mode 100644
index 0000000000..9c11faff29
--- /dev/null
+++ b/queue-6.1/firmware-arm_scmi-ensure-that-the-message-id-supports-fastchannel.patch
@@ -0,0 +1,153 @@
+From 94a263f981a3fa3d93f65c31e0fed0756736be43 Mon Sep 17 00:00:00 2001
+From: Sibi Sankar <quic_sibis@quicinc.com>
+Date: Tue, 29 Apr 2025 15:11:06 +0100
+Subject: firmware: arm_scmi: Ensure that the message-id supports fastchannel
+
+From: Sibi Sankar <quic_sibis@quicinc.com>
+
+commit 94a263f981a3fa3d93f65c31e0fed0756736be43 upstream.
+
+Currently the perf and powercap protocol relies on the protocol domain
+attributes, which just ensures that one fastchannel per domain, before
+instantiating fastchannels for all possible message-ids. Fix this by
+ensuring that each message-id supports fastchannel before initialization.
+
+Logs:
+ | scmi: Failed to get FC for protocol 13 [MSG_ID:6 / RES_ID:0] - ret:-95. Using regular messaging
+ | scmi: Failed to get FC for protocol 13 [MSG_ID:6 / RES_ID:1] - ret:-95. Using regular messaging
+ | scmi: Failed to get FC for protocol 13 [MSG_ID:6 / RES_ID:2] - ret:-95. Using regular messaging
+
+CC: stable@vger.kernel.org
+Reported-by: Johan Hovold <johan+linaro@kernel.org>
+Closes: https://lore.kernel.org/lkml/ZoQjAWse2YxwyRJv@hovoldconsulting.com/
+Fixes: 6f9ea4dabd2d ("firmware: arm_scmi: Generalize the fast channel support")
+Reviewed-by: Johan Hovold <johan+linaro@kernel.org>
+Tested-by: Johan Hovold <johan+linaro@kernel.org>
+Signed-off-by: Sibi Sankar <quic_sibis@quicinc.com>
+[Cristian: Modified the condition checked to establish support or not]
+Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
+Message-Id: <20250429141108.406045-2-cristian.marussi@arm.com>
+Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/firmware/arm_scmi/driver.c | 76 +++++++++++++++++++---------------
+ drivers/firmware/arm_scmi/protocols.h | 2
+ 2 files changed, 45 insertions(+), 33 deletions(-)
+
+--- a/drivers/firmware/arm_scmi/driver.c
++++ b/drivers/firmware/arm_scmi/driver.c
+@@ -1178,6 +1178,39 @@ out:
+ }
+
+ /**
++ * scmi_protocol_msg_check - Check protocol message attributes
++ *
++ * @ph: A reference to the protocol handle.
++ * @message_id: The ID of the message to check.
++ * @attributes: A parameter to optionally return the retrieved message
++ * attributes, in case of Success.
++ *
++ * An helper to check protocol message attributes for a specific protocol
++ * and message pair.
++ *
++ * Return: 0 on SUCCESS
++ */
++static int scmi_protocol_msg_check(const struct scmi_protocol_handle *ph,
++ u32 message_id, u32 *attributes)
++{
++ int ret;
++ struct scmi_xfer *t;
++
++ ret = xfer_get_init(ph, PROTOCOL_MESSAGE_ATTRIBUTES,
++ sizeof(__le32), 0, &t);
++ if (ret)
++ return ret;
++
++ put_unaligned_le32(message_id, t->tx.buf);
++ ret = do_xfer(ph, t);
++ if (!ret && attributes)
++ *attributes = get_unaligned_le32(t->rx.buf);
++ xfer_put(ph, t);
++
++ return ret;
++}
++
++/**
+ * struct scmi_iterator - Iterator descriptor
+ * @msg: A reference to the message TX buffer; filled by @prepare_message with
+ * a proper custom command payload for each multi-part command request.
+@@ -1318,6 +1351,7 @@ scmi_common_fastchannel_init(const struc
+ int ret;
+ u32 flags;
+ u64 phys_addr;
++ u32 attributes;
+ u8 size;
+ void __iomem *addr;
+ struct scmi_xfer *t;
+@@ -1326,6 +1360,15 @@ scmi_common_fastchannel_init(const struc
+ struct scmi_msg_resp_desc_fc *resp;
+ const struct scmi_protocol_instance *pi = ph_to_pi(ph);
+
++ /* Check if the MSG_ID supports fastchannel */
++ ret = scmi_protocol_msg_check(ph, message_id, &attributes);
++ if (ret || !MSG_SUPPORTS_FASTCHANNEL(attributes)) {
++ dev_dbg(ph->dev,
++ "Skip FC init for 0x%02X/%d domain:%d - ret:%d\n",
++ pi->proto->id, message_id, domain, ret);
++ return;
++ }
++
+ if (!p_addr) {
+ ret = -EINVAL;
+ goto err_out;
+@@ -1450,39 +1493,6 @@ static void scmi_common_fastchannel_db_r
+ #endif
+ }
+
+-/**
+- * scmi_protocol_msg_check - Check protocol message attributes
+- *
+- * @ph: A reference to the protocol handle.
+- * @message_id: The ID of the message to check.
+- * @attributes: A parameter to optionally return the retrieved message
+- * attributes, in case of Success.
+- *
+- * An helper to check protocol message attributes for a specific protocol
+- * and message pair.
+- *
+- * Return: 0 on SUCCESS
+- */
+-static int scmi_protocol_msg_check(const struct scmi_protocol_handle *ph,
+- u32 message_id, u32 *attributes)
+-{
+- int ret;
+- struct scmi_xfer *t;
+-
+- ret = xfer_get_init(ph, PROTOCOL_MESSAGE_ATTRIBUTES,
+- sizeof(__le32), 0, &t);
+- if (ret)
+- return ret;
+-
+- put_unaligned_le32(message_id, t->tx.buf);
+- ret = do_xfer(ph, t);
+- if (!ret && attributes)
+- *attributes = get_unaligned_le32(t->rx.buf);
+- xfer_put(ph, t);
+-
+- return ret;
+-}
+-
+ static const struct scmi_proto_helpers_ops helpers_ops = {
+ .extended_name_get = scmi_common_extended_name_get,
+ .iter_response_init = scmi_iterator_init,
+--- a/drivers/firmware/arm_scmi/protocols.h
++++ b/drivers/firmware/arm_scmi/protocols.h
+@@ -29,6 +29,8 @@
+ #define PROTOCOL_REV_MAJOR(x) ((u16)(FIELD_GET(PROTOCOL_REV_MAJOR_MASK, (x))))
+ #define PROTOCOL_REV_MINOR(x) ((u16)(FIELD_GET(PROTOCOL_REV_MINOR_MASK, (x))))
+
++#define MSG_SUPPORTS_FASTCHANNEL(x) ((x) & BIT(0))
++
+ enum scmi_common_cmd {
+ PROTOCOL_VERSION = 0x0,
+ PROTOCOL_ATTRIBUTES = 0x1,
diff --git a/queue-6.1/io_uring-kbuf-account-ring-io_buffer_list-memory.patch b/queue-6.1/io_uring-kbuf-account-ring-io_buffer_list-memory.patch
new file mode 100644
index 0000000000..7ce7045edb
--- /dev/null
+++ b/queue-6.1/io_uring-kbuf-account-ring-io_buffer_list-memory.patch
@@ -0,0 +1,34 @@
+From ab1fb42ebf1ccf33ed8c4d4cfd705d2ff8bcf766 Mon Sep 17 00:00:00 2001
+From: Pavel Begunkov <asml.silence@gmail.com>
+Date: Tue, 13 May 2025 18:26:46 +0100
+Subject: io_uring/kbuf: account ring io_buffer_list memory
+
+From: Pavel Begunkov <asml.silence@gmail.com>
+
+Commit 475a8d30371604a6363da8e304a608a5959afc40 upstream.
+
+Follow the non-ringed pbuf struct io_buffer_list allocations and account
+it against the memcg. There is low chance of that being an actual
+problem as ring provided buffer should either pin user memory or
+allocate it, which is already accounted.
+
+Cc: stable@vger.kernel.org # 6.1
+Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
+Link: https://lore.kernel.org/r/3985218b50d341273cafff7234e1a7e6d0db9808.1747150490.git.asml.silence@gmail.com
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ io_uring/kbuf.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/io_uring/kbuf.c
++++ b/io_uring/kbuf.c
+@@ -510,7 +510,7 @@ int io_register_pbuf_ring(struct io_ring
+ if (bl->buf_nr_pages || !list_empty(&bl->buf_list))
+ return -EEXIST;
+ } else {
+- free_bl = bl = kzalloc(sizeof(*bl), GFP_KERNEL);
++ free_bl = bl = kzalloc(sizeof(*bl), GFP_KERNEL_ACCOUNT);
+ if (!bl)
+ return -ENOMEM;
+ }
diff --git a/queue-6.1/nvme-always-punt-polled-uring_cmd-end_io-work-to-task_work.patch b/queue-6.1/nvme-always-punt-polled-uring_cmd-end_io-work-to-task_work.patch
new file mode 100644
index 0000000000..a9a30a354d
--- /dev/null
+++ b/queue-6.1/nvme-always-punt-polled-uring_cmd-end_io-work-to-task_work.patch
@@ -0,0 +1,60 @@
+From 6c4a3cec0e463c3bea91cf625bf4f0ffa21fe934 Mon Sep 17 00:00:00 2001
+From: Jens Axboe <axboe@kernel.dk>
+Date: Fri, 13 Jun 2025 13:37:41 -0600
+Subject: nvme: always punt polled uring_cmd end_io work to task_work
+
+From: Jens Axboe <axboe@kernel.dk>
+
+Commit 9ce6c9875f3e995be5fd720b65835291f8a609b1 upstream.
+
+Currently NVMe uring_cmd completions will complete locally, if they are
+polled. This is done because those completions are always invoked from
+task context. And while that is true, there's no guarantee that it's
+invoked under the right ring context, or even task. If someone does
+NVMe passthrough via multiple threads and with a limited number of
+poll queues, then ringA may find completions from ringB. For that case,
+completing the request may not be sound.
+
+Always just punt the passthrough completions via task_work, which will
+redirect the completion, if needed.
+
+Cc: stable@vger.kernel.org
+Fixes: 585079b6e425 ("nvme: wire up async polling for io passthrough commands")
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/nvme/host/ioctl.c | 15 +++++++--------
+ 1 file changed, 7 insertions(+), 8 deletions(-)
+
+--- a/drivers/nvme/host/ioctl.c
++++ b/drivers/nvme/host/ioctl.c
+@@ -438,7 +438,6 @@ static enum rq_end_io_ret nvme_uring_cmd
+ {
+ struct io_uring_cmd *ioucmd = req->end_io_data;
+ struct nvme_uring_cmd_pdu *pdu = nvme_uring_cmd_pdu(ioucmd);
+- void *cookie = READ_ONCE(ioucmd->cookie);
+
+ req->bio = pdu->bio;
+ if (nvme_req(req)->flags & NVME_REQ_CANCELLED) {
+@@ -451,14 +450,14 @@ static enum rq_end_io_ret nvme_uring_cmd
+ pdu->u.result = le64_to_cpu(nvme_req(req)->result.u64);
+
+ /*
+- * For iopoll, complete it directly.
+- * Otherwise, move the completion to task work.
++ * IOPOLL could potentially complete this request directly, but
++ * if multiple rings are polling on the same queue, then it's possible
++ * for one ring to find completions for another ring. Punting the
++ * completion via task_work will always direct it to the right
++ * location, rather than potentially complete requests for ringA
++ * under iopoll invocations from ringB.
+ */
+- if (cookie != NULL && blk_rq_is_poll(req))
+- nvme_uring_task_cb(ioucmd, IO_URING_F_UNLOCKED);
+- else
+- io_uring_cmd_complete_in_task(ioucmd, nvme_uring_task_cb);
+-
++ io_uring_cmd_complete_in_task(ioucmd, nvme_uring_task_cb);
+ return RQ_END_IO_FREE;
+ }
+
diff --git a/queue-6.1/series b/queue-6.1/series
index eeceacca5a..36aba393a5 100644
--- a/queue-6.1/series
+++ b/queue-6.1/series
@@ -126,3 +126,8 @@ s390-entry-fix-last-breaking-event-handling-in-case-of-stack-corruption.patch
kunit-to-check-the-longest-symbol-length.patch
x86-tools-drop-duplicate-unlikely-definition-in-insn_decoder_test.c.patch
revert-ipv6-save-dontfrag-in-cork.patch
+nvme-always-punt-polled-uring_cmd-end_io-work-to-task_work.patch
+io_uring-kbuf-account-ring-io_buffer_list-memory.patch
+firmware-arm_scmi-add-a-common-helper-to-check-if-a-message-is-supported.patch
+firmware-arm_scmi-ensure-that-the-message-id-supports-fastchannel.patch
+arm64-restrict-pagetable-teardown-to-avoid-false-warning.patch