cachepc-qemu

Fork of AMDESE/qemu with changes for cachepc side-channel attack
git clone https://git.sinitax.com/sinitax/cachepc-qemu
Log | Files | Refs | Submodules | LICENSE | sfeed.txt

pagesize.c (499B)


      1/*
      2 * pagesize.c - query the host about its page size
      3 *
      4 * Copyright (C) 2017, Emilio G. Cota <cota@braap.org>
      5 * License: GNU GPL, version 2 or later.
      6 *   See the COPYING file in the top-level directory.
      7 */
      8
      9#include "qemu/osdep.h"
     10
     11uintptr_t qemu_real_host_page_size;
     12intptr_t qemu_real_host_page_mask;
     13
     14static void __attribute__((constructor)) init_real_host_page_size(void)
     15{
     16    qemu_real_host_page_size = getpagesize();
     17    qemu_real_host_page_mask = -(intptr_t)qemu_real_host_page_size;
     18}