Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/s390/linux

Pull s390 updates from Martin Schwidefsky:
 "This it the second batch of s390 patches for the 3.6 merge window.
  Included is enablement for two common code changes, killable page
  faults and sorted exception tables.  And the regular set of cleanup
  and bug fix patches."

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
  s390: make use of user_mode() macro where possible
  s390/mm: rename user_mode variable to addressing_mode
  s390/mm: fix fault handling for page table walk case
  s390/mm: make page faults killable
  s390: update defconfig
  s390/mm: downgrade page table after fork of a 31 bit process
  s390/ipl: Use diagnose 8 command separation
  s390/linker script: use RO_DATA_SECTION
  s390/exceptions: sort exception table at build time
  s390/debug: remove module_exit function / move EXPORT_SYMBOLs
  • Loading branch information
torvalds committed Jul 31, 2012
2 parents 08843b7 + 7d25617 commit 26847fa
Show file tree
Hide file tree
Showing 18 changed files with 104 additions and 105 deletions.
1 change: 1 addition & 0 deletions arch/s390/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ config S390
select HAVE_MEMBLOCK_NODE_MAP
select HAVE_CMPXCHG_LOCAL
select ARCH_DISCARD_MEMBLOCK
select BUILDTIME_EXTABLE_SORT
select ARCH_INLINE_SPIN_TRYLOCK
select ARCH_INLINE_SPIN_TRYLOCK_BH
select ARCH_INLINE_SPIN_LOCK
Expand Down
5 changes: 3 additions & 2 deletions arch/s390/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ CONFIG_TASK_DELAY_ACCT=y
CONFIG_TASK_XACCT=y
CONFIG_TASK_IO_ACCOUNTING=y
CONFIG_AUDIT=y
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y
CONFIG_RCU_FAST_NO_HZ=y
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
CONFIG_CGROUPS=y
Expand Down Expand Up @@ -35,8 +38,6 @@ CONFIG_MODVERSIONS=y
CONFIG_PARTITION_ADVANCED=y
CONFIG_IBM_PARTITION=y
CONFIG_DEFAULT_DEADLINE=y
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y
CONFIG_PREEMPT=y
CONFIG_MEMORY_HOTPLUG=y
CONFIG_MEMORY_HOTREMOVE=y
Expand Down
16 changes: 14 additions & 2 deletions arch/s390/include/asm/mmu_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include <asm/uaccess.h>
#include <asm/tlbflush.h>
#include <asm/ctl_reg.h>
#include <asm-generic/mm_hooks.h>

static inline int init_new_context(struct task_struct *tsk,
struct mm_struct *mm)
Expand Down Expand Up @@ -58,7 +57,7 @@ static inline void update_mm(struct mm_struct *mm, struct task_struct *tsk)
pgd_t *pgd = mm->pgd;

S390_lowcore.user_asce = mm->context.asce_bits | __pa(pgd);
if (user_mode != HOME_SPACE_MODE) {
if (addressing_mode != HOME_SPACE_MODE) {
/* Load primary space page table origin. */
asm volatile(LCTL_OPCODE" 1,1,%0\n"
: : "m" (S390_lowcore.user_asce) );
Expand Down Expand Up @@ -91,4 +90,17 @@ static inline void activate_mm(struct mm_struct *prev,
switch_mm(prev, next, current);
}

static inline void arch_dup_mmap(struct mm_struct *oldmm,
struct mm_struct *mm)
{
#ifdef CONFIG_64BIT
if (oldmm->context.asce_limit < mm->context.asce_limit)
crst_table_downgrade(mm, oldmm->context.asce_limit);
#endif
}

static inline void arch_exit_mmap(struct mm_struct *mm)
{
}

#endif /* __S390_MMU_CONTEXT_H */
2 changes: 2 additions & 0 deletions arch/s390/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ struct stack_frame {
regs->psw.mask = psw_user_bits | PSW_MASK_BA; \
regs->psw.addr = new_psw | PSW_ADDR_AMODE; \
regs->gprs[15] = new_stackp; \
__tlb_flush_mm(current->mm); \
crst_table_downgrade(current->mm, 1UL << 31); \
update_mm(current->mm, current); \
} while (0)

/* Forward declaration, a strange C thing */
Expand Down
2 changes: 1 addition & 1 deletion arch/s390/include/asm/setup.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void create_mem_hole(struct mem_chunk memory_chunk[], unsigned long addr,
#define SECONDARY_SPACE_MODE 2
#define HOME_SPACE_MODE 3

extern unsigned int user_mode;
extern unsigned int addressing_mode;

/*
* Machine features detected in head.S
Expand Down
70 changes: 23 additions & 47 deletions arch/s390/kernel/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ struct debug_view debug_raw_view = {
NULL,
NULL
};
EXPORT_SYMBOL(debug_raw_view);

struct debug_view debug_hex_ascii_view = {
"hex_ascii",
Expand All @@ -119,6 +120,7 @@ struct debug_view debug_hex_ascii_view = {
NULL,
NULL
};
EXPORT_SYMBOL(debug_hex_ascii_view);

static struct debug_view debug_level_view = {
"level",
Expand Down Expand Up @@ -155,6 +157,7 @@ struct debug_view debug_sprintf_view = {
NULL,
NULL
};
EXPORT_SYMBOL(debug_sprintf_view);

/* used by dump analysis tools to determine version of debug feature */
static unsigned int __used debug_feature_version = __DEBUG_FEATURE_VERSION;
Expand Down Expand Up @@ -730,6 +733,7 @@ debug_info_t *debug_register(const char *name, int pages_per_area,
return debug_register_mode(name, pages_per_area, nr_areas, buf_size,
S_IRUSR | S_IWUSR, 0, 0);
}
EXPORT_SYMBOL(debug_register);

/*
* debug_unregister:
Expand All @@ -748,6 +752,7 @@ debug_unregister(debug_info_t * id)
out:
return;
}
EXPORT_SYMBOL(debug_unregister);

/*
* debug_set_size:
Expand Down Expand Up @@ -810,7 +815,7 @@ debug_set_level(debug_info_t* id, int new_level)
}
spin_unlock_irqrestore(&id->lock,flags);
}

EXPORT_SYMBOL(debug_set_level);

/*
* proceed_active_entry:
Expand Down Expand Up @@ -930,7 +935,7 @@ debug_stop_all(void)
if (debug_stoppable)
debug_active = 0;
}

EXPORT_SYMBOL(debug_stop_all);

void debug_set_critical(void)
{
Expand Down Expand Up @@ -963,6 +968,7 @@ debug_event_common(debug_info_t * id, int level, const void *buf, int len)

return active;
}
EXPORT_SYMBOL(debug_event_common);

/*
* debug_exception_common:
Expand Down Expand Up @@ -990,6 +996,7 @@ debug_entry_t

return active;
}
EXPORT_SYMBOL(debug_exception_common);

/*
* counts arguments in format string for sprintf view
Expand Down Expand Up @@ -1043,6 +1050,7 @@ debug_sprintf_event(debug_info_t* id, int level,char *string,...)

return active;
}
EXPORT_SYMBOL(debug_sprintf_event);

/*
* debug_sprintf_exception:
Expand Down Expand Up @@ -1081,25 +1089,7 @@ debug_sprintf_exception(debug_info_t* id, int level,char *string,...)

return active;
}

/*
* debug_init:
* - is called exactly once to initialize the debug feature
*/

static int
__init debug_init(void)
{
int rc = 0;

s390dbf_sysctl_header = register_sysctl_table(s390dbf_dir_table);
mutex_lock(&debug_mutex);
debug_debugfs_root_entry = debugfs_create_dir(DEBUG_DIR_ROOT,NULL);
initialized = 1;
mutex_unlock(&debug_mutex);

return rc;
}
EXPORT_SYMBOL(debug_sprintf_exception);

/*
* debug_register_view:
Expand Down Expand Up @@ -1147,6 +1137,7 @@ debug_register_view(debug_info_t * id, struct debug_view *view)
out:
return rc;
}
EXPORT_SYMBOL(debug_register_view);

/*
* debug_unregister_view:
Expand Down Expand Up @@ -1176,6 +1167,7 @@ debug_unregister_view(debug_info_t * id, struct debug_view *view)
out:
return rc;
}
EXPORT_SYMBOL(debug_unregister_view);

static inline char *
debug_get_user_string(const char __user *user_buf, size_t user_len)
Expand Down Expand Up @@ -1485,6 +1477,7 @@ debug_dflt_header_fn(debug_info_t * id, struct debug_view *view,
except_str, entry->id.fields.cpuid, (void *) caller);
return rc;
}
EXPORT_SYMBOL(debug_dflt_header_fn);

/*
* prints debug data sprintf-formated:
Expand Down Expand Up @@ -1533,33 +1526,16 @@ debug_sprintf_format_fn(debug_info_t * id, struct debug_view *view,
}

/*
* clean up module
* debug_init:
* - is called exactly once to initialize the debug feature
*/
static void __exit debug_exit(void)
static int __init debug_init(void)
{
debugfs_remove(debug_debugfs_root_entry);
unregister_sysctl_table(s390dbf_sysctl_header);
return;
s390dbf_sysctl_header = register_sysctl_table(s390dbf_dir_table);
mutex_lock(&debug_mutex);
debug_debugfs_root_entry = debugfs_create_dir(DEBUG_DIR_ROOT, NULL);
initialized = 1;
mutex_unlock(&debug_mutex);
return 0;
}

/*
* module definitions
*/
postcore_initcall(debug_init);
module_exit(debug_exit);
MODULE_LICENSE("GPL");

EXPORT_SYMBOL(debug_register);
EXPORT_SYMBOL(debug_unregister);
EXPORT_SYMBOL(debug_set_level);
EXPORT_SYMBOL(debug_stop_all);
EXPORT_SYMBOL(debug_register_view);
EXPORT_SYMBOL(debug_unregister_view);
EXPORT_SYMBOL(debug_event_common);
EXPORT_SYMBOL(debug_exception_common);
EXPORT_SYMBOL(debug_hex_ascii_view);
EXPORT_SYMBOL(debug_raw_view);
EXPORT_SYMBOL(debug_dflt_header_fn);
EXPORT_SYMBOL(debug_sprintf_view);
EXPORT_SYMBOL(debug_sprintf_exception);
EXPORT_SYMBOL(debug_sprintf_event);
4 changes: 2 additions & 2 deletions arch/s390/kernel/dis.c
Original file line number Diff line number Diff line change
Expand Up @@ -1531,7 +1531,7 @@ static int print_insn(char *buffer, unsigned char *code, unsigned long addr)

void show_code(struct pt_regs *regs)
{
char *mode = (regs->psw.mask & PSW_MASK_PSTATE) ? "User" : "Krnl";
char *mode = user_mode(regs) ? "User" : "Krnl";
unsigned char code[64];
char buffer[64], *ptr;
mm_segment_t old_fs;
Expand All @@ -1540,7 +1540,7 @@ void show_code(struct pt_regs *regs)

/* Get a snapshot of the 64 bytes surrounding the fault address. */
old_fs = get_fs();
set_fs((regs->psw.mask & PSW_MASK_PSTATE) ? USER_DS : KERNEL_DS);
set_fs(user_mode(regs) ? USER_DS : KERNEL_DS);
for (start = 32; start && regs->psw.addr >= 34 - start; start -= 2) {
addr = regs->psw.addr - 34 + start;
if (__copy_from_user(code + start - 2,
Expand Down
1 change: 0 additions & 1 deletion arch/s390/kernel/early.c
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,6 @@ void __init startup_init(void)
init_kernel_storage_key();
lockdep_init();
lockdep_off();
sort_main_extable();
setup_lowcore_early();
setup_facility_list();
detect_machine_type();
Expand Down
12 changes: 2 additions & 10 deletions arch/s390/kernel/ipl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1583,7 +1583,7 @@ static struct kset *vmcmd_kset;

static void vmcmd_run(struct shutdown_trigger *trigger)
{
char *cmd, *next_cmd;
char *cmd;

if (strcmp(trigger->name, ON_REIPL_STR) == 0)
cmd = vmcmd_on_reboot;
Expand All @@ -1600,15 +1600,7 @@ static void vmcmd_run(struct shutdown_trigger *trigger)

if (strlen(cmd) == 0)
return;
do {
next_cmd = strchr(cmd, '\n');
if (next_cmd) {
next_cmd[0] = 0;
next_cmd += 1;
}
__cpcmd(cmd, NULL, 0, NULL);
cmd = next_cmd;
} while (cmd != NULL);
__cpcmd(cmd, NULL, 0, NULL);
}

static int vmcmd_init(void)
Expand Down
12 changes: 6 additions & 6 deletions arch/s390/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,8 @@ static int __init parse_vmalloc(char *arg)
}
early_param("vmalloc", parse_vmalloc);

unsigned int user_mode = HOME_SPACE_MODE;
EXPORT_SYMBOL_GPL(user_mode);
unsigned int addressing_mode = HOME_SPACE_MODE;
EXPORT_SYMBOL_GPL(addressing_mode);

static int set_amode_primary(void)
{
Expand All @@ -328,17 +328,17 @@ static int set_amode_primary(void)
*/
static int __init early_parse_switch_amode(char *p)
{
user_mode = PRIMARY_SPACE_MODE;
addressing_mode = PRIMARY_SPACE_MODE;
return 0;
}
early_param("switch_amode", early_parse_switch_amode);

static int __init early_parse_user_mode(char *p)
{
if (p && strcmp(p, "primary") == 0)
user_mode = PRIMARY_SPACE_MODE;
addressing_mode = PRIMARY_SPACE_MODE;
else if (!p || strcmp(p, "home") == 0)
user_mode = HOME_SPACE_MODE;
addressing_mode = HOME_SPACE_MODE;
else
return 1;
return 0;
Expand All @@ -347,7 +347,7 @@ early_param("user_mode", early_parse_user_mode);

static void setup_addressing_mode(void)
{
if (user_mode == PRIMARY_SPACE_MODE) {
if (addressing_mode == PRIMARY_SPACE_MODE) {
if (set_amode_primary())
pr_info("Address spaces switched, "
"mvcos available\n");
Expand Down
Loading

0 comments on commit 26847fa

Please sign in to comment.