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: <4D9646C6.7060301@zytor.com>
Date:	Fri, 01 Apr 2011 14:42:30 -0700
From:	"H. Peter Anvin" <hpa@...or.com>
To:	Yinghai Lu <yinghai@...nel.org>
CC:	Stefano Stabellini <stefano.stabellini@...citrix.com>,
	Ingo Molnar <mingo@...hat.com>,
	"Rafael J. Wysocki" <rjw@...k.pl>,
	Michael Leun <lkml20101129@...ton.leun.net>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Greg Kroah-Hartman <gregkh@...e.de>,
	Mike Pagano <mpagano@...too.org>
Subject: Re: 2.6.38.2 breaks suspend to disk

On 04/01/2011 02:37 PM, Yinghai Lu wrote:
>>
>> Err, yes, that's what I meant.
>>
>> Now, why the heck did you introduce a bunch of CONFIG_HIBERNATION #ifdefs?
> 
> mmu_cr4_features: have two usages:
> 1. for 32bit to control cr4 access in head_32.S
> 2. for hibernation resume.
> 
> include/asm/processor.h:extern unsigned long            mmu_cr4_features;
> include/asm/processor.h:        mmu_cr4_features |= mask;
> include/asm/processor.h:        mmu_cr4_features &= ~mask;
> kernel/head_32.S:#define cr4_bits pa(mmu_cr4_features)
> kernel/setup.c: * mmu_cr4_features two purpose:
> kernel/setup.c:unsigned long mmu_cr4_features;
> kernel/setup.c:unsigned long mmu_cr4_features = X86_CR4_PAE;
> kernel/setup.c:         mmu_cr4_features = read_cr4();
> power/hibernate_asm_32.S:       movl    mmu_cr4_features, %ecx
> power/hibernate_asm_32.S:       movl    mmu_cr4_features, %ecx
> power/hibernate_asm_64.S:       movq    mmu_cr4_features(%rip), %rax
> power/hibernate_asm_64.S:       movq    mmu_cr4_features(%rip), %rax
> 
> So we don't need to read back cr4 and save it if CONFIG_HIBERNATION is
> not defined.
> 

And why on Earth is it worth saving a couple of instructions (and
introducing code ugliness and a more complex testing matrix) in the case
when it is not?

	-hpa
--
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