Project

General

Profile

Actions

Feature #14936

closed

need a better SMN addressing mechanism

Added by Robert Mustacchi 4 months ago. Updated 3 months ago.

Status:
Closed
Priority:
Normal
Category:
kernel
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:

Description

At Oxide, we've been working a lot with the AMD SMN addressing implementation beyond just what we see in usmn, amdzen, smntemp, and zen_umc. As part of this, we've tried a few different incremental attempts at improving the register definitions and how to make this usable, deal with the complexities of different functional groups, and try to end up with something that is still fairly usable and less error-prone.

The note from the folks working on it as to our specific approach was:

Instead of trying to explain a rather convoluted collection of very long, hard-to-read macros, I'm going to follow the lead in the generic amdzen UMC driver. We'll use inline functions specific to each functional unit to compute individual SMN addresses and much shorter macros to obtain the final ones. Checking the correctness of the definitions and instance numbers will be simpler and more explicit this way, which should also make it easier to understand if something goes wrong.

This will also put us on track to move the Milan-specific headers into generic locations once model-specificity is factored out, with all the SMN consumers looking more or less similar.

~~

We've already seen this approach work for us and have subsequently extended it a bit to also deal with different sized apertures where if you read the wrong size, the hardware will barf, and enforce this. So we've found that this approach has been working for us and does seem to be amenable to our continued use and evolution.

Actions #1

Updated by Electric Monk 4 months ago

  • Gerrit CR set to 2322
Actions #2

Updated by Robert Mustacchi 3 months ago

We've tested this primarily by using it extensively in our systems. In addition, we did basic smoke checks of usmn, smntemp, the zen_umc driver, and others on top of this. See also #14925 which was tested and built on top of this.

Actions #3

Updated by Electric Monk 3 months ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit ba215efe42e70993d3838f7af671f9d9fc0ebc33

commit  ba215efe42e70993d3838f7af671f9d9fc0ebc33
Author: Keith M Wesolowski <wesolows@oxide.computer>
Date:   2022-09-11T04:06:00.000Z

    14936 need a better SMN addressing mechanism
    Reviewed by: Robert Mustacchi <rm@fingolfin.org>
    Reviewed by: Andy Fiddaman <illumos@fiddaman.net>
    Approved by: Garrett D'Amore <garrett@damore.org>

Actions

Also available in: Atom PDF