Commit daddcbdc authored by Dmitry Safonov's avatar Dmitry Safonov Committed by Andrei Vagin

ppc64/aarch64: Export __page_{shift, size} in libcompel

Libcompel supplies to the parasite PAGE_SIZE during infection.
On ppc64/aarch64 PAGE_SIZE can be different with Large pages,
under the cover it returns __page_size.

At this moment __page_size is located in criu binary, which
prevents using libcompel as .so library in other applications
than criu on ppc64/aarch64.

Export __page_size and __page_shift in libcompel.

Fixes: #572
Fixes: 2d965008 ("ppc64/aarch64: Dynamically define PAGE_SIZE")

Cc: Adrian Reber <areber@redhat.com>
Acked-by: 's avatarCyrill Gorcunov <gorcunov@gmail.com>
Reported-by: Alexey Shabalin
Signed-off-by: 's avatarDmitry Safonov <dima@arista.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@gmail.com>
parent df107d63
......@@ -11,6 +11,9 @@
#include "infect.h"
#include "infect-priv.h"
unsigned __page_size = 0;
unsigned __page_shift = 0;
/*
* Injected syscall instruction
*/
......
......@@ -22,6 +22,9 @@
#define NT_PPC_TM_SPR 0x10c /* TM Special Purpose Registers */
#endif
unsigned __page_size = 0;
unsigned __page_shift = 0;
/*
* Injected syscall instruction
*/
......
......@@ -21,9 +21,6 @@
#include "restorer.h"
#include <compel/compel.h>
unsigned __page_size = 0;
unsigned __page_shift = 0;
#define assign_reg(dst, src, e) dst->e = (__typeof__(dst->e))(src)->e
int save_task_regs(void *x, user_regs_struct_t *regs, user_fpregs_struct_t *fpsimd)
......
......@@ -23,9 +23,6 @@
#include "images/core.pb-c.h"
#include "images/creds.pb-c.h"
unsigned __page_size = 0;
unsigned __page_shift = 0;
static UserPpc64FpstateEntry *copy_fp_regs(uint64_t *fpregs)
{
UserPpc64FpstateEntry *fpe;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment