#
#asahi-dev · 2023-03-14 12:24
marcanmaybe the old driver would've gotten more actually
#asahi-dev · 2023-03-14 12:24
marcanyeah, oh well
#asahi-dev · 2023-03-14 12:24
svenstill a pity that you didn't get much performance improvements
#asahi-dev · 2023-03-14 12:23
amarioguystill not the best at MSR bit twiddling :D
#asahi-dev · 2023-03-14 12:23
marcannow it's faster and has fewer bugs and nonsense
#asahi-dev · 2023-03-14 12:23
marcanI literally took the mailbox driver, ripped out the parts that talk to the subsystem, and just made rtkit call into it directly
#asahi-dev · 2023-03-14 12:23
amarioguymarcan: ah thanks for checking
#asahi-dev · 2023-03-14 12:23
marcanand it doesn't *do* anything for us, there is no useful common functionality whatsoever
#asahi-dev · 2023-03-14 12:22
marcanmaz: re mailbox, it's just bad. atomic mode bugs, a fixed-size queue that errors out if full instead of blocking, missing a way to set up the mailbox and *then* enable reception once everything is set up, etc.
#asahi-dev · 2023-03-14 12:20
marcanalso s3_1_c15_c11_0 is some kind of global enable, if that is 0 the PMCs don't count (but it's 0xfffff by default)
#asahi-dev · 2023-03-14 12:20
marcanconfirmed, that seems to be all you need to get them to count in EL1
#asahi-dev · 2023-03-14 12:17
marcanamarioguy: the PMCs definitely count for me in EL1 with those bits set, and possibly others (checking)
#asahi-dev · 2023-03-14 12:09
amarioguyjust double checked
#asahi-dev · 2023-03-14 12:09
amarioguywait my tests were with bit 27 = 0
#asahi-dev · 2023-03-14 12:06
amarioguygotta redo some test then
#asahi-dev · 2023-03-14 12:06
amarioguyahhhh crap
#asahi-dev · 2023-03-14 12:05
marcanthere's probably a whole set of parallel impdef PMC registers for {E2H,TGE}={1,0}, as there is for most apple impdef stuff
#asahi-dev · 2023-03-14 12:05
marcanamarioguy: hint: s3_1_c15_c7_2 has the same layout as PMCR1_EL1, it's probably PMCR1_EL12 (and then s3_1_c15_c6_2 is probably PMCR1_EL2)
#asahi-dev · 2023-03-14 12:00
amarioguy(test results are serious - that is the behavior i see, and the same is true of the Uncore PMCs too)
#asahi-dev · 2023-03-14 11:59
amarioguy(sorta joking but you know would be nice)
#asahi-dev · 2023-03-14 11:59
amarioguymarcan: quick feature request, can we please get an "bit set/bit clear" msr command in m1n1, would make bit twiddling much easier :P
#asahi-dev · 2023-03-14 11:58
amarioguyESR_EL1 = 0x6239fc11
#asahi-dev · 2023-03-14 11:58
amarioguymaz: good news, when HCR_EL2.TIDCP = 1, all the impdef PMU regs i tested reads/writes from EL1 with, trap to EL2
#asahi-dev · 2023-03-14 11:51
maz(and I mean when accessed from EL1, of course)
#asahi-dev · 2023-03-14 11:50
mazthey should trap irrespective of the IMPDEF bits if HCR_EL2.TIDCP is set.
#asahi-dev · 2023-03-14 11:50
amarioguytesting that now
#asahi-dev · 2023-03-14 11:50
mazyup
#asahi-dev · 2023-03-14 11:50
amarioguythe impdef pmus?
#asahi-dev · 2023-03-14 11:50
mazif they don't, we have a bigger p[roblem...
#asahi-dev · 2023-03-14 11:49
mazthey still honour HCR_EL2.TIDCP, right?
#asahi-dev · 2023-03-14 11:49
amarioguythink you mentioned wanting to know the effects of this on that?
#asahi-dev · 2023-03-14 11:49
amarioguymaz: that was mainly to clarify that this bit does not affect read/write of the impdef stuff since that's controlled by separate bits
#asahi-dev · 2023-03-14 11:48
mazamarioguy: in your description, you're saying "Apple specific PMU control reg writes still permitted when bit 56 is set (because the apple specific controls for PMCs/Uncore PMCs are independently trapped by bits 57-58)"
#asahi-dev · 2023-03-14 11:44
mazmarcan: out of morbid curiosity, what was the issue with mailbox?
#asahi-dev · 2023-03-14 11:38
mazamarioguy: OK, so they don't pretend to have PMUv3p4. I guess that leaves us with PMUv3p1 at best.
#asahi-dev · 2023-03-14 11:36
amarioguymaz: not trapped as in it's undefined
#asahi-dev · 2023-03-14 11:35
mazalso, when you say that PMMIR_EL1 is not trapped: does it mean it undefs at EL1? or is always readable from EL1?
#asahi-dev · 2023-03-14 11:34
mazamarioguy: I'd hope so. the alternative is to snapshot the cycle counter on each entry/exit of the guest, and only expose that.
#asahi-dev · 2023-03-14 11:34
marcannot as much of a perf improvement as I'd hoped, but the diffstat is ~-50 lines of code vs upstream and might have fixed the reboot issues and obsoletes a pile of downstream mailbox patches we had trouble upstreaming that fixed various broken stuff
#asahi-dev · 2023-03-14 11:33
amarioguymaz: got it, there should be smth that allows that given apple's official virt solution needs that to work
#asahi-dev · 2023-03-14 11:32
marcanasahi-6.2-7 pushed de-mailboxed
#asahi-dev · 2023-03-14 11:32
mazI'm very reluctant to make things up.
#asahi-dev · 2023-03-14 11:32
mazgiven that the KVM virtual PMU is backed by perf counters, we would need the PMU to be able to count whilst running the guest.
#asahi-dev · 2023-03-14 11:30
mazamarioguy: cool, thanks. one question I have is whether there is a control that allows the IMPDEF PMU to count at EL1&0 with HCR_EL2.{E2H,TGE}={1,0}. From what I've seen, it normally doesn't count when running a guest.
#asahi-dev · 2023-03-14 11:22
amarioguyshould be sufficient, poke me if you need anything else tested, testing config was t6002 Mac Studio in m1n1 console
#asahi-dev · 2023-03-14 11:21
amarioguymaz: https://gist.github.com/amarioguy/f7c2fcc90ca673e511130204e381ac4a
#asahi-dev · 2023-03-14 09:25
mazamarioguy: if you can dump these results somewhere, I'll have a look at what it means for KVM, and whether we can shoehorn that or not.
#asahi-dev · 2023-03-14 05:22
blacktopis there a way to get the verbose boot logs to be writen to a file when booting a custom kc?
#asahi-dev · 2023-03-14 03:06
eilnmarcan: got it
#asahi-dev · 2023-03-14 03:05
marcaneiln: saw that, might wait until the current crop of kernel issues/release is sorted before merging new stuff though

plus ›