€•WUŒsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ%/translations/zh_CN/arch/powerpc/dscr”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ%/translations/zh_TW/arch/powerpc/dscr”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ%/translations/it_IT/arch/powerpc/dscr”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ%/translations/ja_JP/arch/powerpc/dscr”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ%/translations/ko_KR/arch/powerpc/dscr”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ%/translations/sp_SP/arch/powerpc/dscr”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒ#DSCR (Data Stream Control Register)”h]”hŒ#DSCR (Data Stream Control Register)”…””}”(hh¨hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hh£hžhhŸŒ?/var/lib/git/docbuild/linux/Documentation/arch/powerpc/dscr.rst”h KubhŒ paragraph”“”)”}”(hXDSCR register in powerpc allows user to have some control of prefetch of data stream in the processor. Please refer to the ISA documents or related manual for more detailed information regarding how to use this DSCR to attain this control of the prefetches . This document here provides an overview of kernel support for DSCR, related kernel objects, its functionalities and exported user interface.”h]”hXDSCR register in powerpc allows user to have some control of prefetch of data stream in the processor. Please refer to the ISA documents or related manual for more detailed information regarding how to use this DSCR to attain this control of the prefetches . This document here provides an overview of kernel support for DSCR, related kernel objects, its functionalities and exported user interface.”…””}”(hh¹hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Khh£hžhubhŒenumerated_list”“”)”}”(hhh]”(hŒ list_item”“”)”}”(hX?Data Structures: (1) thread_struct:: dscr /* Thread DSCR value */ dscr_inherit /* Thread has changed default DSCR */ (2) PACA:: dscr_default /* per-CPU DSCR default value */ (3) sysfs.c:: dscr_default /* System DSCR default value */ ”h]”(h¸)”}”(hŒData Structures:”h]”hŒData Structures:”…””}”(hhÒhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K hhÎubhŒ block_quote”“”)”}”(hX(1) thread_struct:: dscr /* Thread DSCR value */ dscr_inherit /* Thread has changed default DSCR */ (2) PACA:: dscr_default /* per-CPU DSCR default value */ (3) sysfs.c:: dscr_default /* System DSCR default value */ ”h]”hÈ)”}”(hhh]”(hÍ)”}”(hŒwthread_struct:: dscr /* Thread DSCR value */ dscr_inherit /* Thread has changed default DSCR */ ”h]”(h¸)”}”(hŒthread_struct::”h]”hŒthread_struct:”…””}”(hhíhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h KhhéubhŒ literal_block”“”)”}”(hŒ]dscr /* Thread DSCR value */ dscr_inherit /* Thread has changed default DSCR */”h]”hŒ]dscr /* Thread DSCR value */ dscr_inherit /* Thread has changed default DSCR */”…””}”hhýsbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1hûhŸh¶h Khhéubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÌhhæubhÍ)”}”(hŒ=PACA:: dscr_default /* per-CPU DSCR default value */ ”h]”(h¸)”}”(hŒPACA::”h]”hŒPACA:”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Khjubhü)”}”(hŒ0dscr_default /* per-CPU DSCR default value */”h]”hŒ0dscr_default /* per-CPU DSCR default value */”…””}”hj%sbah}”(h]”h ]”h"]”h$]”h&]”j j uh1hûhŸh¶h Khjubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÌhhæubhÍ)”}”(hŒ?sysfs.c:: dscr_default /* System DSCR default value */ ”h]”(h¸)”}”(hŒ sysfs.c::”h]”hŒsysfs.c:”…””}”(hj=hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Khj9ubhü)”}”(hŒ/dscr_default /* System DSCR default value */”h]”hŒ/dscr_default /* System DSCR default value */”…””}”hjKsbah}”(h]”h ]”h"]”h$]”h&]”j j uh1hûhŸh¶h Khj9ubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÌhhæubeh}”(h]”h ]”h"]”h$]”h&]”Œenumtype”Œarabic”Œprefix”Œ(”Œsuffix”Œ)”uh1hÇhhâubah}”(h]”h ]”h"]”h$]”h&]”uh1hàhŸh¶h KhhÎubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÌhhÉhžhhŸh¶h NubhÍ)”}”(hXScheduler Changes: Scheduler will write the per-CPU DSCR default which is stored in the CPU's PACA value into the register if the thread has dscr_inherit value cleared which means that it has not changed the default DSCR till now. If the dscr_inherit value is set which means that it has changed the default DSCR value, scheduler will write the changed value which will now be contained in thread struct's dscr into the register instead of the per-CPU default PACA based DSCR value. NOTE: Please note here that the system wide global DSCR value never gets used directly in the scheduler process context switch at all. ”h]”(h¸)”}”(hŒScheduler Changes:”h]”hŒScheduler Changes:”…””}”(hj{hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Khjwubhá)”}”(hXXScheduler will write the per-CPU DSCR default which is stored in the CPU's PACA value into the register if the thread has dscr_inherit value cleared which means that it has not changed the default DSCR till now. If the dscr_inherit value is set which means that it has changed the default DSCR value, scheduler will write the changed value which will now be contained in thread struct's dscr into the register instead of the per-CPU default PACA based DSCR value. NOTE: Please note here that the system wide global DSCR value never gets used directly in the scheduler process context switch at all. ”h]”(h¸)”}”(hXÏScheduler will write the per-CPU DSCR default which is stored in the CPU's PACA value into the register if the thread has dscr_inherit value cleared which means that it has not changed the default DSCR till now. If the dscr_inherit value is set which means that it has changed the default DSCR value, scheduler will write the changed value which will now be contained in thread struct's dscr into the register instead of the per-CPU default PACA based DSCR value.”h]”hXÓScheduler will write the per-CPU DSCR default which is stored in the CPU’s PACA value into the register if the thread has dscr_inherit value cleared which means that it has not changed the default DSCR till now. If the dscr_inherit value is set which means that it has changed the default DSCR value, scheduler will write the changed value which will now be contained in thread struct’s dscr into the register instead of the per-CPU default PACA based DSCR value.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Khj‰ubh¸)”}”(hŒ†NOTE: Please note here that the system wide global DSCR value never gets used directly in the scheduler process context switch at all.”h]”hŒ†NOTE: Please note here that the system wide global DSCR value never gets used directly in the scheduler process context switch at all.”…””}”(hj›hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K%hj‰ubeh}”(h]”h ]”h"]”h$]”h&]”uh1hàhŸh¶h Khjwubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÌhhÉhžhhŸh¶h NubhÍ)”}”(hXÑSYSFS Interface: - Global DSCR default: /sys/devices/system/cpu/dscr_default - CPU specific DSCR default: /sys/devices/system/cpu/cpuN/dscr Changing the global DSCR default in the sysfs will change all the CPU specific DSCR defaults immediately in their PACA structures. Again if the current process has the dscr_inherit clear, it also writes the new value into every CPU's DSCR register right away and updates the current thread's DSCR value as well. Changing the CPU specific DSCR default value in the sysfs does exactly the same thing as above but unlike the global one above, it just changes stuff for that particular CPU instead for all the CPUs on the system. ”h]”(h¸)”}”(hŒSYSFS Interface:”h]”hŒSYSFS Interface:”…””}”(hj¹hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K(hjµubhá)”}”(hX—- Global DSCR default: /sys/devices/system/cpu/dscr_default - CPU specific DSCR default: /sys/devices/system/cpu/cpuN/dscr Changing the global DSCR default in the sysfs will change all the CPU specific DSCR defaults immediately in their PACA structures. Again if the current process has the dscr_inherit clear, it also writes the new value into every CPU's DSCR register right away and updates the current thread's DSCR value as well. Changing the CPU specific DSCR default value in the sysfs does exactly the same thing as above but unlike the global one above, it just changes stuff for that particular CPU instead for all the CPUs on the system. ”h]”(hŒ bullet_list”“”)”}”(hhh]”(hÍ)”}”(hŒBGlobal DSCR default: /sys/devices/system/cpu/dscr_default”h]”h¸)”}”(hjÒh]”hŒBGlobal DSCR default: /sys/devices/system/cpu/dscr_default”…””}”(hjÔhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K*hjÐubah}”(h]”h ]”h"]”h$]”h&]”uh1hÌhjÍubhÍ)”}”(hŒ@CPU specific DSCR default: /sys/devices/system/cpu/cpuN/dscr ”h]”h¸)”}”(hŒ?CPU specific DSCR default: /sys/devices/system/cpu/cpuN/dscr”h]”hŒ?CPU specific DSCR default: /sys/devices/system/cpu/cpuN/dscr”…””}”(hjëhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K+hjçubah}”(h]”h ]”h"]”h$]”h&]”uh1hÌhjÍubeh}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ-”uh1jËhŸh¶h K*hjÇubh¸)”}”(hX7Changing the global DSCR default in the sysfs will change all the CPU specific DSCR defaults immediately in their PACA structures. Again if the current process has the dscr_inherit clear, it also writes the new value into every CPU's DSCR register right away and updates the current thread's DSCR value as well.”h]”hX;Changing the global DSCR default in the sysfs will change all the CPU specific DSCR defaults immediately in their PACA structures. Again if the current process has the dscr_inherit clear, it also writes the new value into every CPU’s DSCR register right away and updates the current thread’s DSCR value as well.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K-hjÇubh¸)”}”(hŒÕChanging the CPU specific DSCR default value in the sysfs does exactly the same thing as above but unlike the global one above, it just changes stuff for that particular CPU instead for all the CPUs on the system.”h]”hŒÕChanging the CPU specific DSCR default value in the sysfs does exactly the same thing as above but unlike the global one above, it just changes stuff for that particular CPU instead for all the CPUs on the system.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K3hjÇubeh}”(h]”h ]”h"]”h$]”h&]”uh1hàhŸh¶h K*hjµubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÌhhÉhžhhŸh¶h NubhÍ)”}”(hX›User Space Instructions: The DSCR register can be accessed in the user space using any of these two SPR numbers available for that purpose. (1) Problem state SPR: 0x03 (Un-privileged, POWER8 only) (2) Privileged state SPR: 0x11 (Privileged) Accessing DSCR through privileged SPR number (0x11) from user space works, as it is emulated following an illegal instruction exception inside the kernel. Both mfspr and mtspr instructions are emulated. Accessing DSCR through user level SPR (0x03) from user space will first create a facility unavailable exception. Inside this exception handler all mfspr instruction based read attempts will get emulated and returned where as the first mtspr instruction based write attempts will enable the DSCR facility for the next time around (both for read and write) by setting DSCR facility in the FSCR register. ”h]”(h¸)”}”(hŒUser Space Instructions:”h]”hŒUser Space Instructions:”…””}”(hj3hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K7hj/ubhá)”}”(hXMThe DSCR register can be accessed in the user space using any of these two SPR numbers available for that purpose. (1) Problem state SPR: 0x03 (Un-privileged, POWER8 only) (2) Privileged state SPR: 0x11 (Privileged) Accessing DSCR through privileged SPR number (0x11) from user space works, as it is emulated following an illegal instruction exception inside the kernel. Both mfspr and mtspr instructions are emulated. Accessing DSCR through user level SPR (0x03) from user space will first create a facility unavailable exception. Inside this exception handler all mfspr instruction based read attempts will get emulated and returned where as the first mtspr instruction based write attempts will enable the DSCR facility for the next time around (both for read and write) by setting DSCR facility in the FSCR register. ”h]”(h¸)”}”(hŒrThe DSCR register can be accessed in the user space using any of these two SPR numbers available for that purpose.”h]”hŒrThe DSCR register can be accessed in the user space using any of these two SPR numbers available for that purpose.”…””}”(hjEhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K9hjAubhÈ)”}”(hhh]”(hÍ)”}”(hŒ@Problem state SPR: 0x03 (Un-privileged, POWER8 only)”h]”h¸)”}”(hjXh]”hŒ@Problem state SPR: 0x03 (Un-privileged, POWER8 only)”…””}”(hjZhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K