~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to arch/s390/kernel/early.c

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings, Ben Hutchings, Aurelien Jarno, Martin Michlmayr
  • Date: 2011-04-06 13:53:30 UTC
  • mfrom: (43.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20110406135330-wjufxhd0tvn3zx4z
Tags: 2.6.38-3
[ Ben Hutchings ]
* [ppc64] Add to linux-tools package architectures (Closes: #620124)
* [amd64] Save cr4 to mmu_cr4_features at boot time (Closes: #620284)
* appletalk: Fix bugs introduced when removing use of BKL
* ALSA: Fix yet another race in disconnection
* cciss: Fix lost command issue
* ath9k: Fix kernel panic in AR2427
* ses: Avoid kernel panic when lun 0 is not mapped
* PCI/ACPI: Report ASPM support to BIOS if not disabled from command line

[ Aurelien Jarno ]
* rtlwifi: fix build when PCI is not enabled.

[ Martin Michlmayr ]
* rtlwifi: Eliminate udelay calls with too large values (Closes: #620204)

Show diffs side-by-side

added added

removed removed

Lines of Context:
82
82
        "       lm      6,15,24(15)\n"
83
83
#endif
84
84
        "       br      14\n"
85
 
        "       .size   savesys_ipl_nss, .-savesys_ipl_nss\n");
 
85
        "       .size   savesys_ipl_nss, .-savesys_ipl_nss\n"
 
86
        "       .previous\n");
86
87
 
87
88
static __initdata char upper_command_line[COMMAND_LINE_SIZE];
88
89
 
207
208
        end_pfn = PFN_UP(__pa(&_end));
208
209
 
209
210
        for (init_pfn = 0 ; init_pfn < end_pfn; init_pfn++)
210
 
                page_set_storage_key(init_pfn << PAGE_SHIFT, PAGE_DEFAULT_KEY);
 
211
                page_set_storage_key(init_pfn << PAGE_SHIFT,
 
212
                                     PAGE_DEFAULT_KEY, 0);
211
213
}
212
214
 
213
215
static __initdata struct sysinfo_3_2_2 vmms __aligned(PAGE_SIZE);
214
216
 
215
217
static noinline __init void detect_machine_type(void)
216
218
{
217
 
        /* No VM information? Looks like LPAR */
218
 
        if (stsi(&vmms, 3, 2, 2) == -ENOSYS)
 
219
        /* Check current-configuration-level */
 
220
        if ((stsi(NULL, 0, 0, 0) >> 28) <= 2) {
 
221
                S390_lowcore.machine_flags |= MACHINE_FLAG_LPAR;
219
222
                return;
220
 
        if (!vmms.count)
 
223
        }
 
224
        /* Get virtual-machine cpu information. */
 
225
        if (stsi(&vmms, 3, 2, 2) == -ENOSYS || !vmms.count)
221
226
                return;
222
227
 
223
228
        /* Running under KVM? If not we assume z/VM */
251
256
        s390_base_pgm_handler_fn = early_pgm_check_handler;
252
257
}
253
258
 
 
259
static noinline __init void setup_facility_list(void)
 
260
{
 
261
        unsigned long nr;
 
262
 
 
263
        S390_lowcore.stfl_fac_list = 0;
 
264
        asm volatile(
 
265
                "       .insn   s,0xb2b10000,0(0)\n" /* stfl */
 
266
                "0:\n"
 
267
                EX_TABLE(0b,0b) : "=m" (S390_lowcore.stfl_fac_list));
 
268
        memcpy(&S390_lowcore.stfle_fac_list, &S390_lowcore.stfl_fac_list, 4);
 
269
        nr = 4;                         /* # bytes stored by stfl */
 
270
        if (test_facility(7)) {
 
271
                /* More facility bits available with stfle */
 
272
                register unsigned long reg0 asm("0") = MAX_FACILITY_BIT/64 - 1;
 
273
                asm volatile(".insn s,0xb2b00000,%0" /* stfle */
 
274
                             : "=m" (S390_lowcore.stfle_fac_list), "+d" (reg0)
 
275
                             : : "cc");
 
276
                nr = (reg0 + 1) * 8;    /* # bytes stored by stfle */
 
277
        }
 
278
        memset((char *) S390_lowcore.stfle_fac_list + nr, 0,
 
279
               MAX_FACILITY_BIT/8 - nr);
 
280
}
 
281
 
254
282
static noinline __init void setup_hpage(void)
255
283
{
256
284
#ifndef CONFIG_DEBUG_PAGEALLOC
257
 
        unsigned int facilities;
258
 
 
259
 
        facilities = stfl();
260
 
        if (!(facilities & (1UL << 23)) || !(facilities & (1UL << 29)))
 
285
        if (!test_facility(2) || !test_facility(8))
261
286
                return;
262
287
        S390_lowcore.machine_flags |= MACHINE_FLAG_HPAGE;
263
288
        __ctl_set_bit(0, 23);
351
376
static __init void detect_machine_facilities(void)
352
377
{
353
378
#ifdef CONFIG_64BIT
354
 
        unsigned int facilities;
355
 
 
356
 
        facilities = stfl();
357
 
        if (facilities & (1 << 28))
 
379
        if (test_facility(3))
358
380
                S390_lowcore.machine_flags |= MACHINE_FLAG_IDTE;
359
 
        if (facilities & (1 << 23))
 
381
        if (test_facility(8))
360
382
                S390_lowcore.machine_flags |= MACHINE_FLAG_PFMF;
361
 
        if (facilities & (1 << 4))
 
383
        if (test_facility(11))
 
384
                S390_lowcore.machine_flags |= MACHINE_FLAG_TOPOLOGY;
 
385
        if (test_facility(27))
362
386
                S390_lowcore.machine_flags |= MACHINE_FLAG_MVCOS;
 
387
        if (test_facility(40))
 
388
                S390_lowcore.machine_flags |= MACHINE_FLAG_SPP;
363
389
#endif
364
390
}
365
391
 
402
428
 
403
429
static void __init setup_boot_command_line(void)
404
430
{
 
431
        int i;
 
432
 
 
433
        /* convert arch command line to ascii */
 
434
        for (i = 0; i < ARCH_COMMAND_LINE_SIZE; i++)
 
435
                if (COMMAND_LINE[i] & 0x80)
 
436
                        break;
 
437
        if (i < ARCH_COMMAND_LINE_SIZE)
 
438
                EBCASC(COMMAND_LINE, ARCH_COMMAND_LINE_SIZE);
 
439
        COMMAND_LINE[ARCH_COMMAND_LINE_SIZE-1] = 0;
 
440
 
405
441
        /* copy arch command line */
406
 
        strlcpy(boot_command_line, COMMAND_LINE, ARCH_COMMAND_LINE_SIZE);
 
442
        strlcpy(boot_command_line, strstrip(COMMAND_LINE),
 
443
                ARCH_COMMAND_LINE_SIZE);
407
444
 
408
445
        /* append IPL PARM data to the boot command line */
409
446
        if (MACHINE_IS_VM)
428
465
        lockdep_off();
429
466
        sort_main_extable();
430
467
        setup_lowcore_early();
 
468
        setup_facility_list();
431
469
        detect_machine_type();
432
470
        ipl_update_parameters();
433
471
        setup_boot_command_line();