Skip to content
Commit 2565dce1 authored by Thomas Huth's avatar Thomas Huth Committed by Paolo Bonzini
Browse files

powerpc: Rework the rtas_token() function



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: default avatarThomas Huth <thuth@redhat.com>
Message-Id: <1496229338-7113-1-git-send-email-thuth@redhat.com>
Reviewed-by: Andrew Jones's avatarAndrew Jones <drjones@redhat.com>
Reviewed-by: default avatarLaurent Vivier <lvivier@redhat.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 499e63ff
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment