The branch main has been updated by kib:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=a013e285dfd6b89b1908ca13febb0fdb0a7f3b1f

commit a013e285dfd6b89b1908ca13febb0fdb0a7f3b1f
Author:     Konstantin Belousov <[email protected]>
AuthorDate: 2021-01-10 22:05:49 +0000
Commit:     Konstantin Belousov <[email protected]>
CommitDate: 2021-01-10 22:05:49 +0000

    x86 tsc: mark %eax as earlyclobber in tscp_get_timecount_low().
    
    i386 codegen insists on preloading tc_priv into register on i386, and
    this register cannot be %eax because RDTSCP instruction clobbers it
    before it is used.
    
    Reported and tested by: dim
    MFC after:      6 days
    Sponsored by:   The FreeBSD Foundation
---
 sys/x86/x86/tsc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/x86/x86/tsc.c b/sys/x86/x86/tsc.c
index ad8108c8a7ea..85924df98312 100644
--- a/sys/x86/x86/tsc.c
+++ b/sys/x86/x86/tsc.c
@@ -826,7 +826,7 @@ tscp_get_timecount_low(struct timecounter *tc)
        uint32_t rv;
 
        __asm __volatile("rdtscp; movl %1, %%ecx; shrd %%cl, %%edx, %0"
-           : "=a" (rv) : "m" (tc->tc_priv) : "ecx", "edx");
+           : "=&a" (rv) : "m" (tc->tc_priv) : "ecx", "edx");
        return (rv);
 }
 
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to