Source-Changes archive

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

CVS commit: [netbsd-10] src/sys/arch



Module Name:    src
Committed By:   martin
Date:           Sat Sep 21 12:20:23 UTC 2024

Modified Files:
        src/sys/arch/amd64/amd64 [netbsd-10]: db_interface.c
        src/sys/arch/i386/i386 [netbsd-10]: db_interface.c

Log Message:
Pull up following revision(s) (requested by rin in ticket #900):

        sys/arch/amd64/amd64/db_interface.c: revision 1.42
        sys/arch/i386/i386/db_interface.c: revision 1.89

when cpus are paused (spinning) in DDB, call x86_pause() in the loop,
hopefully this can reduce power usage while doing nothing.

ok chs@
XXX: apply to i386

i386: DDB: Call x86_pause() (`pause` insn) when CPUs are paused
as already done for amd64:
https://mail-index.netbsd.org/source-changes/2023/07/31/msg146423.html

`pause` insn has been introduced to Pentium 4. However, its opcode is
consisted of `nop` (0x90) followed by `rep` prefix (0xf3), and therefore
interpreted as `nop` for older processors. Intel assured this behavior [1].

Also note that we already use `pause` unconditionally for i386.

Briefly tested on QEMU.

[1] Intel, ``AP-949 Using Spin-Loops on Intel Pentium 4 Processor and
    Intel Xeon Processor'', Version 2.1, Sec 2.1.1. (2001)


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.41.2.1 src/sys/arch/amd64/amd64/db_interface.c
cvs rdiff -u -r1.88 -r1.88.2.1 src/sys/arch/i386/i386/db_interface.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index