Skip to content

Commit 8b53ef3

Browse files
committed
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6: (29 commits) [IA64] BUG to BUG_ON changes [IA64] Fix typo/thinko in arch/ia64/sn/kernel/sn2/sn2_smp.c ia64: remove some warnings. ia64/xen: fix the link error. ia64/pv_ops/bp/xen: implemented binary patchable pv_cpu_ops. ia64/pv_ops/binary patch: define paravirt_dv_serialize_data() and suppress false positive warning. ia64/pv_ops/bp/module: support binary patching for kernel module. ia64/pv_ops: implement binary patching optimization for native. ia64/pv_op/binarypatch: add helper functions to support binary patching for paravirt_ops. ia64/pv_ops/xen/gate.S: xen gate page paravirtualization ia64/pv_ops: paravirtualize gate.S. ia64/pv_ops: move down __kernel_syscall_via_epc. ia64/pv_ops/xen: define xen specific gate page. ia64/pv_ops: gate page paravirtualization. ia64/pv_ops/xen/pv_time_ops: implement sched_clock. ia64/pv_ops/pv_time_ops: add sched_clock hook. ia64/pv_ops/xen: paravirtualize read/write ar.itc and ar.itm ia64/pv_ops: paravirtualize mov = ar.itc. ia64/pv_ops/pvchecker: support mov = ar.itc paravirtualization ia64/pv_ops: paravirtualize fsys.S. ...
2 parents ef5ddd3 + 80a03e2 commit 8b53ef3

61 files changed

Lines changed: 3188 additions & 290 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎arch/ia64/include/asm/intrinsics.h‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,11 @@ extern long ia64_cmpxchg_called_with_bad_pointer (void);
202202

203203
#ifndef __ASSEMBLY__
204204
#if defined(CONFIG_PARAVIRT) && defined(__KERNEL__)
205-
#define IA64_INTRINSIC_API(name) pv_cpu_ops.name
205+
#ifdef ASM_SUPPORTED
206+
# define IA64_INTRINSIC_API(name) paravirt_ ## name
207+
#else
208+
# define IA64_INTRINSIC_API(name) pv_cpu_ops.name
209+
#endif
206210
#define IA64_INTRINSIC_MACRO(name) paravirt_ ## name
207211
#else
208212
#define IA64_INTRINSIC_API(name) ia64_native_ ## name

‎arch/ia64/include/asm/mmu_context.h‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ get_mmu_context (struct mm_struct *mm)
8787
/* re-check, now that we've got the lock: */
8888
context = mm->context;
8989
if (context == 0) {
90-
cpus_clear(mm->cpu_vm_mask);
90+
cpumask_clear(mm_cpumask(mm));
9191
if (ia64_ctx.next >= ia64_ctx.limit) {
9292
ia64_ctx.next = find_next_zero_bit(ia64_ctx.bitmap,
9393
ia64_ctx.max_ctx, ia64_ctx.next);
@@ -166,8 +166,8 @@ activate_context (struct mm_struct *mm)
166166

167167
do {
168168
context = get_mmu_context(mm);
169-
if (!cpu_isset(smp_processor_id(), mm->cpu_vm_mask))
170-
cpu_set(smp_processor_id(), mm->cpu_vm_mask);
169+
if (!cpumask_test_cpu(smp_processor_id(), mm_cpumask(mm)))
170+
cpumask_set_cpu(smp_processor_id(), mm_cpumask(mm));
171171
reload_context(context);
172172
/*
173173
* in the unlikely event of a TLB-flush by another thread,

‎arch/ia64/include/asm/module.h‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ struct mod_arch_specific {
1616
struct elf64_shdr *got; /* global offset table */
1717
struct elf64_shdr *opd; /* official procedure descriptors */
1818
struct elf64_shdr *unwind; /* unwind-table section */
19+
#ifdef CONFIG_PARAVIRT
20+
struct elf64_shdr *paravirt_bundles;
21+
/* paravirt_alt_bundle_patch table */
22+
struct elf64_shdr *paravirt_insts;
23+
/* paravirt_alt_inst_patch table */
24+
#endif
1925
unsigned long gp; /* global-pointer for module */
2026

2127
void *core_unw_table; /* core unwind-table cookie returned by unwinder */

‎arch/ia64/include/asm/native/inst.h‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
#define __paravirt_work_processed_syscall_target \
3131
ia64_work_processed_syscall
3232

33+
#define paravirt_fsyscall_table ia64_native_fsyscall_table
34+
#define paravirt_fsys_bubble_down ia64_native_fsys_bubble_down
35+
3336
#ifdef CONFIG_PARAVIRT_GUEST_ASM_CLOBBER_CHECK
3437
# define PARAVIRT_POISON 0xdeadbeefbaadf00d
3538
# define CLOBBER(clob) \
@@ -74,6 +77,11 @@
7477
(pred) mov reg = psr \
7578
CLOBBER(clob)
7679

80+
#define MOV_FROM_ITC(pred, pred_clob, reg, clob) \
81+
(pred) mov reg = ar.itc \
82+
CLOBBER(clob) \
83+
CLOBBER_PRED(pred_clob)
84+
7785
#define MOV_TO_IFA(reg, clob) \
7886
mov cr.ifa = reg \
7987
CLOBBER(clob)
@@ -158,6 +166,11 @@
158166
#define RSM_PSR_DT \
159167
rsm psr.dt
160168

169+
#define RSM_PSR_BE_I(clob0, clob1) \
170+
rsm psr.be | psr.i \
171+
CLOBBER(clob0) \
172+
CLOBBER(clob1)
173+
161174
#define SSM_PSR_DT_AND_SRLZ_I \
162175
ssm psr.dt \
163176
;; \
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/******************************************************************************
2+
* arch/ia64/include/asm/native/inst.h
3+
*
4+
* Copyright (c) 2008 Isaku Yamahata <yamahata at valinux co jp>
5+
* VA Linux Systems Japan K.K.
6+
*
7+
* This program is free software; you can redistribute it and/or modify
8+
* it under the terms of the GNU General Public License as published by
9+
* the Free Software Foundation; either version 2 of the License, or
10+
* (at your option) any later version.
11+
*
12+
* This program is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU General Public License
18+
* along with this program; if not, write to the Free Software
19+
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20+
*
21+
*/
22+
23+
#define __paravirt_start_gate_fsyscall_patchlist \
24+
__ia64_native_start_gate_fsyscall_patchlist
25+
#define __paravirt_end_gate_fsyscall_patchlist \
26+
__ia64_native_end_gate_fsyscall_patchlist
27+
#define __paravirt_start_gate_brl_fsys_bubble_down_patchlist \
28+
__ia64_native_start_gate_brl_fsys_bubble_down_patchlist
29+
#define __paravirt_end_gate_brl_fsys_bubble_down_patchlist \
30+
__ia64_native_end_gate_brl_fsys_bubble_down_patchlist
31+
#define __paravirt_start_gate_vtop_patchlist \
32+
__ia64_native_start_gate_vtop_patchlist
33+
#define __paravirt_end_gate_vtop_patchlist \
34+
__ia64_native_end_gate_vtop_patchlist
35+
#define __paravirt_start_gate_mckinley_e9_patchlist \
36+
__ia64_native_start_gate_mckinley_e9_patchlist
37+
#define __paravirt_end_gate_mckinley_e9_patchlist \
38+
__ia64_native_end_gate_mckinley_e9_patchlist

‎arch/ia64/include/asm/native/pvchk_inst.h‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,11 @@
180180
IS_PRED_IN(pred) \
181181
IS_RREG_OUT(reg) \
182182
IS_RREG_CLOB(clob)
183+
#define MOV_FROM_ITC(pred, pred_clob, reg, clob) \
184+
IS_PRED_IN(pred) \
185+
IS_PRED_CLOB(pred_clob) \
186+
IS_RREG_OUT(reg) \
187+
IS_RREG_CLOB(clob)
183188
#define MOV_TO_IFA(reg, clob) \
184189
IS_RREG_IN(reg) \
185190
IS_RREG_CLOB(clob)
@@ -246,6 +251,9 @@
246251
IS_RREG_CLOB(clob2)
247252
#define RSM_PSR_DT \
248253
nop 0
254+
#define RSM_PSR_BE_I(clob0, clob1) \
255+
IS_RREG_CLOB(clob0) \
256+
IS_RREG_CLOB(clob1)
249257
#define SSM_PSR_DT_AND_SRLZ_I \
250258
nop 0
251259
#define BSW_0(clob0, clob1, clob2) \

‎arch/ia64/include/asm/paravirt.h‎

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,56 @@
2222
#ifndef __ASM_PARAVIRT_H
2323
#define __ASM_PARAVIRT_H
2424

25+
#ifndef __ASSEMBLY__
26+
/******************************************************************************
27+
* fsys related addresses
28+
*/
29+
struct pv_fsys_data {
30+
unsigned long *fsyscall_table;
31+
void *fsys_bubble_down;
32+
};
33+
34+
extern struct pv_fsys_data pv_fsys_data;
35+
36+
unsigned long *paravirt_get_fsyscall_table(void);
37+
char *paravirt_get_fsys_bubble_down(void);
38+
39+
/******************************************************************************
40+
* patchlist addresses for gate page
41+
*/
42+
enum pv_gate_patchlist {
43+
PV_GATE_START_FSYSCALL,
44+
PV_GATE_END_FSYSCALL,
45+
46+
PV_GATE_START_BRL_FSYS_BUBBLE_DOWN,
47+
PV_GATE_END_BRL_FSYS_BUBBLE_DOWN,
48+
49+
PV_GATE_START_VTOP,
50+
PV_GATE_END_VTOP,
51+
52+
PV_GATE_START_MCKINLEY_E9,
53+
PV_GATE_END_MCKINLEY_E9,
54+
};
55+
56+
struct pv_patchdata {
57+
unsigned long start_fsyscall_patchlist;
58+
unsigned long end_fsyscall_patchlist;
59+
unsigned long start_brl_fsys_bubble_down_patchlist;
60+
unsigned long end_brl_fsys_bubble_down_patchlist;
61+
unsigned long start_vtop_patchlist;
62+
unsigned long end_vtop_patchlist;
63+
unsigned long start_mckinley_e9_patchlist;
64+
unsigned long end_mckinley_e9_patchlist;
65+
66+
void *gate_section;
67+
};
68+
69+
extern struct pv_patchdata pv_patchdata;
70+
71+
unsigned long paravirt_get_gate_patchlist(enum pv_gate_patchlist type);
72+
void *paravirt_get_gate_section(void);
73+
#endif
74+
2575
#ifdef CONFIG_PARAVIRT_GUEST
2676

2777
#define PARAVIRT_HYPERVISOR_TYPE_DEFAULT 0
@@ -68,6 +118,14 @@ struct pv_init_ops {
68118
int (*arch_setup_nomca)(void);
69119

70120
void (*post_smp_prepare_boot_cpu)(void);
121+
122+
#ifdef ASM_SUPPORTED
123+
unsigned long (*patch_bundle)(void *sbundle, void *ebundle,
124+
unsigned long type);
125+
unsigned long (*patch_inst)(unsigned long stag, unsigned long etag,
126+
unsigned long type);
127+
#endif
128+
void (*patch_branch)(unsigned long tag, unsigned long type);
71129
};
72130

73131
extern struct pv_init_ops pv_init_ops;
@@ -210,6 +268,8 @@ struct pv_time_ops {
210268
int (*do_steal_accounting)(unsigned long *new_itm);
211269

212270
void (*clocksource_resume)(void);
271+
272+
unsigned long long (*sched_clock)(void);
213273
};
214274

215275
extern struct pv_time_ops pv_time_ops;
@@ -227,6 +287,11 @@ paravirt_do_steal_accounting(unsigned long *new_itm)
227287
return pv_time_ops.do_steal_accounting(new_itm);
228288
}
229289

290+
static inline unsigned long long paravirt_sched_clock(void)
291+
{
292+
return pv_time_ops.sched_clock();
293+
}
294+
230295
#endif /* !__ASSEMBLY__ */
231296

232297
#else
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
/******************************************************************************
2+
* Copyright (c) 2008 Isaku Yamahata <yamahata at valinux co jp>
3+
* VA Linux Systems Japan K.K.
4+
*
5+
* This program is free software; you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation; either version 2 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this program; if not, write to the Free Software
17+
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18+
*
19+
*/
20+
21+
#ifndef __ASM_PARAVIRT_PATCH_H
22+
#define __ASM_PARAVIRT_PATCH_H
23+
24+
#ifdef __ASSEMBLY__
25+
26+
.section .paravirt_branches, "a"
27+
.previous
28+
#define PARAVIRT_PATCH_SITE_BR(type) \
29+
{ \
30+
[1:] ; \
31+
br.cond.sptk.many 2f ; \
32+
nop.b 0 ; \
33+
nop.b 0;; ; \
34+
} ; \
35+
2: \
36+
.xdata8 ".paravirt_branches", 1b, type
37+
38+
#else
39+
40+
#include <linux/stringify.h>
41+
#include <asm/intrinsics.h>
42+
43+
/* for binary patch */
44+
struct paravirt_patch_site_bundle {
45+
void *sbundle;
46+
void *ebundle;
47+
unsigned long type;
48+
};
49+
50+
/* label means the beginning of new bundle */
51+
#define paravirt_alt_bundle(instr, privop) \
52+
"\t998:\n" \
53+
"\t" instr "\n" \
54+
"\t999:\n" \
55+
"\t.pushsection .paravirt_bundles, \"a\"\n" \
56+
"\t.popsection\n" \
57+
"\t.xdata8 \".paravirt_bundles\", 998b, 999b, " \
58+
__stringify(privop) "\n"
59+
60+
61+
struct paravirt_patch_bundle_elem {
62+
const void *sbundle;
63+
const void *ebundle;
64+
unsigned long type;
65+
};
66+
67+
68+
struct paravirt_patch_site_inst {
69+
unsigned long stag;
70+
unsigned long etag;
71+
unsigned long type;
72+
};
73+
74+
#define paravirt_alt_inst(instr, privop) \
75+
"\t[998:]\n" \
76+
"\t" instr "\n" \
77+
"\t[999:]\n" \
78+
"\t.pushsection .paravirt_insts, \"a\"\n" \
79+
"\t.popsection\n" \
80+
"\t.xdata8 \".paravirt_insts\", 998b, 999b, " \
81+
__stringify(privop) "\n"
82+
83+
struct paravirt_patch_site_branch {
84+
unsigned long tag;
85+
unsigned long type;
86+
};
87+
88+
struct paravirt_patch_branch_target {
89+
const void *entry;
90+
unsigned long type;
91+
};
92+
93+
void
94+
__paravirt_patch_apply_branch(
95+
unsigned long tag, unsigned long type,
96+
const struct paravirt_patch_branch_target *entries,
97+
unsigned int nr_entries);
98+
99+
void
100+
paravirt_patch_reloc_br(unsigned long tag, const void *target);
101+
102+
void
103+
paravirt_patch_reloc_brl(unsigned long tag, const void *target);
104+
105+
106+
#if defined(ASM_SUPPORTED) && defined(CONFIG_PARAVIRT)
107+
unsigned long
108+
ia64_native_patch_bundle(void *sbundle, void *ebundle, unsigned long type);
109+
110+
unsigned long
111+
__paravirt_patch_apply_bundle(void *sbundle, void *ebundle, unsigned long type,
112+
const struct paravirt_patch_bundle_elem *elems,
113+
unsigned long nelems,
114+
const struct paravirt_patch_bundle_elem **found);
115+
116+
void
117+
paravirt_patch_apply_bundle(const struct paravirt_patch_site_bundle *start,
118+
const struct paravirt_patch_site_bundle *end);
119+
120+
void
121+
paravirt_patch_apply_inst(const struct paravirt_patch_site_inst *start,
122+
const struct paravirt_patch_site_inst *end);
123+
124+
void paravirt_patch_apply(void);
125+
#else
126+
#define paravirt_patch_apply_bundle(start, end) do { } while (0)
127+
#define paravirt_patch_apply_inst(start, end) do { } while (0)
128+
#define paravirt_patch_apply() do { } while (0)
129+
#endif
130+
131+
#endif /* !__ASSEMBLEY__ */
132+
133+
#endif /* __ASM_PARAVIRT_PATCH_H */
134+
135+
/*
136+
* Local variables:
137+
* mode: C
138+
* c-set-style: "linux"
139+
* c-basic-offset: 8
140+
* tab-width: 8
141+
* indent-tabs-mode: t
142+
* End:
143+
*/

0 commit comments

Comments
 (0)