'cache'에 해당하는 글 3건

"echo 0x[hex value] > /sys/devices/system/cpu/cpuX/cache/index3/subcache " where each bit within 4 bit hexadecimal mask correspond to each subcache.





WRITTEN BY
RootFriend
개인적으로... 나쁜 기억력에 도움되라고 만들게되었습니다.

,

cache disable

카테고리 없음 2014. 2. 16. 22:13

출처 : http://www.df.lth.se/~john_e/gems/gem000b.html

출처 : http://stackoverflow.com/questions/21265785/enable-disable-cache-on-intel-64bit-machine-cd-bit-always-set




My question is:

Is the CD bit(30bit) of CR0 register always set 1 when cache is disabled?

If not, there must be something wrong with my code, could you please help me point out the error I made?

ANSWER:

The above code only set the CD bit of the CR0 register on the core where the code is running. We need to use the smp_call_function() to call the code on all cores!


; Disable the Cache(s)
;
; input:
;   none
;
; output:
;   none
;
; destroys:
;   noting - (except switching flags)
;

CR0_CD  EQU     040000000h      ; Cache Disable bit of CR0
CR0_NW  EQU     020000000h      ; Not Write-through bit of CR0

        pushf                   ; save the flags
        push    eax             ; save eax
        cli                     ; disable interrupts while we do this
        mov     eax,cr0         ; read CR0
        or      eax,CR0_CD      ; set CD but not NW bit of CR0
        mov     cr0,eax         ; cache is now disabled
        wbinvd                  ; flush and invalidate cache

        ; the cache is effectively disabled at this point, but memory
        ; consistency will be maintained. To completely disable cache,
        ; the following two lines may used as well:

        or      eax,CR0_NW      ; now set the NW bit
        mov     cr0,eax         ; turn off the cache entirely
        pop     eax             ; restore eax
        popf                    ; restore the flags
        ret                     ; return to caller



WRITTEN BY
RootFriend
개인적으로... 나쁜 기억력에 도움되라고 만들게되었습니다.

,

cache problem

카테고리 없음 2011. 11. 21. 23:25
출처 : http://www.iamroot.org/xe/63848#1


http://anyflow.net/242

http://www.hanb.co.kr/network/view.html?bi_id=1334

http://rein.kr/blog/archives/906

리눅스 커널의 이해 책이 상당히 좋은것 같습니다.

문제는 두께도 상당하네요. 

WRITTEN BY
RootFriend
개인적으로... 나쁜 기억력에 도움되라고 만들게되었습니다.

,