diff mbox series

[v3,4/4] x86/spec: do not print thunk option selection if not built-in

Message ID 20240226110748.80254-5-roger.pau@citrix.com (mailing list archive)
State New, archived
Headers show
Series x86/spec: improve command line parsing | expand

Commit Message

Roger Pau Monné Feb. 26, 2024, 11:07 a.m. UTC
Now that the thunk built-in enable is printed as part of the "Compiled-in
support:" line, avoid printing anything in "Xen settings:" if the thunk is
disabled at build time.

Note the BTI-Thunk option printing is also adjusted to print a colon in the
same way the other options on the line do.

Requested-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
Changes since v3:
 - New in this version.
---
 xen/arch/x86/spec_ctrl.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

Comments

Jan Beulich Feb. 26, 2024, 12:54 p.m. UTC | #1
On 26.02.2024 12:07, Roger Pau Monne wrote:
> Now that the thunk built-in enable is printed as part of the "Compiled-in
> support:" line, avoid printing anything in "Xen settings:" if the thunk is
> disabled at build time.

Why "Now that ..."? It's other logging the earlier patch adds there.

> Note the BTI-Thunk option printing is also adjusted to print a colon in the
> same way the other options on the line do.
> 
> Requested-by: Jan Beulich <jbeulich@suse.com>
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>

With either a clarification of what's meant or e.g. s/Now that/Since/
Reviewed-by: Jan Beulich <jbeulich@suse.com>

Jan
Roger Pau Monné Feb. 27, 2024, 11:20 a.m. UTC | #2
On Mon, Feb 26, 2024 at 01:54:54PM +0100, Jan Beulich wrote:
> On 26.02.2024 12:07, Roger Pau Monne wrote:
> > Now that the thunk built-in enable is printed as part of the "Compiled-in
> > support:" line, avoid printing anything in "Xen settings:" if the thunk is
> > disabled at build time.
> 
> Why "Now that ..."? It's other logging the earlier patch adds there.

'Now that ...'  would refer to patch 1/4.

> > Note the BTI-Thunk option printing is also adjusted to print a colon in the
> > same way the other options on the line do.
> > 
> > Requested-by: Jan Beulich <jbeulich@suse.com>
> > Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> 
> With either a clarification of what's meant or e.g. s/Now that/Since/
> Reviewed-by: Jan Beulich <jbeulich@suse.com>

'Since' is likely more appropriate.

Thanks, Roger.
Jan Beulich Feb. 27, 2024, 1:23 p.m. UTC | #3
On 27.02.2024 12:20, Roger Pau Monné wrote:
> On Mon, Feb 26, 2024 at 01:54:54PM +0100, Jan Beulich wrote:
>> On 26.02.2024 12:07, Roger Pau Monne wrote:
>>> Now that the thunk built-in enable is printed as part of the "Compiled-in
>>> support:" line, avoid printing anything in "Xen settings:" if the thunk is
>>> disabled at build time.
>>
>> Why "Now that ..."? It's other logging the earlier patch adds there.
> 
> 'Now that ...'  would refer to patch 1/4.

But that's why I'm asking: Patch 1 does not add any printing for thunk
usage; it extends that and shadow-paging's printing by the three
hardening ones. But anyway ...

>>> Note the BTI-Thunk option printing is also adjusted to print a colon in the
>>> same way the other options on the line do.
>>>
>>> Requested-by: Jan Beulich <jbeulich@suse.com>
>>> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
>>
>> With either a clarification of what's meant or e.g. s/Now that/Since/
>> Reviewed-by: Jan Beulich <jbeulich@suse.com>
> 
> 'Since' is likely more appropriate.

... I'll switch to this then.

Jan
diff mbox series

Patch

diff --git a/xen/arch/x86/spec_ctrl.c b/xen/arch/x86/spec_ctrl.c
index ca82b9e41ccd..e8b0e62adba4 100644
--- a/xen/arch/x86/spec_ctrl.c
+++ b/xen/arch/x86/spec_ctrl.c
@@ -504,11 +504,12 @@  static void __init print_details(enum ind_thunk thunk)
                "\n");
 
     /* Settings for Xen's protection, irrespective of guests. */
-    printk("  Xen settings: BTI-Thunk %s, SPEC_CTRL: %s%s%s%s%s, Other:%s%s%s%s%s%s\n",
-           thunk == THUNK_NONE      ? "N/A" :
-           thunk == THUNK_RETPOLINE ? "RETPOLINE" :
-           thunk == THUNK_LFENCE    ? "LFENCE" :
-           thunk == THUNK_JMP       ? "JMP" : "?",
+    printk("  Xen settings: %s%sSPEC_CTRL: %s%s%s%s%s, Other:%s%s%s%s%s%s\n",
+           thunk != THUNK_NONE      ? "BTI-Thunk: " : "",
+           thunk == THUNK_NONE      ? "" :
+           thunk == THUNK_RETPOLINE ? "RETPOLINE, " :
+           thunk == THUNK_LFENCE    ? "LFENCE, " :
+           thunk == THUNK_JMP       ? "JMP, " : "?, ",
            (!boot_cpu_has(X86_FEATURE_IBRSB) &&
             !boot_cpu_has(X86_FEATURE_IBRS))         ? "No" :
            (default_xen_spec_ctrl & SPEC_CTRL_IBRS)  ? "IBRS+" :  "IBRS-",