bugGNU GRUB - Bugs: bug #58438, setpci write mask value is wrongly...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #58438: setpci write mask value is wrongly ignored

Submitter:  Larry Carver <lcarver>
Submitted:  Sun 24 May 2020 11:30:17 AM UTC
Votes: 15
 
Category:  None Severity:  Major
Priority:  5 - Normal Item Group:  Software Error
Status:  None Privacy:  Public
Assigned to:  None Originator Name:  Larry Carver
Open/Closed:  Open Release:  Git master
Release:  Reproducibility:  Every Time
Planned Release:  None

Sun 24 May 2020 11:30:17 AM UTC, original submission:  

Problem -- Write mask value given to setpci is ignored.
Example --

grub> setpci -s b6:0.0 70.L
Register 70 of b6:00.0 is 27

grub> setpci -s b6:0.0 70.L=0:1

grub> setpci -s b6:0.0 70.L
Register 70 of b6:00.0 is 0

Reason -- I think the following assignment is wrong, and should be removed.
Please see the following line 315, following
  the assignment to write_mask and the error check.
The code is re-assigning the value to be 0xffffffff.
At
  https://github.com/coreos/grub/blob/master/grub-core/commands/setpci.c#L315

  write_mask = 0;
  if (*ptr == '=')
    {
      ptr++;
      regwrite = grub_strtoul (ptr, (char **) &ptr, 16);
      if (grub_errno)
       return grub_errno;
      write_mask = 0xffffffff;
      if (*ptr == ':')
       {
         ptr++;
         write_mask = grub_strtoul (ptr, (char **) &ptr, 16);
         if (grub_errno)
           return grub_errno;
         write_mask = 0xffffffff;    /*  <-- Why is this here ??  */
       }
      regwrite &= write_mask;
    }

Larry Carver <lcarver>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by felix_s (Voted in favor of this item)
  • -email is unavailable- added by lcarver (Voted in favor of this item)
  • -email is unavailable- added by lcarver (Submitted the item)
  •  

    There are 15 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-11-26 felix_s Carbon-Copy- Added felix_s
    2020-05-24 lcarver Carbon-Copy- Added lcarver

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code