RE: [PATCH RFC v2 2/2] tpm_tis: Move ilb_base_addr to tpm_tis_tcg_phy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




>-----Original Message-----
>From: Shaikh, Azhar
>Sent: Wednesday, November 15, 2017 9:59 AM
>To: Sakkinen, Jarkko <jarkko.sakkinen@xxxxxxxxx>; Jason Gunthorpe
><jgg@xxxxxxxx>
>Cc: linux-integrity@xxxxxxxxxxxxxxx
>Subject: RE: [PATCH RFC v2 2/2] tpm_tis: Move ilb_base_addr to
>tpm_tis_tcg_phy
>
>
>
>>-----Original Message-----
>>From: Sakkinen, Jarkko
>>Sent: Wednesday, November 15, 2017 12:14 AM
>>To: Jason Gunthorpe <jgg@xxxxxxxx>
>>Cc: Shaikh, Azhar <azhar.shaikh@xxxxxxxxx>;
>>linux-integrity@xxxxxxxxxxxxxxx
>>Subject: Re: [PATCH RFC v2 2/2] tpm_tis: Move ilb_base_addr to
>>tpm_tis_tcg_phy
>>
>>On Tue, Nov 14, 2017 at 04:28:12PM -0700, Jason Gunthorpe wrote:
>>> On Tue, Nov 07, 2017 at 01:32:08PM -0800, Azhar Shaikh wrote:
>>>
>>> > +#ifdef CONFIG_X86
>>> > +	if (is_bsw())
>>> > +		iounmap(phy->ilb_base_addr);
>>> > +#endif
>>>
>>> This whole thing would be much better if is_bsw was just
>>>
>>> bool is_bsw(void)
>>> {
>>>    if (!IS_ENABLED(CONFIG_X86))
>>>        return false;
>>>    [..]
>>> }
>>>
>>> Then drop every single one of these #ifdef CONFIG_X86
>>>
>>> Jason
>>
>>+1
>>
>
>Thank you for the suggestion.
>Will incorporate this in next patch series.
>

If I implement is_bsw() as below and move it(is_bsw()) outside the #ifdef CONFIG_X86, I will still get compilation errors for non-x86 platforms, since INTEL_FAM6_ATOM_AIRMONT will be undefined. 

bool is_bsw(void)
{
    if (!IS_ENABLED(CONFIG_X86))
        return false;
return ((boot_cpu_data.x86_model == INTEL_FAM6_ATOM_AIRMONT) ? 1 : 0);
}

I think I will have to keep is_bsw() implementation unchanged?

>>/Jarkko



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux Kernel]     [Linux Kernel Hardening]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux