ia64/pv_ops/xen: paravirtualize read/write ar.itc and ar.itm
paravirtualize ar.itc and ar.itm in order to support save/restore. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Tony Luck <tony.luck@intel.com>
This commit is contained in:
@@ -113,6 +113,27 @@
|
||||
.endm
|
||||
#define MOV_FROM_PSR(pred, reg, clob) __MOV_FROM_PSR pred, reg, clob
|
||||
|
||||
/* assuming ar.itc is read with interrupt disabled. */
|
||||
#define MOV_FROM_ITC(pred, pred_clob, reg, clob) \
|
||||
(pred) movl clob = XSI_ITC_OFFSET; \
|
||||
;; \
|
||||
(pred) ld8 clob = [clob]; \
|
||||
(pred) mov reg = ar.itc; \
|
||||
;; \
|
||||
(pred) add reg = reg, clob; \
|
||||
;; \
|
||||
(pred) movl clob = XSI_ITC_LAST; \
|
||||
;; \
|
||||
(pred) ld8 clob = [clob]; \
|
||||
;; \
|
||||
(pred) cmp.geu.unc pred_clob, p0 = clob, reg; \
|
||||
;; \
|
||||
(pred_clob) add reg = 1, clob; \
|
||||
;; \
|
||||
(pred) movl clob = XSI_ITC_LAST; \
|
||||
;; \
|
||||
(pred) st8 [clob] = reg
|
||||
|
||||
|
||||
#define MOV_TO_IFA(reg, clob) \
|
||||
movl clob = XSI_IFA; \
|
||||
|
@@ -209,6 +209,15 @@ struct mapped_regs {
|
||||
unsigned long krs[8]; /* kernel registers */
|
||||
unsigned long tmp[16]; /* temp registers
|
||||
(e.g. for hyperprivops) */
|
||||
|
||||
/* itc paravirtualization
|
||||
* vAR.ITC = mAR.ITC + itc_offset
|
||||
* itc_last is one which was lastly passed to
|
||||
* the guest OS in order to prevent it from
|
||||
* going backwords.
|
||||
*/
|
||||
unsigned long itc_offset;
|
||||
unsigned long itc_last;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@@ -1,3 +1,12 @@
|
||||
|
||||
#ifdef CONFIG_VIRT_CPU_ACCOUNTING
|
||||
/* read ar.itc in advance, and use it before leaving bank 0 */
|
||||
#define XEN_ACCOUNT_GET_STAMP \
|
||||
MOV_FROM_ITC(pUStk, p6, r20, r2);
|
||||
#else
|
||||
#define XEN_ACCOUNT_GET_STAMP
|
||||
#endif
|
||||
|
||||
/*
|
||||
* DO_SAVE_MIN switches to the kernel stacks (if necessary) and saves
|
||||
* the minimum state necessary that allows us to turn psr.ic back
|
||||
@@ -123,7 +132,7 @@
|
||||
;; \
|
||||
.mem.offset 0,0; st8.spill [r16]=r2,16; \
|
||||
.mem.offset 8,0; st8.spill [r17]=r3,16; \
|
||||
ACCOUNT_GET_STAMP \
|
||||
XEN_ACCOUNT_GET_STAMP \
|
||||
adds r2=IA64_PT_REGS_R16_OFFSET,r1; \
|
||||
;; \
|
||||
EXTRA; \
|
||||
|
@@ -55,6 +55,8 @@
|
||||
#define XSI_BANK1_R16 (XSI_BASE + XSI_BANK1_R16_OFS)
|
||||
#define XSI_BANKNUM (XSI_BASE + XSI_BANKNUM_OFS)
|
||||
#define XSI_IHA (XSI_BASE + XSI_IHA_OFS)
|
||||
#define XSI_ITC_OFFSET (XSI_BASE + XSI_ITC_OFFSET_OFS)
|
||||
#define XSI_ITC_LAST (XSI_BASE + XSI_ITC_LAST_OFS)
|
||||
#endif
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
Reference in New Issue
Block a user