All of lore.kernel.org
 help / color / mirror / Atom feed
* Mapping IPMI boot device selector to D-Bbus properties
@ 2018-04-05  9:16 Deepak Kodihalli
  2018-04-06  0:45 ` Stewart Smith
  0 siblings, 1 reply; 2+ messages in thread
From: Deepak Kodihalli @ 2018-04-05  9:16 UTC (permalink / raw)
  To: tomjose, stewart, vernon.mauery, emilyshaffer, a.amelkin; +Cc: OpenBMC Maillist

Hi,

We recently discovered an issue in the way the IPMI boot device selector 
(represented by a nibble in the boot flags) is mapped to the D-Bus model.

In the IPMI spec the boot device selector has options for both "boot 
source" (default/disk/crdom/network) and "boot mode" 
(default/bios/safe/diag). Since this isn't a bit-filed, you can't 
override for eg both the source and mode at the same time. It's probably 
debatable to say whether such a possibility is desirable or not (for eg 
I may want to set the boot source as network by default, but want to 
boot to safe mode the next boot , and revert back to network for 
subsequent boots without having to set the device again).

There are different D-Bus interfaces depicting the boot mode [1] and 
boot source [2] though. So when the IPMI boot device is changed, the 
ipmid code sets a relevant boot mode or source property. It's possible 
that both can get set when someone for eg sets the device to cdrom and 
then to bios. The issue is how should ipmid respond to a get boot 
options command - there's no way for ipmid to aggregate information from 
both D-Bus properties as in the IPMI spec only one of them can be 
represented. Today ipmid always favors the boot source property if both 
are set [3]. That's not what a user expects though, because the user 
would expect his last override to go through.

The solution I'm proposing is that if a set boot device is mapping to a 
boot source, then reset the boot mode D-Bus property to default, or vice 
versa. This way the ipmid code can determine which property is not at 
the default value. It doesn't break the behavior from an IPMI spec 
perspective because only one can be set at a point of time anyway, and 
we'll consume the latest override to the boot device. Other solutions or 
thoughts?

[1] 
https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/xyz/openbmc_project/Control/Boot/Mode.interface.yaml
[2] 
https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/xyz/openbmc_project/Control/Boot/Source.interface.yaml
[3] 
https://github.com/openbmc/phosphor-host-ipmid/blob/master/chassishandler.cpp#L1257

Thanks,
Deepak

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Mapping IPMI boot device selector to D-Bbus properties
  2018-04-05  9:16 Mapping IPMI boot device selector to D-Bbus properties Deepak Kodihalli
@ 2018-04-06  0:45 ` Stewart Smith
  0 siblings, 0 replies; 2+ messages in thread
From: Stewart Smith @ 2018-04-06  0:45 UTC (permalink / raw)
  To: Deepak Kodihalli, tomjose, vernon.mauery, emilyshaffer, a.amelkin
  Cc: OpenBMC Maillist

Deepak Kodihalli <dkodihal@linux.vnet.ibm.com> writes:
> We recently discovered an issue in the way the IPMI boot device selector 
> (represented by a nibble in the boot flags) is mapped to the D-Bus
> model.

for anyone playing at home, this was caught by op-test:

git clone https://github.com/open-power/op-test-framework.git
cd op-test-framework
./op-test <insert auth details here> --run testcases.OpTestInbandIPMI.SkirootFullInbandIPMI.test_chassis_bootdev

and this test does pass on other BMC IPMI implementations (such as AMI).

Although the exact failure was only really an accident of the test
rather than on purpose.

A happy accident at least as it means we found a bug :)

> In the IPMI spec the boot device selector has options for both "boot 
> source" (default/disk/crdom/network) and "boot mode" 
> (default/bios/safe/diag). Since this isn't a bit-filed, you can't 
> override for eg both the source and mode at the same time. It's probably 
> debatable to say whether such a possibility is desirable or not (for eg 
> I may want to set the boot source as network by default, but want to 
> boot to safe mode the next boot , and revert back to network for 
> subsequent boots without having to set the device again).
>
> There are different D-Bus interfaces depicting the boot mode [1] and 
> boot source [2] though. So when the IPMI boot device is changed, the 
> ipmid code sets a relevant boot mode or source property. It's possible 
> that both can get set when someone for eg sets the device to cdrom and 
> then to bios. The issue is how should ipmid respond to a get boot 
> options command - there's no way for ipmid to aggregate information from 
> both D-Bus properties as in the IPMI spec only one of them can be 
> represented. Today ipmid always favors the boot source property if both 
> are set [3]. That's not what a user expects though, because the user 
> would expect his last override to go through.
>
> The solution I'm proposing is that if a set boot device is mapping to a 
> boot source, then reset the boot mode D-Bus property to default, or vice 
> versa. This way the ipmid code can determine which property is not at 
> the default value. It doesn't break the behavior from an IPMI spec 
> perspective because only one can be set at a point of time anyway, and 
> we'll consume the latest override to the boot device. Other solutions or 
> thoughts?

Do we know the behaviour of other IPMI implementations? My *guess* would
be is that they only track one bit of information and the boot mode will
override the previous request for boot source.

Perhaps the correct behaviour is to reset the temporary boot source when
boot mode is set and vice versa? It kind-of seems like that's the intent
from reading the IPMI spec, but I'd appreciate input and being proven
wrong :)

-- 
Stewart Smith
OPAL Architect, IBM.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-04-06  0:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-05  9:16 Mapping IPMI boot device selector to D-Bbus properties Deepak Kodihalli
2018-04-06  0:45 ` Stewart Smith

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.