All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leandro Lupori <leandro.lupori@eldorado.org.br>
To: Fabiano Rosas <farosas@linux.ibm.com>,
	qemu-devel@nongnu.org, qemu-ppc@nongnu.org
Cc: clg@kaod.org, danielhb413@gmail.com, david@gibson.dropbear.id.au,
	groug@kaod.org
Subject: Re: [PATCH 2/3] target/ppc: Improve Radix xlate level validation
Date: Fri, 24 Jun 2022 10:22:10 -0300	[thread overview]
Message-ID: <dde4feea-c16d-3c0d-b41e-28bec7e2de95@eldorado.org.br> (raw)
In-Reply-To: <87h74daf28.fsf@linux.ibm.com>

On 6/21/22 18:21, Fabiano Rosas wrote:
> [E-MAIL EXTERNO] Não clique em links ou abra anexos, a menos que você possa confirmar o remetente e saber que o conteúdo é seguro. Em caso de e-mail suspeito entre imediatamente em contato com o DTI.
> 
> Leandro Lupori <leandro.lupori@eldorado.org.br> writes:
> 
>> Check if the number and size of Radix levels are valid on
>> POWER9/POWER10 CPUs, according to the supported Radix Tree
>> Configurations described in their User Manuals.
>>
>> Signed-off-by: Leandro Lupori <leandro.lupori@eldorado.org.br>
>> ---
>>   target/ppc/mmu-radix64.c | 36 +++++++++++++++++++++++++++++-------
>>   1 file changed, 29 insertions(+), 7 deletions(-)
>>
>> diff --git a/target/ppc/mmu-radix64.c b/target/ppc/mmu-radix64.c
>> index 9a8a2e2875..2f0bcbfe2e 100644
>> --- a/target/ppc/mmu-radix64.c
>> +++ b/target/ppc/mmu-radix64.c
>> @@ -236,13 +236,31 @@ static void ppc_radix64_set_rc(PowerPCCPU *cpu, MMUAccessType access_type,
>>       }
>>   }
>>
>> +static bool ppc_radix64_is_valid_level(int level, int psize, uint64_t nls)
> 
> I wonder if we should take the time to make this per-CPU now to prepare
> for any future CPU that supports a different layout.
> 

The downside would be that we would already take a performance hit by 
calling this function through a CPU class pointer. It would also prevent 
compiler optimizations that are possible with local static functions.

I can leave a comment in ppc_radix64_is_valid_level, suggesting the 
addition of a new CPU class method, if a new CPU that supports other 
Radix configurations is added (e.g., Microwatt).

Thanks,
Leandro


  reply	other threads:[~2022-06-24 13:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-20 20:27 [PATCH 0/3] ppc: Check for bad Radix configs Leandro Lupori
2022-06-20 20:27 ` [PATCH 1/3] ppc: Check partition and process table alignment Leandro Lupori
2022-06-21 11:05   ` Cédric Le Goater
2022-06-23 14:24     ` Leandro Lupori
2022-06-20 20:27 ` [PATCH 2/3] target/ppc: Improve Radix xlate level validation Leandro Lupori
2022-06-21 21:21   ` Fabiano Rosas
2022-06-24 13:22     ` Leandro Lupori [this message]
2022-06-20 20:27 ` [PATCH 3/3] target/ppc: Check page dir/table base alignment Leandro Lupori
2022-06-21 21:26   ` Fabiano Rosas
2022-06-23 14:26     ` Leandro Lupori
2022-06-23 21:34       ` Richard Henderson
2022-06-24 12:20         ` Leandro Lupori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dde4feea-c16d-3c0d-b41e-28bec7e2de95@eldorado.org.br \
    --to=leandro.lupori@eldorado.org.br \
    --cc=clg@kaod.org \
    --cc=danielhb413@gmail.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=farosas@linux.ibm.com \
    --cc=groug@kaod.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.