lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 05 Nov 2018 10:19:08 -0800 (PST)
From:   David Miller <davem@...emloft.net>
To:     acme@...nel.org
Cc:     adrian.hunter@...el.com, jolsa@...hat.com, ak@...ux.intel.com,
        linux-kernel@...r.kernel.org, leo.yan@...aro.org,
        mathieu.poirier@...aro.org
Subject: Re: [PATCH 1/5] perf tools: Add fallback functions for cases where
 cpumode is insufficient

From: Arnaldo Carvalho de Melo <acme@...nel.org>
Date: Mon, 5 Nov 2018 14:29:46 -0300

>> @@ -2542,6 +2542,46 @@ int machine__get_kernel_start(struct machine *machine)
>>  	return err;
>>  }
>>  
>> +/*
>> + * machine__single_ku_as - Machine has same address space for kernel and user.
>> + * @machine: machine object
>> + *
>> + * Some architectures have a single address space for kernel and user addresses,
>> + * which makes it possible to determine if an address is in kernel space or user
>> + * space.
>> + */
>> +static bool machine__single_ku_as(struct machine *machine)
>> +{
>> +	return strcmp(perf_env__arch(machine->env), "sparc");
>> +}
> 
> Can we avoid having this strcmp be done repeatedly? I.e. just make this
> a boolean initialized at session start, when machine->env is setup, so
> we'd have:
> 
>    machine->single_address_space
> 
> Instead of a function?

Agreed, doing this every time is wasteful.

We could also make it a define in some arch/foo file.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ