Thread (31 messages) 31 messages, 8 authors, 1d ago

Re: [PATCH 09/11] treewide: Convert custom kernel_param_ops .get callbacks to seq_buf via cocci

From: Sean Christopherson <seanjc@google.com>
Date: 2026-05-21 13:45:07
Also in: dmaengine, dri-devel, intel-gfx, kvm, linux-acpi, linux-arch, linux-fsdevel, linux-hardening, linux-media, linux-mm, linux-pci, linux-pm, linux-rdma, linux-scsi, linux-security-module, linux-serial, linux-um, linux-usb, linuxppc-dev, lkml, netdev, qemu-devel, virtualization

On Thu, May 21, 2026, Kees Cook wrote:
quoted hunk ↗ jump to hunk
diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
index 07f4c7209ac0..00317774a90b 100644
--- a/arch/x86/kvm/vmx/vmx.c
+++ b/arch/x86/kvm/vmx/vmx.c
@@ -368,12 +368,16 @@ static int vmentry_l1d_flush_set(const char *s, const struct kernel_param *kp)
 	return ret;
 }
 
-static int vmentry_l1d_flush_get(char *s, const struct kernel_param *kp)
+static int vmentry_l1d_flush_get(struct seq_buf *s,
+				 const struct kernel_param *kp)
 {
-	if (WARN_ON_ONCE(l1tf_vmx_mitigation >= ARRAY_SIZE(vmentry_l1d_param)))
-		return sysfs_emit(s, "???\n");
+	if (WARN_ON_ONCE(l1tf_vmx_mitigation >= ARRAY_SIZE(vmentry_l1d_param))) {
+		seq_buf_printf(s, "???\n");
+		return 0;
+	}
 
-	return sysfs_emit(s, "%s\n", vmentry_l1d_param[l1tf_vmx_mitigation].option);
+	seq_buf_printf(s, "%s\n", vmentry_l1d_param[l1tf_vmx_mitigation].option);
+	return 0;
For this one, can you manually change it to this?

	if (WARN_ON_ONCE(l1tf_vmx_mitigation >= ARRAY_SIZE(vmentry_l1d_param)))
		seq_buf_printf(s, "???\n");
	else
		seq_buf_printf(s, "%s\n", vmentry_l1d_param[l1tf_vmx_mitigation].option);
	return 0;
quoted hunk ↗ jump to hunk
 }
 
 /*
@@ -459,9 +463,11 @@ static int vmentry_l1d_flush_set(const char *s, const struct kernel_param *kp)
 	pr_warn_once("Kernel compiled without mitigations, ignoring vmentry_l1d_flush\n");
 	return 0;
 }
-static int vmentry_l1d_flush_get(char *s, const struct kernel_param *kp)
+static int vmentry_l1d_flush_get(struct seq_buf *s,
+				 const struct kernel_param *kp)
 {
-	return sysfs_emit(s, "never\n");
+	seq_buf_printf(s, "never\n");
+	return 0;
 }
 #endif
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help