-
Thomas Huth authored
RTAS tokens can have any value, also 0xffffffff is theoretically allowed (which is currently used for the RTAS_UNKNOWN_SERVICE error code). Thus we should not mix error codes and tokens in the return value here and return the token value via a pointer parameter instead. This patch also adds a check to rtas_token() to test whether the device tree is available at all. This fixes a possible endless loop that happens without device tree, spamming the console with "rtas_node: /rtas: FDT_ERR_BADMAGIC" messages: Somewhere the code calls abort() due to the missing device tree, and abort() calls exit() which in turn tries to shut down the VM with rtas_power_off(). rtas_power_off() needs the device tree again to look up the right RTAS token, where we then end up in the next iteration. Signed-off-by: Thomas Huth <thuth@redhat.com> Message-Id: <1496229338-7113-1-git-send-email-thuth@redhat.com> Reviewed-by: Andrew Jones <drjones@redhat.com> Reviewed-by: Laurent Vivier <lvivier@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2565dce1