04:32 ilios: Hi. I heard that GPU instruction cache can be flushed by specific MMIO. But i couldn't find that in any nouveau documents. Where can i get the information about such specific MMIO address? My GPU is NVIDIA GTX480.
04:42 karolherbst: ilios: check rnndb
04:45 ilios: Thx for suggestion
04:56 ilios: i found suspicious code from envytools/envydis/gf100.c. N("ivall") within struct insn tabcctlop. Does anyone know about this code piece? How is it related with flushing inst cache?
04:56 ilios: What i want to do is just flushing instruction cache using MMIO.
04:57 pmoreau: ilios: Have a look at rnndb, as Karol suggested
04:58 pmoreau: rnndb is the database containing all RE'ed MMIO regs + some more stuff
04:58 ilios: Could you give me a tip for looking at rnndb? Actually i tried that at before. grep any cache flush-related code in rnndb folder. but i couldn't grab any information..
05:01 pmoreau: grep -rnI FLUSH returns a couple of results, just need to check which one might be related to instruction cache
05:03 ilios: Oh thank you! Let me try them.
05:03 pmoreau: docs/hw might contain some information as well
05:07 RSpliet: ilios: I'd be surprised if you find stuff about flushing your icache in "envydis", given how I don't think you want the compute cores to do that
05:07 RSpliet: gnurou: or were there intentions of self-modifying code? :-D
05:10 mwk: ilios: you won't find anything in envydis, the ivall stuff is only for flushing global space
05:10 mwk: and maybe surfaces
05:10 ilios: My intention is little bit complex to explain (because of my poor english skill),but it is for the security reason. I'm working on research related to security of GPU. And i want to do something like "flush instruction cache and fetch everything newly" at right time.
05:11 mwk: there are two ways to trigger a flush
05:11 mwk: one is by using the command stream, the same one that was used to launch the compute kernel in the first place
05:11 mwk: but that only works for flushing the cache in between kernels
05:11 mwk: the second is, indeed, MMIO
05:12 mwk: which is used eg. for cuda-gdb
05:12 ilios: First option is not appropriate for me
05:12 ilios: Yes, second one is really what i want.
05:12 mwk: and for that, you need to poke some triggers in PGRAPH's register range
05:13 mwk: I'm not certain if I've found all of them
05:13 ilios: Ah! Thankyou so much. If i'm using GTX480, rnndb/graph/gf100_pgraph is right place to search?
05:13 mwk: yes
05:13 ilios: Thank you!
05:13 mwk: look for flush triggers
05:14 mwk: there are a few, you'll likely need to poke all of them to flush all levels of all caches
05:16 ilios: Ah i see. another quick question. Do you know how harsh(?) is the flushing cache operation in terms of latency?
05:16 ilios: i need to flush all levels of instruction cache.
05:19 ilios: or Is there any way to know the exact time when the flushing operation finished?
05:22 RSpliet: ilios: I'd expect the cost of a flush to be relatively low for icache (no writeback ops required), but refilling to take a lot of time
05:24 ilios: I see. Is there any document about internal refilling process in GPUs? i mean there must be some kind of prefetching mechanism, but i'm curious how large the size of instructions prefetched at one time.
05:29 pmoreau: I guess GPU manufacturers aren't really talkative about that kind of information? Try to search in the documentation released by Intel or AMD, or search for some papers that RE'ed that process.
05:32 ilios: Ah okay, i think so. Thank you!
05:43 ilios: mwk, can i get more information about first option?(trigger a flush using the command stream). What is the purpose of that mmio? is it only flush the cache or including the initiation of uploaded kernel, or even including the uploading process?
05:44 ilios: Anyway, I want to test that MMIO too. where is the right place to find?