All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yan Zhao <yan.y.zhao@intel.com>
To: "Edgecombe, Rick P" <rick.p.edgecombe@intel.com>
Cc: "Gao, Chao" <chao.gao@intel.com>,
	"Hansen, Dave" <dave.hansen@intel.com>,
	"Xu, Yilun" <yilun.xu@intel.com>, "bp@alien8.de" <bp@alien8.de>,
	"kas@kernel.org" <kas@kernel.org>,
	"ackerleytng@google.com" <ackerleytng@google.com>,
	"hpa@zytor.com" <hpa@zytor.com>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"x86@kernel.org" <x86@kernel.org>,
	"tglx@kernel.org" <tglx@kernel.org>,
	"Annapurve, Vishal" <vannapurve@google.com>,
	"nik.borisov@suse.com" <nik.borisov@suse.com>,
	"seanjc@google.com" <seanjc@google.com>
Subject: Re: [PATCH] x86/virt/tdx: Add command line param for DPAMT
Date: Wed, 2 Dec 2026 09:24:23 +0800	[thread overview]
Message-ID: <aw9zR0QE2Kalg083@yzhao56-desk> (raw)
In-Reply-To: <4b613304a9bf823c4045adfc9da7b3bcd1fee474.camel@intel.com>

On Wed, Dec 02, 2026 at 09:14:53AM +0800, Edgecombe, Rick P wrote:
> On Thu, 2026-11-26 at 16:13 +0800, Yan Zhao wrote:
> > > Also, I cherry-picked this from the last DPAMT patchset and didn't retest 
> > > it on upstream yet. Will do, but I'm not expecting problems.
> > Tested working with kvm-x86-next-2026.11.11, which is at v7.4.0-rc2.
> > 
> 
> Thanks! Did you test on and off? Can I add your tested-by?
Yes. On and off. Sure.

> > > +static int __init tdx_dpamt_setup(char *str)
> > > +{
> > > +	return kstrtobool(str, &tdx_enable_dpamt) == 0;
> > > +}
> > > +
> > > +__setup("tdx_dpamt=", tdx_dpamt_setup);
> > It looks like core_param() is perferred over __setup() for a simple typed
> > variable set from the cmdline?
> 
> Hmm... It does seem nice, but there isn't much use in the kernel actually.
Right, core_param() is later introduced. See

Author: Rusty Russell <rusty@rustcorp.com.au>
Date:   Wed Oct 22 10:00:23 2008 -0500

    core_param() for genuinely core kernel parameters

    There are a lot of one-liner uses of __setup() in the kernel: they're
    cumbersome and not queryable (definitely not settable) via /sys.  Yet
    it's ugly to simplify them to module_param(), because by default that
    inserts a prefix of the module name (usually filename).

    So, introduce a "core_param".  The parameter gets no prefix, but
    appears in /sys/module/kernel/parameters/ (if non-zero perms arg).  I
    thought about using the name "core", but that's more common than
    "kernel".  And if you create a module called "kernel", you will die
    a horrible death.

    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>


It looks like  __setup() is an old way, which fills "struct obs_kernel_param"
and gets parsed by obsolete_checksetup() during kernel boot-up.  __setup() does
not have knob in sysfs.

> > How about:
> > core_param(tdx_enable_dpamt, tdx_enable_dpamt, bool, 0444);
> 
> I'm not sure about 0444. We don't even want a sysfs knob for this either. It
> looks like if you pass 0 it skips the sysfs knob.
Hmm, a leading 0 is not a permission bit, but a C's octal prefix.

Only all 0 will skip the sysfs knob. With 0444, there's a sysfs knob:
/sys/module/kernel/parameters/tdx_enable_dpamt, with perms "-r--r--r--".


> > >   void tdx_sys_disable(void)
> > >   {
> > >   	struct tdx_module_args args = {};
> > > -- 
> > > 2.56.1
> 

  reply	other threads:[~2026-12-02  2:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26  0:54 [PATCH] x86/virt/tdx: Add command line param for DPAMT Rick Edgecombe
2026-11-26  8:13 ` Yan Zhao
2026-12-02  0:12   ` Dave Hansen
2026-12-02  1:14   ` Edgecombe, Rick P
2026-12-02  1:24     ` Yan Zhao [this message]
2026-11-26 10:48 ` Nikolay Borisov
2026-11-30 20:02   ` Edgecombe, Rick P
2026-11-30 20:42   ` Dave Hansen
2026-11-30 22:17     ` Nikolay Borisov
2026-11-30 22:20       ` Edgecombe, Rick P
2026-11-30 22:22       ` Dave Hansen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aw9zR0QE2Kalg083@yzhao56-desk \
    --to=yan.y.zhao@intel.com \
    --cc=ackerleytng@google.com \
    --cc=bp@alien8.de \
    --cc=chao.gao@intel.com \
    --cc=dave.hansen@intel.com \
    --cc=hpa@zytor.com \
    --cc=kas@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=nik.borisov@suse.com \
    --cc=rick.p.edgecombe@intel.com \
    --cc=seanjc@google.com \
    --cc=tglx@kernel.org \
    --cc=vannapurve@google.com \
    --cc=x86@kernel.org \
    --cc=yilun.xu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.