-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
powerpc: Define CPU feature for Architected 2.06 HV mode
This bit indicates that we are operating in hypervisor mode on a CPU compliant to architecture 2.06 or later (currently server only). We set it on POWER7 and have a boot-time CPU setup function that clears it if MSR:HV isn't set (booting under a hypervisor). Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
- Loading branch information
Benjamin Herrenschmidt
committed
Apr 20, 2011
1 parent
f6e17f9
commit 24cc67d
Showing
4 changed files
with
74 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
* This file contains low level CPU setup functions. | ||
* Copyright (C) 2003 Benjamin Herrenschmidt (benh@kernel.crashing.org) | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation; either version | ||
* 2 of the License, or (at your option) any later version. | ||
* | ||
*/ | ||
|
||
#include <asm/processor.h> | ||
#include <asm/page.h> | ||
#include <asm/cputable.h> | ||
#include <asm/ppc_asm.h> | ||
#include <asm/asm-offsets.h> | ||
#include <asm/cache.h> | ||
|
||
/* Entry: r3 = crap, r4 = ptr to cputable entry | ||
* | ||
* Note that we can be called twice for pseudo-PVRs | ||
*/ | ||
_GLOBAL(__setup_cpu_power7) | ||
mflr r11 | ||
bl __init_hvmode_206 | ||
mtlr r11 | ||
beqlr | ||
bl __init_LPCR | ||
mtlr r11 | ||
blr | ||
|
||
_GLOBAL(__restore_cpu_power7) | ||
mflr r11 | ||
mfmsr r3 | ||
rldicl. r0,r3,4,63 | ||
beqlr | ||
bl __init_LPCR | ||
mtlr r11 | ||
blr | ||
|
||
__init_hvmode_206: | ||
/* Disable CPU_FTR_HVMODE_206 and exit if MSR:HV is not set */ | ||
mfmsr r3 | ||
rldicl. r0,r3,4,63 | ||
bnelr | ||
ld r5,CPU_SPEC_FEATURES(r4) | ||
LOAD_REG_IMMEDIATE(r6,CPU_FTR_HVMODE_206) | ||
xor r5,r5,r6 | ||
std r5,CPU_SPEC_FEATURES(r4) | ||
blr | ||
|
||
__init_LPCR: | ||
/* Setup a sane LPCR: | ||
* | ||
* LPES = 0b11 (SRR0/1 used for 0x500) | ||
* PECE = 0b111 | ||
* | ||
* Other bits untouched for now | ||
*/ | ||
mfspr r3,SPRN_LPCR | ||
ori r3,r3,(LPCR_LPES0|LPCR_LPES1) | ||
ori r3,r3,(LPCR_PECE0|LPCR_PECE1|LPCR_PECE2) | ||
mtspr SPRN_LPCR,r3 | ||
isync | ||
blr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters