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] [day] [month] [year] [list]
Message-ID: <26fee8c9-695d-7703-bac9-5582ab560ae5@hygon.cn>
Date:   Mon, 21 Oct 2019 03:08:50 +0000
From:   Jinke Fan <fanjinke@...on.cn>
To:     Alexandre Belloni <alexandre.belloni@...tlin.com>
CC:     "a.zummo@...ertech.it" <a.zummo@...ertech.it>,
        Wen Pu <puwen@...on.cn>,
        "thomas.lendacky@....com" <thomas.lendacky@....com>,
        "kim.phillips@....com" <kim.phillips@....com>,
        "linux-rtc@...r.kernel.org" <linux-rtc@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [RESEND RFC PATCH v3] rtc: Fix the AltCentury value on AMD/Hygon
 platform

On 2019/10/20 6:04, Alexandre Belloni wrote:
> On 15/10/2019 16:08:27+0800, Jinke Fan wrote:
>>   	save_freq_select = CMOS_READ(RTC_FREQ_SELECT);
>> -	CMOS_WRITE((save_freq_select|RTC_DIV_RESET2), RTC_FREQ_SELECT);
>> +
>> +#ifdef CONFIG_X86
>> +	if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD ||
>> +	    boot_cpu_data.x86_vendor == X86_VENDOR_HYGON)
>> +		CMOS_WRITE((save_freq_select & (~RTC_DV0)), RTC_FREQ_SELECT);
> 
> This should probably use ~RTC_DIV_RESET2.

Yes, ~RTC_DIV_RESET2 can actually achieve the same effect, because of
bit5-bit6 is defined as reserved.

>> +	else
>> +		CMOS_WRITE((save_freq_select | RTC_DIV_RESET2), RTC_FREQ_SELECT);
>> +#else
>> +	CMOS_WRITE((save_freq_select | RTC_DIV_RESET2), RTC_FREQ_SELECT);
>> +#endif
> 
> Also, later you have:
> 
> CMOS_WRITE(save_freq_select, RTC_FREQ_SELECT);
> 
> This may write bit4 again which would make mc146818_get_time fail so you
> probably want to update save_freq_select.

Yes, thanks for reminding me.

-- 
Best Regards,
Jinke Fan.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ