setup.c (d6bdceb6c2276276c0392b926ccd2e5991d5cb9a) setup.c (7fa95f9adaee7e5cbb195d3359741120829e488b)
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * 64-bit pSeries and RS/6000 setup code.
4 *
5 * Copyright (C) 1995 Linus Torvalds
6 * Adapted from 'alpha' version by Gary Thomas
7 * Modified by Cort Dougan (cort@cs.nmt.edu)
8 * Modified by PPC64 Team, IBM Corp

--- 56 unchanged lines hidden (view full) ---

65#include <asm/plpar_wrappers.h>
66#include <asm/kexec.h>
67#include <asm/isa-bridge.h>
68#include <asm/security_features.h>
69#include <asm/asm-const.h>
70#include <asm/idle.h>
71#include <asm/swiotlb.h>
72#include <asm/svm.h>
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * 64-bit pSeries and RS/6000 setup code.
4 *
5 * Copyright (C) 1995 Linus Torvalds
6 * Adapted from 'alpha' version by Gary Thomas
7 * Modified by Cort Dougan (cort@cs.nmt.edu)
8 * Modified by PPC64 Team, IBM Corp

--- 56 unchanged lines hidden (view full) ---

65#include <asm/plpar_wrappers.h>
66#include <asm/kexec.h>
67#include <asm/isa-bridge.h>
68#include <asm/security_features.h>
69#include <asm/asm-const.h>
70#include <asm/idle.h>
71#include <asm/swiotlb.h>
72#include <asm/svm.h>
73#include <asm/dtl.h>
74
75#include "pseries.h"
76#include "../../../../drivers/pci/pci.h"
77
78DEFINE_STATIC_KEY_FALSE(shared_processor);
79EXPORT_SYMBOL_GPL(shared_processor);
80
81int CMO_PrPSP = -1;

--- 272 unchanged lines hidden (view full) ---

354
355/*
356 * Enable relocation on during exceptions. This has partition wide scope and
357 * may take a while to complete, if it takes longer than one second we will
358 * just give up rather than wasting any more time on this - if that turns out
359 * to ever be a problem in practice we can move this into a kernel thread to
360 * finish off the process later in boot.
361 */
73
74#include "pseries.h"
75#include "../../../../drivers/pci/pci.h"
76
77DEFINE_STATIC_KEY_FALSE(shared_processor);
78EXPORT_SYMBOL_GPL(shared_processor);
79
80int CMO_PrPSP = -1;

--- 272 unchanged lines hidden (view full) ---

353
354/*
355 * Enable relocation on during exceptions. This has partition wide scope and
356 * may take a while to complete, if it takes longer than one second we will
357 * just give up rather than wasting any more time on this - if that turns out
358 * to ever be a problem in practice we can move this into a kernel thread to
359 * finish off the process later in boot.
360 */
362void pseries_enable_reloc_on_exc(void)
361bool pseries_enable_reloc_on_exc(void)
363{
364 long rc;
365 unsigned int delay, total_delay = 0;
366
367 while (1) {
368 rc = enable_reloc_on_exceptions();
369 if (!H_IS_LONG_BUSY(rc)) {
370 if (rc == H_P2) {
371 pr_info("Relocation on exceptions not"
372 " supported\n");
362{
363 long rc;
364 unsigned int delay, total_delay = 0;
365
366 while (1) {
367 rc = enable_reloc_on_exceptions();
368 if (!H_IS_LONG_BUSY(rc)) {
369 if (rc == H_P2) {
370 pr_info("Relocation on exceptions not"
371 " supported\n");
372 return false;
373 } else if (rc != H_SUCCESS) {
374 pr_warn("Unable to enable relocation"
375 " on exceptions: %ld\n", rc);
373 } else if (rc != H_SUCCESS) {
374 pr_warn("Unable to enable relocation"
375 " on exceptions: %ld\n", rc);
376 return false;
376 }
377 }
377 break;
378 return true;
378 }
379
380 delay = get_longbusy_msecs(rc);
381 total_delay += delay;
382 if (total_delay > 1000) {
383 pr_warn("Warning: Giving up waiting to enable "
384 "relocation on exceptions (%u msec)!\n",
385 total_delay);
379 }
380
381 delay = get_longbusy_msecs(rc);
382 total_delay += delay;
383 if (total_delay > 1000) {
384 pr_warn("Warning: Giving up waiting to enable "
385 "relocation on exceptions (%u msec)!\n",
386 total_delay);
386 return;
387 return false;
387 }
388
389 mdelay(delay);
390 }
391}
392EXPORT_SYMBOL(pseries_enable_reloc_on_exc);
393
394void pseries_disable_reloc_on_exc(void)

--- 651 unchanged lines hidden ---
388 }
389
390 mdelay(delay);
391 }
392}
393EXPORT_SYMBOL(pseries_enable_reloc_on_exc);
394
395void pseries_disable_reloc_on_exc(void)

--- 651 unchanged lines hidden ---