04:52imirkin: skeggsb: did you end up trying higher res on the quadro 600?
05:01skeggsb: imirkin: no, but i'll have it plugged in again later today
05:19imirkin: tagr: random guess for the 406040 issue - https://hastebin.com/uhuwojebat.swift
05:20imirkin: [probably has to be restricted on nv50+]
13:59karolherbst: imirkin: can we somehow make the buffer locations non deterministic?
14:00RSpliet: karolherbst: without knowledge of the matter, virtual or physical addresses?
14:01karolherbst: so that if I run two applications, that the second one doesn't get the same data when reading out the buffer
14:01karolherbst: the data from the first application that is
14:03RSpliet: karolherbst: if I understand correctly, per-"hw context" page tables should let you avoid just this. The physical memory of app 1 should not be mapped in the virtual address range of app 2, hence it can't access that data
14:03karolherbst: it isn't about running applications at the same time
14:03karolherbst: but after each other
14:04karolherbst: thing is, I get the same virtual address each run, and apperantly even the same physical one
14:04RSpliet: yeah, you're interested in higher randomisation of physical memory allocation from the sound of it. I think mupuf talked about this years ago
14:05karolherbst: well, it seems like we have no randomisation at all
14:06RSpliet: Well... nothing deliberate at least. "Chaos theory" applies to allocations too though, if other apps jump in the middle and start chipping off small sections of that frame buffer, then obviously app 2 will not get the whole buffer. There's insufficient chaos to hide this though :-D
14:07RSpliet: I suspect this would require changes to the kernel allocator, which is a fairly simple allocator iirc. Nothing impossible. Randomisation could lead to fragmentation though, esp. if we need to worry about contiguous allocation (which sometimes we do... like for big pages etc.)
14:09karolherbst: RSpliet: randomisation doesn't really lead to higher fragmentation when done correctly
14:10karolherbst: you have to keep alignment in mind anyway
14:10karolherbst: and sure, the real problem is, that usually for graphics we never clean the VRAM anyway
14:10karolherbst: so randomisation would be just a dirty hack to not deal with the perf penalty
14:11karolherbst: we have to clear the VRAM anyway
14:11karolherbst: we are just good in ignoring this issue
14:11karolherbst: or at least we should clear out CL buffers
14:11RSpliet: fragmentation is a concern that should be addressed in your proposal for higher randomisation ;-). I always keep repeating to my students "just that you know there are solutions doesn't mean it's not a problem!", so sorry if I sound a bit teacher-preacher :-P
14:14RSpliet: You could perhaps short-cut it a little bit and omit clearing buffers free'd and re-allocated by the same context. Perhaps some user-space buffer caching kind of thing like I think glibc's malloc does to mitigate overhead of frequent free's and mallocs().... but we may or may not be walking into GEM territory now (I don't know the hierarchy well enough)
14:14karolherbst: we have to clear at free time
14:14karolherbst: we can't omit any free
14:15karolherbst: it works well as long as you expect an application to exit in a sane way
14:15karolherbst: but thing about hard resets and vram not being cleared
14:15karolherbst: when do you clear the VRAM?
14:16RSpliet: We can debate about that (I recall a perf impact of like 10% if buffers are cleared on free), but a free in a user application does not necessarily have to lead to a free in the kernel. You could keep some of it it lingering around in a pool of re-allocatable memory until the kernel signals VRAM shortage.
14:18karolherbst: RSpliet: well we can free it asnyc
14:18karolherbst: we just make the memory unavailable until it was cleared
14:18karolherbst: and we have a kworker doing that for uns
14:18karolherbst: or something
14:19RSpliet: It still eats away from DRAM bandwidth as DRAM channels have a serialising effect.
14:19karolherbst: no idea if we have nice GPU commands to do big clears in one command/step or something
14:20RSpliet: There's a flag used for fast-clears. Think that's only useful to defer, not to do it ahead of time. as soon as the buffer is written you'll end up emitting those clears to DRAM anyway.
14:49Masterboy: imirkin: i tested all the clips on http://www.h264info.com/clips.html with no problem - the simpsons trailer was fine only the 2k video was lagging because it is 2k. nv84 nouveau+hw decode + mpv from mpv ppa working fine.
14:50imirkin_: if the 720p one worked fine, you must not be using hw decode via vdpau.
14:50Masterboy: imirkin_: the problem you had got from the clips was solved somewhere it seems.
14:51Masterboy: imirkin_: did you try loading the video with mpv? with mpv it was fine.
14:51Masterboy: nv84 decoded it fine o ubuntu 16.04 lts
14:52Masterboy: mhm mhm... i don't think mpv has a fallback mechanism...
14:53Masterboy: to software decode
14:54imirkin_: so it's not the whoel clip that's messed up
14:54imirkin_: but just parts of it
14:54Masterboy: oh, i see, i just saw that it loads and plays, i did not watch it all...
14:54imirkin_: like when the dog sleigh is jumping over the gorge
14:55imirkin_: and some other panning scenes
14:55Masterboy: shoot, ok, i have to test again...
18:33mupuf: karolherbst: you mean sanitizing the VRAM pages
18:34karolherbst: mupuf: so that they contain random data after free, yes
18:34karolherbst: or 0 or whatever
18:34mupuf: 0, yes
18:34karolherbst: mupuf: is there some GPU command we could use for that?
18:36karolherbst: yeah, but I meant more like a fill command or something
18:36karolherbst: it isn't really a copy of data
18:36karolherbst: but I guess pcopy may be able to overwrite a chunk of memory with the same value?
18:37karolherbst: mupuf: "On the other hand, if we want all buffers to be wiped at allocation time," no, we don't want that :p
18:37mupuf: karolherbst: I was thinking of keeping a zeroed-out memory page
18:37mupuf: and repeat that
18:37karolherbst: I kind of wish there is a simplier thing
18:38mupuf: you wish there would be a memset command
18:38mupuf: maybe pcopy has one
18:38karolherbst: how is that done on normal x86 memory for example?
18:38mupuf: copy-on write
18:38karolherbst: I meant on boot time or whatever
18:38mupuf: the memory is not reset, AFAIR
18:39karolherbst: but I guess the hw kind of protects against access?
18:39karolherbst: so it is all inside the kernel
18:39karolherbst: I mean, I always have that most insane attack in mind: force reboot into customly crafted kernel
18:40karolherbst: and you kind of want to be protected against even that scenario
18:40mupuf: malloc does not zero out the allocated memory, only calloc does. However, not sure what happens when a page is migrated from one process to another
18:40mupuf: kernels can do whatever they want
18:40mupuf: but userspace, that's what you want to protect
18:41karolherbst: well, you still have that scenario of booting into a different OS with a different kernel
18:41karolherbst: I just don't know how important it is to be protected against that as well
18:41opal: well you "want to protect" the kernel too but in a different fashion
18:42mupuf: karolherbst: honeslty, the only issue I see is the attack I mentioned in the presentation
18:42mupuf: allocating a lot of memory, then reading it
18:42opal: secure boot + efi stub + full-disk encryption is probably the best current way to protect a system from head to toe, software wise
18:42mupuf: there was "an attack" published for that
18:42karolherbst: I mean, what happens if for example boot linux, do all my important stuff there, email encryption stuff, whatever, then boot into a different OS, because I am smart not to trust that one with my important data, and it may be just possible to extract stuff from there due to kernel bugs inside windows or whatever
18:43karolherbst: mupuf: yeah
18:43mupuf: opal: it does not prevent this. Only encrypting memory could
18:43opal: i've looked into encrypting memory lol, would be interesting but unfeasible
18:43karolherbst: opal: secure boot only protects against unauthoritative kernels
18:43mupuf: karolherbst: yes, see my answer to opal
18:43karolherbst: opal: not against kernel modifications
18:44karolherbst: if you are authorized to create a kernel passing secure boot, you can just do that for other machines as well, because they usually share the same public key ;)
18:44mupuf: just make sure each kernel has the encryption key in its binary
18:44karolherbst: you just drastically limit the group of people able to modify your kernel
18:44opal: i wasnt keeping up honestly, was this the original question: 13:59.36 < karolherbst:#nouveau> imirkin: can we somehow make the buffer locations non deterministic?
18:45opal: also yes that's true
18:45mupuf: opal: that part is odd. Non-deterministic is not what karolherbst wants. He wants to sanitize memory pages before handing them out to applications
18:46mupuf: so as no confidential information could leak from one process to another
18:46opal: i believe grsecurity has offered this?
18:46karolherbst: not leaking information is my main concern overall
18:46mupuf: then he started musing about kernels, but this is impossible to fix without HW encryption
18:46opal: shame grsecurity is unavailable to the public now
18:46karolherbst: but... my main issue was, that when fixing up data, tests start to pass allthough they didn't before :p
18:46mupuf: (of the memory)
18:47karolherbst: opal: or not... depends on how you look at it
18:47mupuf: karolherbst: hmm, fixing data?
18:47karolherbst: mupuf: well, run some other test to verify something and you accidentally put the value into memory the test expects
18:47karolherbst: and suddenly it passes ;)
18:47mupuf: oh, of course!
18:47mupuf: yeah, it is always a risk
18:47opal: karolherbst: or not what? not a shame? ...that's only if you get into politics
18:47opal: politics shouldnt be a factor in security and sadly it has been made a factor
18:47mupuf: well, you can do something about this already in mesa
18:48karolherbst: mupuf: yeah, hence why getting random buffer addresses
18:48karolherbst: or something
18:48mupuf: karolherbst: that only limits the risk
18:48karolherbst: good enough
18:48mupuf: so you think :D
18:49karolherbst: opal: well, it is questionable if grsecurity is effective. I don't think there were trustworthy studies for that
18:49mupuf: and what you propose is basically to only reuse a memory page when no zeroed-out ones are available
18:49mupuf: you'll run out of them before piglit is done executing :p
18:49karolherbst: opal: and maybe you just feel safer using grsecurity because it has security in its name or something and care less about other issues...
18:49karolherbst: the entire security business sounds like a lot of placebo and snake oil to me in general
18:50karolherbst: spending more on marketing than on developing software and so on...
18:50opal: well a primary aim for grsec was preventative security, stopping bugs borne from code before they had a chance to cause issues
18:50karolherbst: right, but does it work?
18:50karolherbst: does it lead to systems running more secure or less?
18:51karolherbst: maybe you fix bugs later, because gsecurity protects you?
18:51opal: you tell me, does ASLR work? do stack canaries work? does zeroing memory work?
18:51karolherbst: or don't detect bugs at all?
18:51opal: when a bug is encountered the system will most likely crash rather than be exploited
18:51opal: grsec's useful if you value security over uptime
18:51karolherbst: yeah, which is good
18:51karolherbst: it isn't like that linux has nothing and gsecurity has everything
18:51RSpliet: funny enough, I wouldn't be surprised if ASLR reveals bugs rather than prevents due to more random behaviour :-D
18:51opal: if you value protecting assets over serving users
18:52opal: linux has some stuff
18:52opal: but linus himself has admitted that security is not a primary focus for linux
18:52karolherbst: opal: who is saying that gsecurityies things on top of linux are really helping?
18:52opal: security bugs are just like any other bug
18:52karolherbst: opal: that's a bit short sighted, his point was a different one
18:52karolherbst: opal: and they are
18:53karolherbst: for many reasons
18:53karolherbst: you just don't know if you can exploit a bug security wise or not
18:53opal: no i know his point, it was that security "experts" hunt bugs down and make huge publicity deals out of them
18:53karolherbst: you can't say for any random bug to 100% confidence: nope, not relevant to security
18:53karolherbst: so you should get all bug fixes, not just "security" ones
18:54karolherbst: opal: ohh yeah, that as well...
18:54karolherbst: I mean, sure some bugs are super big and lead to a lot of security issues, and thats good to inform people
18:54opal: yeah linus hates the security bloggers lol
18:55opal: yeah security isn't black and white, i'm sure of that
18:55opal: you have to address your personal risk model
18:55opal: while grsec may not be useful to you personally, some find value from preemptive protection, and yes, others probably see "security" in the name lol
18:56karolherbst: opal: well, that's not what I mean
18:56karolherbst: I am just questioning if gsecuritys additional things really help
18:56karolherbst: maybe they do, maybe they don't
18:56karolherbst: linux also has quite a lot of features to find bugs faster and so on
18:58opal: well i alluded to this earlier: this isn't directly related to grsec but to code in general, would you compile a critical program with PIC, ASLR, SECCOMP/pledge(), and whatever else is available if given the opportunity?
18:58opal: some programmers decide to take this route
18:58opal: tor comes to mind, it's known for high focus on privacy and security
18:58opal: web browsers too
18:59opal: web browsers are untrusted code sandboxes at this poihnt
18:59RSpliet: karolherbst: IMHO, the higher level point is that grsec doesn't quite play the open source game neatly. That's part of their business model. But I would simply claim that the lack of independent scrutineering on grsec patches make their code a higher risk rather than lower.
18:59karolherbst: but we do with any random linux distribution already so far
18:59karolherbst: RSpliet: right
18:59karolherbst: exactly one of the bigger issues with grsec
18:59opal: personally i'd dig a microkernel model but none of the microkernels in development are getting too far
19:00opal: RSpliet: that could definitely be true, and now we don't know for current patches since the code is paywalled
19:00opal: which is a shitty decision but oh well
19:00karolherbst: well, one can buy it and share it...
19:00RSpliet: opal: just microkernel, or capability-based kernel?
19:00opal: yeah and lose the licence lol
19:00opal: and then it would be paywalled again
19:00karolherbst: opal: well
19:01opal: RSpliet: give me a second; i never really made a distinction
19:01karolherbst: opal: you don't have to do it personally
19:01RSpliet: opal: sounds like a violation of the GPL license of the Linux kernel...
19:01karolherbst: RSpliet: it isn't
19:01opal: RSpliet: yeah it isnt lol the gpl allows it
19:01karolherbst: because you can still share what you got
19:01karolherbst: you just don't get updates or newer versions
19:01opal: grsecurity says you can share the code, but you just wont get updates if you do
19:01karolherbst: I am sure they can just stop doing business with you
19:01karolherbst: you could also just post it via tor or something
19:02karolherbst: pastebin it
19:02opal: but you havent considered that spender could simply run his patchset through a script to search-and-replace variables or function names
19:02opal: which is entirely possible now since we don't know what's being done with the code
19:02RSpliet: watermarking you mean? yep...
19:03RSpliet: Yet another reason why I personally wouldn't want to trade with the grsec guys ;-)
19:03karolherbst: opal: get access twice
19:03opal: to counter that you could just run the patch through a "beautifier" and try reversing any fingerprinting techniques
19:03karolherbst: opal: compare
19:03opal: yeah that would be a good metric if it didn't cost so much lol
19:04karolherbst: opal: did you click the Papers link on theyr website?
19:04RSpliet: Anyway, not interested. I bet a lot of the grsec patches are practical implementations of academic ideas. Much more productive to try and properly upstream these ideas the Linux way rather than trying to upstream the grsec-shoehorned-it-compiles-ship-it patches...
19:04opal: i think i read through a couple, cant remember
19:05karolherbst: opal: well, ;)
19:05karolherbst: those aren't papers
19:05karolherbst: just some slides to some presentations
19:05RSpliet: I'm exaggerating obviously, but people attempting to port grsec patches upstream naively always run into a wall of gatekeepers who raise serious issues with the quality of the code
19:06opal: main complaint seems to be that the patch isnt segmented into smaller patches. i'm sure they have other nitpicks
19:06karolherbst: RSpliet: I am not surprised
19:06karolherbst: opal: well coorperate software development usually is shit
19:07karolherbst: I mean the process
19:07RSpliet: opal: valid complaint, because it prevents stage two of code review (more in-depth ;-))
19:07opal: i believe spender's counterreasoning was "the grsec features are designed to work together"
19:07opal: so he was just stubborn on that front
19:08karolherbst: well, that's part of the spending more money on marketing than development thing I talked about, no?
19:08opal: so looking at capability-based kernels it seems like this isn't exclusive from microkernels; you can have both
19:08karolherbst: rather writing bs PR answers than thinking about how to do it correctly
19:09opal: i'm interested in microkernels for, yes, it does have the opportunity to provide security by sandboxing, but it also gives way to more modular, interchangable code and possibly better standardised API/IPC
19:10karolherbst: opal: well, practically at some point you always run into perf issues usually
19:10karolherbst: that's one of the main reasons why even with modern micro kernels, you usually fall back to a hybrid form and still have some drivers in kernel sapce
19:10karolherbst: usually graphics
19:11opal: context switching is indeed an issue even with monokernels
19:11karolherbst: or networking
19:11karolherbst: opal: well, it is more than that
19:11karolherbst: if you do IPC, you get a round trip through the kernel
19:11opal: im sure but it's one issue
19:11karolherbst: and then your driver process gets tons of new syscalls
19:12karolherbst: I mean, the issue isn't context switching really, it's just that you need to do quite a lot more
19:12opal: https://www.kernel.org/doc/ols/2007/ols2007v1-pages-251-262.pdf found this
19:14opal: oh related question to nouveau: has support improved a lot since 4.9.7x? i'm using 4.14.8 now
19:14imirkin_: depends on your hw
19:14opal: had vsync issues before and im not noticing them now but maybe it's because i haven't done anything too intensive since then
19:14opal: card im using isNVIDIA GeForce GT 730
19:15imirkin_: you should now be able to reclock reliably
19:15imirkin_: iirc it was still a bit flaky in 4.9
19:15opal: bought this desktop before knowing anything about linux gpu support lol
19:15imirkin_: yeah, just use the onboard gpu if possible
19:16opal: isn't possible for me since i do use linux for some gaming, mainly under emulator
19:16imirkin_: on a gt 730?
19:16opal: works well enough for me
19:16imirkin_: gt730 should be about as powerful as a skylake gpu...
19:16imirkin_: maybe a tad more
19:17imirkin_: i guess depends on if you have ddr3 or gddr5 vram
19:17opal: i just know i used onboard on my laptop for pcsx2 and performance suffered from graphics. might be a different story with my desktop cpu but i havent bothered to try
19:17opal: i already set this up and got it working so i dont really want to break it lol
19:19imirkin_: using blob?
19:19opal: just nouveau, no nvidia blob
19:20opal: i might give onboard a try if i experience vsync issues again
19:21opal: then i can use the card with qemu + passthrough if i need to
19:21opal: i'll see how it goes
19:23imirkin_: you might also give reclocking a try if you want maor fps
19:23opal: alright i'll look into that if i need to, thanks
19:24imirkin_: should probably be about 2x fps on your board? dunno
21:14imirkin_: pendingchaos: brian landed the conservative rast series :)
21:16pendingchaos: you might want to update the card on the trello, now that the GM20x-GP10x extensions are implemented
21:16imirkin_: can i just add you to the trello board?
21:16imirkin_: do you have a trello username?
21:17pendingchaos: I'm creating an account now
21:18imirkin_: i've sent you an invite to the board.
21:18pendingchaos: trello allows you to invite people before they've created an account?
21:18imirkin_: (i've also archived that card)