From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7013CCD4F3D for ; Thu, 21 May 2026 13:45:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 07D4510E506; Thu, 21 May 2026 13:45:07 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="L+k27K1R"; dkim-atps=neutral Received: from mail-pg1-f201.google.com (mail-pg1-f201.google.com [209.85.215.201]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6BC5810E506 for ; Thu, 21 May 2026 13:45:06 +0000 (UTC) Received: by mail-pg1-f201.google.com with SMTP id 41be03b00d2f7-c8271fb43d0so3444809a12.1 for ; Thu, 21 May 2026 06:45:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1779371106; x=1779975906; darn=lists.freedesktop.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=Dnh9Qdh/Ek2SFmUD3YQQhAJ1lm8lFb5yTi3rkZyIV7s=; b=L+k27K1RkHt87vz27HCbs0NyB7vCn2VE4aAzRC79HjS0P4ZqZ7Ncy0dgGTIlyIJmdl XbaSc9RGdeD7cZOqc4qb6HuZlosqdrIHWK/U0DD9Mo5Cf2rdTaF9l3AcPPhayM3t4ysQ Un9TQrK3poYT/VDNGKseQeKSd7uJ9PdKli+Wz7tYTP5N8Ctfc0iES8ERJMDdVCOpLws2 O3G+zGN+h0/LI6YBGGZYBRnuw9e7qICgY7zemcAvtc9ALtotrJ9qgi9tD8CH6r3JNnoc SCFVkNLTO5WgJFqyqNS/7wr4LuaTjJIMxmjOiRj1BrRqCM/OYGRY29gaEXeZQboSQ6la vz3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779371106; x=1779975906; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Dnh9Qdh/Ek2SFmUD3YQQhAJ1lm8lFb5yTi3rkZyIV7s=; b=CHN5GWztiEqN8mlOTMNluiIQ2Ne0DV5ACCQnYUJrBMqaE8zlykRu6aLQjUS8d5R/Vh Q6nJ+yUXcmGnlQkBXt6zqkWAozRK/s7agclYd2BxX945MPv8SUkpG+TE9CS9sWgfpyrY daKCTFmblaqBcgojYCdGrR4w0pd+9E0QhUetFvu3tBFDYp9+QfhbngOUG4KCFTfr8En4 B7S4VVScnJWoLLTC5Tyzsrjkm0mh4INTTECmEZXWveBju6YBeS4/NQRtTPH5kP8hQh64 LwryUHsOlTCMH5fFpPBZwe2zReQ6fcIH/MA1HiVZWB1CJLnt0BoSV350Z8EJCGzOqocj yMjg== X-Forwarded-Encrypted: i=1; AFNElJ/eoBa1T9vw8N4ZeJ2oGDiu4LnYhGOhurp8G34tK4nVsG1uZhqKDc6jaVBj6AUcYetuzlsT9gzrDSc=@lists.freedesktop.org X-Gm-Message-State: AOJu0YxLcZrVUtT1WzHjjci//Rcji1Vr1waHCbvOkBMESqudeJFtJohT EF9pWA1seFuzD4ycn2XhFEStfifz7rkWl136L8mCw3e9wudNtGwlnSnVJZpy8uq9luWhJuDZSi2 B77ID2A== X-Received: from pgvm13.prod.google.com ([2002:a65:62cd:0:b0:c85:1159:ffbd]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a20:7491:b0:3a0:bc61:62e5 with SMTP id adf61e73a8af0-3b30883a17bmr3700528637.44.1779371104725; Thu, 21 May 2026 06:45:04 -0700 (PDT) Date: Thu, 21 May 2026 06:45:04 -0700 In-Reply-To: <20260521133326.2465264-9-kees@kernel.org> Mime-Version: 1.0 References: <20260521133315.work.845-kees@kernel.org> <20260521133326.2465264-9-kees@kernel.org> Message-ID: Subject: Re: [PATCH 09/11] treewide: Convert custom kernel_param_ops .get callbacks to seq_buf via cocci From: Sean Christopherson To: Kees Cook Cc: Luis Chamberlain , Pengpeng Hou , Petr Pavlu , Richard Weinberger , Anton Ivanov , Johannes Berg , "Rafael J. Wysocki" , Len Brown , Corey Minyard , Gabriel Somlo , "Michael S. Tsirkin" , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , David Airlie , Simona Vetter , Bart Van Assche , Jason Gunthorpe , Leon Romanovsky , Laurent Pinchart , Hans de Goede , Mauro Carvalho Chehab , Bjorn Helgaas , Hannes Reinecke , "James E.J. Bottomley" , "Martin K. Petersen" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Greg Kroah-Hartman , Jiri Slaby , Alan Stern , Jason Wang , Xuan Zhuo , "Eugenio =?utf-8?B?UMOpcmV6?=" , Jason Baron , Jim Cromie , Tiwei Bie , Benjamin Berg , "Ilpo =?utf-8?B?SsOkcnZpbmVu?=" , "David E. Box" , "Maciej W. Rozycki" , Srinivas Pandruvada , Peter Zijlstra , Heiko Carstens , Vasily Gorbik , Paolo Bonzini , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Vinod Koul , Frank Li , Daniel Gomez , Sami Tolvanen , Aaron Tomlin , Alexander Potapenko , Marco Elver , Dmitry Vyukov , Andrew Morton , John Johansen , Paul Moore , James Morris , "Serge E. Hallyn" , Andy Shevchenko , Georgia Garcia , kvm@vger.kernel.org, dmaengine@vger.kernel.org, linux-modules@vger.kernel.org, kasan-dev@googlegroups.com, linux-mm@kvack.org, apparmor@lists.ubuntu.com, linux-security-module@vger.kernel.org, linux-um@lists.infradead.org, linux-acpi@vger.kernel.org, openipmi-developer@lists.sourceforge.net, qemu-devel@nongnu.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-rdma@vger.kernel.org, linux-media@vger.kernel.org, linux-pci@vger.kernel.org, linux-scsi@vger.kernel.org, linux-pm@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-serial@vger.kernel.org, linux-usb@vger.kernel.org, usb-storage@lists.one-eyed-alien.net, virtualization@lists.linux.dev, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, netdev@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-hardening@vger.kernel.org Content-Type: text/plain; charset="us-ascii" X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Thu, May 21, 2026, Kees Cook wrote: > 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; > } > > /* > @@ -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