mirror of
https://github.com/torvalds/linux.git
synced 2024-12-21 10:31:54 +00:00
c5aec4c76a
Pull powerpc updates from Ben Herrenschmidt: "Here is the bulk of the powerpc changes for this merge window. It got a bit delayed in part because I wasn't paying attention, and in part because I discovered I had a core PCI change without a PCI maintainer ack in it. Bjorn eventually agreed it was ok to merge it though we'll probably improve it later and I didn't want to rebase to add his ack. There is going to be a bit more next week, essentially fixes that I still want to sort through and test. The biggest item this time is the support to build the ppc64 LE kernel with our new v2 ABI. We previously supported v2 userspace but the kernel itself was a tougher nut to crack. This is now sorted mostly thanks to Anton and Rusty. We also have a fairly big series from Cedric that add support for 64-bit LE zImage boot wrapper. This was made harder by the fact that traditionally our zImage wrapper was always 32-bit, but our new LE toolchains don't really support 32-bit anymore (it's somewhat there but not really "supported") so we didn't want to rely on it. This meant more churn that just endian fixes. This brings some more LE bits as well, such as the ability to run in LE mode without a hypervisor (ie. under OPAL firmware) by doing the right OPAL call to reinitialize the CPU to take HV interrupts in the right mode and the usual pile of endian fixes. There's another series from Gavin adding EEH improvements (one day we *will* have a release with less than 20 EEH patches, I promise!). Another highlight is the support for the "Split core" functionality on P8 by Michael. This allows a P8 core to be split into "sub cores" of 4 threads which allows the subcores to run different guests under KVM (the HW still doesn't support a partition per thread). And then the usual misc bits and fixes ..." [ Further delayed by gmail deciding that BenH is a dirty spammer. Google knows. ] * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (155 commits) powerpc/powernv: Add missing include to LPC code selftests/powerpc: Test the THP bug we fixed in the previous commit powerpc/mm: Check paca psize is up to date for huge mappings powerpc/powernv: Pass buffer size to OPAL validate flash call powerpc/pseries: hcall functions are exported to modules, need _GLOBAL_TOC() powerpc: Exported functions __clear_user and copy_page use r2 so need _GLOBAL_TOC() powerpc/powernv: Set memory_block_size_bytes to 256MB powerpc: Allow ppc_md platform hook to override memory_block_size_bytes powerpc/powernv: Fix endian issues in memory error handling code powerpc/eeh: Skip eeh sysfs when eeh is disabled powerpc: 64bit sendfile is capped at 2GB powerpc/powernv: Provide debugfs access to the LPC bus via OPAL powerpc/serial: Use saner flags when creating legacy ports powerpc: Add cpu family documentation powerpc/xmon: Fix up xmon format strings powerpc/powernv: Add calls to support little endian host powerpc: Document sysfs DSCR interface powerpc: Fix regression of per-CPU DSCR setting powerpc: Split __SYSFS_SPRSETUP macro arch: powerpc/fadump: Cleaning up inconsistent NULL checks ...
86 lines
2.1 KiB
C
86 lines
2.1 KiB
C
/*
|
|
* ePAPR para-virtualization support.
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License, version 2, as
|
|
* published by the Free Software Foundation.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
*
|
|
* Copyright (C) 2012 Freescale Semiconductor, Inc.
|
|
*/
|
|
|
|
#include <linux/of.h>
|
|
#include <linux/of_fdt.h>
|
|
#include <asm/epapr_hcalls.h>
|
|
#include <asm/cacheflush.h>
|
|
#include <asm/code-patching.h>
|
|
#include <asm/machdep.h>
|
|
|
|
#if !defined(CONFIG_64BIT) || defined(CONFIG_PPC_BOOK3E_64)
|
|
extern void epapr_ev_idle(void);
|
|
extern u32 epapr_ev_idle_start[];
|
|
#endif
|
|
|
|
bool epapr_paravirt_enabled;
|
|
static bool __maybe_unused epapr_has_idle;
|
|
|
|
static int __init early_init_dt_scan_epapr(unsigned long node,
|
|
const char *uname,
|
|
int depth, void *data)
|
|
{
|
|
const u32 *insts;
|
|
int len;
|
|
int i;
|
|
|
|
insts = of_get_flat_dt_prop(node, "hcall-instructions", &len);
|
|
if (!insts)
|
|
return 0;
|
|
|
|
if (len % 4 || len > (4 * 4))
|
|
return -1;
|
|
|
|
for (i = 0; i < (len / 4); i++) {
|
|
u32 inst = be32_to_cpu(insts[i]);
|
|
patch_instruction(epapr_hypercall_start + i, inst);
|
|
#if !defined(CONFIG_64BIT) || defined(CONFIG_PPC_BOOK3E_64)
|
|
patch_instruction(epapr_ev_idle_start + i, inst);
|
|
#endif
|
|
}
|
|
|
|
#if !defined(CONFIG_64BIT) || defined(CONFIG_PPC_BOOK3E_64)
|
|
if (of_get_flat_dt_prop(node, "has-idle", NULL))
|
|
epapr_has_idle = true;
|
|
#endif
|
|
|
|
epapr_paravirt_enabled = true;
|
|
|
|
return 1;
|
|
}
|
|
|
|
int __init epapr_paravirt_early_init(void)
|
|
{
|
|
of_scan_flat_dt(early_init_dt_scan_epapr, NULL);
|
|
|
|
return 0;
|
|
}
|
|
|
|
static int __init epapr_idle_init(void)
|
|
{
|
|
#if !defined(CONFIG_64BIT) || defined(CONFIG_PPC_BOOK3E_64)
|
|
if (epapr_has_idle)
|
|
ppc_md.power_save = epapr_ev_idle;
|
|
#endif
|
|
|
|
return 0;
|
|
}
|
|
|
|
postcore_initcall(epapr_idle_init);
|