[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen staging] x86/mwait-idle: mention assumption that WBINVD is not needed



commit 07d134e1745b696e63044ffb43d2bb60899e57d6
Author:     Alexander Monakov <amonakov@xxxxxxxxx>
AuthorDate: Wed Jan 19 13:44:31 2022 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Jan 19 13:44:31 2022 +0100

    x86/mwait-idle: mention assumption that WBINVD is not needed
    
    Intel SDM does not explicitly say that entering a C-state via MWAIT will
    implicitly flush CPU caches as appropriate for that C-state. However,
    documentation for individual Intel CPU generations does mention this
    behavior.
    
    Since intel_idle binds to any Intel CPU with MWAIT, list this assumption
    of MWAIT behavior.
    
    In passing, reword opening comment to make it clear that the driver can
    load on any old and future Intel CPU with MWAIT.
    
    Signed-off-by: Alexander Monakov <amonakov@xxxxxxxxx>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
    [Linux commit: 8bb2e2a887afdf8a39e68fa0dccf82a168aae655]
    
    Dropped "reword opending comment" part - this doesn't apply to our code:
    First thing mwait_idle_probe() does is call x86_match_cpu(); we do not
    have a 2nd such call looking for just MWAIT (in order to the use _CST
    data directly, which we can't get our hands at _CST at this point yet).
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Acked-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
 xen/arch/x86/cpu/mwait-idle.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index d1739f6fc3..5c9dc0405f 100644
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -31,6 +31,10 @@
  *
  * Chipset BM_STS (bus master status) bit is a NOP
  *     for preventing entry into deep C-states
+ *
+ * CPU will flush caches as needed when entering a C-state via MWAIT
+ *     (in contrast to entering ACPI C3, in which case the WBINVD
+ *     instruction needs to be executed to flush the caches)
  */
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.