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

hibernate.c (556B)


      1// SPDX-License-Identifier: GPL-2.0-only
      2
      3#include <linux/mm.h>
      4#include <linux/suspend.h>
      5#include <asm/coprocessor.h>
      6
      7int pfn_is_nosave(unsigned long pfn)
      8{
      9	unsigned long nosave_begin_pfn = PFN_DOWN(__pa(&__nosave_begin));
     10	unsigned long nosave_end_pfn = PFN_UP(__pa(&__nosave_end));
     11
     12	return	(pfn >= nosave_begin_pfn) && (pfn < nosave_end_pfn);
     13}
     14
     15void notrace save_processor_state(void)
     16{
     17	WARN_ON(num_online_cpus() != 1);
     18#if XTENSA_HAVE_COPROCESSORS
     19	local_coprocessors_flush_release_all();
     20#endif
     21}
     22
     23void notrace restore_processor_state(void)
     24{
     25}