Project

General

Profile

Actions

Feature #13986

closed

usmn(7D) could support writing

Added by Robert Mustacchi about 2 months ago. Updated about 2 months ago.

Status:
Closed
Priority:
Normal
Category:
driver - device drivers
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

In #13983 we added the support to read form the AMD SMN. For various prorotyping purposes it can be valuable to be valuable to be able to write to it without spinning up custom kernel modules. This adds the stubbed out USMN_WRITE ioctl. The use of this style requires full hardware manipulation privilege and it is not installed on systems by default.

Here's an example of using it to basically drive the HSMP interface's test function which adds 1 to a register:

rm@iliad /ws/rm/usmn/usr/src/cmd/amdzen $ pfexec ./usmn -d /devices/pseudo/amdzen@0/usmn@2:usmn.0  -w 0 3B10980 
rm@iliad /ws/rm/usmn/usr/src/cmd/amdzen $ pfexec ./usmn -d /devices/pseudo/amdzen@0/usmn@2:usmn.0  -w 23 3B109E0 
rm@iliad /ws/rm/usmn/usr/src/cmd/amdzen $ pfexec ./usmn -d /devices/pseudo/amdzen@0/usmn@2:usmn.0  -w 1 3B10534 
rm@iliad /ws/rm/usmn/usr/src/cmd/amdzen $ pfexec ./usmn -d /devices/pseudo/amdzen@0/usmn@2:usmn.0  3B10534 3B10980 3B109E0 
0x3b10534: 0x1
0x3b10980: 0x1
0x3b109e0: 0x24

This was tested by basic usage of it as illustrated above.


Related issues

Related to illumos gate - Feature #13146: Want a driver for AMD SMN user accessClosedRobert Mustacchi

Actions
Actions #1

Updated by Gergő Mihály Doma about 2 months ago

  • Related to Feature #13146: Want a driver for AMD SMN user access added
Actions #2

Updated by Electric Monk about 2 months ago

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

git commit f198607dfbf80950ec14f7c1fecf634f2da7ebb0

commit  f198607dfbf80950ec14f7c1fecf634f2da7ebb0
Author: Robert Mustacchi <rm@fingolfin.org>
Date:   2021-08-02T23:19:07.000Z

    13986 usmn(7D) could support writing
    Reviewed by: Gergő Mihály Doma <domag02@gmail.com>
    Reviewed by: C Fraire <cfraire@me.com>
    Reviewed by: Andy Fiddaman <andy@omnios.org>
    Approved by: Richard Lowe <richlowe@richlowe.net>

Actions

Also available in: Atom PDF