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]
Message-ID: <69b80c44-3245-4393-b6e9-4d8a7f3d3c66@email.android.com>
Date:	Wed, 21 Aug 2013 09:33:23 +0200
From:	"H. Peter Anvin" <hpa@...or.com>
To:	Ingo Molnar <mingo@...nel.org>, Li Fei <fei.li@...el.com>
CC:	mingo@...hat.com, tglx@...utronix.de, chuansheng.liu@...el.com,
	x86@...nel.org, akpm@...ux-foundation.org, holt@....com,
	rmk+kernel@....linux.org.uk, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] reboot: perform warm/cold reset correctly for CF9 type

Careful.  This is a very different definition of warm vs cold boot used elsewhere.

Ingo Molnar <mingo@...nel.org> wrote:
>
>* Li Fei <fei.li@...el.com> wrote:
>
>> In current implementation for reboot type CF9 and CF9_COND,
>> warm and cold reset are not differentiated, and both are
>> performed by writing 0x06 to port 0xCF9 as warm reset. It's not
>> correct.
>> 
>> This commit will differentiate warm and cold reset, and perform
>> them correctly as below:
>> For warm reset, write 0x06 to port 0xCF9;
>> For cold reset, write 0x0E to port 0xCF9.
>> 
>> From: Liu Chuansheng <chuansheng.liu@...el.com>
>> Signed-off-by: Li Fei <fei.li@...el.com>
>> ---
>>  arch/x86/kernel/reboot.c |    9 +++++++--
>>  1 files changed, 7 insertions(+), 2 deletions(-)
>> 
>> diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
>> index 563ed91..6e06299 100644
>> --- a/arch/x86/kernel/reboot.c
>> +++ b/arch/x86/kernel/reboot.c
>> @@ -511,10 +511,15 @@ static void
>native_machine_emergency_restart(void)
>>  
>>  		case BOOT_CF9_COND:
>>  			if (port_cf9_safe) {
>> -				u8 cf9 = inb(0xcf9) & ~6;
>> +				u8 cf9 = inb(0xcf9) &
>> +						~(reboot_mode == REBOOT_WARM ?
>> +						0x06 : 0x0E);
>>  				outb(cf9|2, 0xcf9); /* Request hard reset */
>>  				udelay(50);
>> -				outb(cf9|6, 0xcf9); /* Actually do the reset */
>> +				/* Actually do the reset */
>> +				outb(cf9|(reboot_mode == REBOOT_WARM ?
>> +					0x06 : 0x0E),
>> +					0xcf9);
>>  				udelay(50);
>
>Looks good, but please introduce a reboot_val intermediate 
>variable instead of duplicating that ugly line-broken 
>construct twice.
>
>Thanks,
>
>	Ingo

-- 
Sent from my mobile phone. Please excuse brevity and lack of formatting.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ