diff mbox series

[06/29] x86/fpu: Update comment for __raw_xsave_addr()

Message ID 20181128222035.2996-7-bigeasy@linutronix.de (mailing list archive)
State New, archived
Headers show
Series [01/29] x86/fpu: Use ULL for shift in xfeature_uncompacted_offset() | expand

Commit Message

Sebastian Andrzej Siewior Nov. 28, 2018, 10:20 p.m. UTC
The comment above __raw_xsave_addr() claims that the function does not
work for compacted buffers and was introduced in commit
  b8b9b6ba9dec3("x86/fpu: Allow setting of XSAVE state")

In this commit, the function was factored out of get_xsave_addr() and
this function claims that it works with "standard format or compacted
format of xsave area". It accesses the "xstate_comp_offsets" variable
for the actual offset and it was introduced in commit
  7496d6458fe32 ("Define kernel API to get address of each state in xsave area")

Based on the code (back then and now):
- xstate_offsets holds the standard offset.
- if compacted mode is not supported then xstate_comp_offsets gets the
  xstate_offsets copied.
- if compacted mode is supported then xstate_comp_offsets will hold the
  offset for the compacted buffer.

Based on that the function works for compacted buffers as long as the
CPU supports it and this what we care about.

Remove the "Note:" which is not accurate.

Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 arch/x86/kernel/fpu/xstate.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Rik van Riel Nov. 29, 2018, 1:56 a.m. UTC | #1
On Wed, 2018-11-28 at 23:20 +0100, Sebastian Andrzej Siewior wrote:
> The comment above __raw_xsave_addr() claims that the function does
> not
> work for compacted buffers and was introduced in commit
>   b8b9b6ba9dec3("x86/fpu: Allow setting of XSAVE state")

...

> Based on that the function works for compacted buffers as long as the
> CPU supports it and this what we care about.
> 
> Remove the "Note:" which is not accurate.
> 
> Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

Reviewed-by: Rik van Riel <riel@surriel.com>
diff mbox series

Patch

diff --git a/arch/x86/kernel/fpu/xstate.c b/arch/x86/kernel/fpu/xstate.c
index 69d5740ed2546..359564beab5c3 100644
--- a/arch/x86/kernel/fpu/xstate.c
+++ b/arch/x86/kernel/fpu/xstate.c
@@ -808,8 +808,6 @@  void fpu__resume_cpu(void)
  * Given an xstate feature mask, calculate where in the xsave
  * buffer the state is.  Callers should ensure that the buffer
  * is valid.
- *
- * Note: does not work for compacted buffers.
  */
 void *__raw_xsave_addr(struct xregs_state *xsave, int xstate_feature_mask)
 {