[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87mui1732j.fsf@morokweng.localdomain>
Date: Fri, 28 Jun 2019 19:33:24 -0300
From: Thiago Jung Bauermann <bauerman@...ux.ibm.com>
To: Alexey Kardashevskiy <aik@...abs.ru>
Cc: linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org,
Anshuman Khandual <anshuman.linux@...il.com>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Christoph Hellwig <hch@....de>,
Michael Ellerman <mpe@...erman.id.au>,
Mike Anderson <andmike@...ux.ibm.com>,
Paul Mackerras <paulus@...ba.org>,
Ram Pai <linuxram@...ibm.com>,
Claudio Carvalho <cclaudio@...ux.ibm.com>
Subject: Re: [RFC PATCH 03/12] powerpc/prom_init: Add the ESM call to prom_init
Hello Alexey,
Thanks for reviewing this patch!
Alexey Kardashevskiy <aik@...abs.ru> writes:
> On 21/05/2019 14:49, Thiago Jung Bauermann wrote:
>> @@ -1707,6 +1723,43 @@ static void __init prom_close_stdin(void)
>> }
>> }
>>
>> +#ifdef CONFIG_PPC_SVM
>> +static int prom_rtas_os_term_hcall(uint64_t args)
>
>
> This is just an rtas hcall, nothing special about "os-term".
Sorry, unfortunately I don't understand how we're treating os-term
especially. Do you mean that we should inline this function directly
into prom_rtas_os_term()?
>> +{
>> + register uint64_t arg1 asm("r3") = 0xf000;
>> + register uint64_t arg2 asm("r4") = args;
>> +
>> + asm volatile("sc 1\n" : "=r" (arg1) :
>> + "r" (arg1),
>> + "r" (arg2) :);
>> + return arg1;
>> +}
>> +
>> +static struct rtas_args __prombss os_term_args;
>> +
>> +static void __init prom_rtas_os_term(char *str)
>> +{
>> + phandle rtas_node;
>> + __be32 val;
>> + u32 token;
>> +
>> + prom_printf("%s: start...\n", __func__);
>> + rtas_node = call_prom("finddevice", 1, 1, ADDR("/rtas"));
>> + prom_printf("rtas_node: %x\n", rtas_node);
>> + if (!PHANDLE_VALID(rtas_node))
>> + return;
>> +
>> + val = 0;
>> + prom_getprop(rtas_node, "ibm,os-term", &val, sizeof(val));
>> + token = be32_to_cpu(val);
>> + prom_printf("ibm,os-term: %x\n", token);
>> + if (token == 0)
>> + prom_panic("Could not get token for ibm,os-term\n");
>> + os_term_args.token = cpu_to_be32(token);
>> + prom_rtas_os_term_hcall((uint64_t)&os_term_args);
>> +}
>> +#endif /* CONFIG_PPC_SVM */
>> +
>> /*
>> * Allocate room for and instantiate RTAS
>> */
--
Thiago Jung Bauermann
IBM Linux Technology Center
Powered by blists - more mailing lists