[PATCH] xen/console: add comment about external console lock helper

Roger Pau Monne posted 1 patch 1 month, 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20240321110503.72916-1-roger.pau@citrix.com
xen/include/xen/console.h | 1 +
1 file changed, 1 insertion(+)
[PATCH] xen/console: add comment about external console lock helper
Posted by Roger Pau Monne 1 month, 1 week ago
The current console_lock_recursive_irqsave() implementation is not speculation
safe, however it's only used to prevent interleaved output.  Note this in the
function declaration in order for callers to be aware of the limitation.

No functional change.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/include/xen/console.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/include/xen/console.h b/xen/include/xen/console.h
index 68759862e88d..6dfbade3ece3 100644
--- a/xen/include/xen/console.h
+++ b/xen/include/xen/console.h
@@ -20,6 +20,7 @@ void console_init_postirq(void);
 void console_endboot(void);
 int console_has(const char *device);
 
+/* Not speculation safe - only used to prevent interleaving of output. */
 unsigned long console_lock_recursive_irqsave(void);
 void console_unlock_recursive_irqrestore(unsigned long flags);
 void console_force_unlock(void);
-- 
2.44.0


Re: [PATCH] xen/console: add comment about external console lock helper
Posted by Jan Beulich 1 month, 1 week ago
On 21.03.2024 12:05, Roger Pau Monne wrote:
> The current console_lock_recursive_irqsave() implementation is not speculation
> safe, however it's only used to prevent interleaved output.  Note this in the
> function declaration in order for callers to be aware of the limitation.
> 
> No functional change.
> 
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>

Acked-by: Jan Beulich <jbeulich@suse.com>