cachepc-linux

Fork of AMDESE/linux with modifications for CachePC side-channel attack
git clone https://git.sinitax.com/sinitax/cachepc-linux
Log | Files | Refs | README | LICENSE | sfeed.txt

balloon.h (1068B)


      1/* SPDX-License-Identifier: GPL-2.0 */
      2/******************************************************************************
      3 * Xen balloon functionality
      4 */
      5#ifndef _XEN_BALLOON_H
      6#define _XEN_BALLOON_H
      7
      8#define RETRY_UNLIMITED	0
      9
     10struct balloon_stats {
     11	/* We aim for 'current allocation' == 'target allocation'. */
     12	unsigned long current_pages;
     13	unsigned long target_pages;
     14	unsigned long target_unpopulated;
     15	/* Number of pages in high- and low-memory balloons. */
     16	unsigned long balloon_low;
     17	unsigned long balloon_high;
     18	unsigned long total_pages;
     19	unsigned long schedule_delay;
     20	unsigned long max_schedule_delay;
     21	unsigned long retry_count;
     22	unsigned long max_retry_count;
     23};
     24
     25extern struct balloon_stats balloon_stats;
     26
     27void balloon_set_new_target(unsigned long target);
     28
     29int xen_alloc_ballooned_pages(unsigned int nr_pages, struct page **pages);
     30void xen_free_ballooned_pages(unsigned int nr_pages, struct page **pages);
     31
     32#ifdef CONFIG_XEN_BALLOON
     33void xen_balloon_init(void);
     34#else
     35static inline void xen_balloon_init(void)
     36{
     37}
     38#endif
     39
     40#endif	/* _XEN_BALLOON_H */