Что является функцией “mov eax, cr3; mov cr3, eax” в x86 ассемблерном коде?

Возможно, более эффективный маршрут должен был бы сериализировать использование BinaryFormatter

, Как скопировано от http://blog.paranoidferret.com/index.php/2007/04/27/csharp-tutorial-serialize-objects-to-a-file/

using System.IO;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;

public class Serializer
{
   public Serializer()
   {
   }

   public void SerializeObject(string filename,
                  ObjectToSerialize objectToSerialize)
   {
      Stream stream = File.Open(filename, FileMode.Create);
      BinaryFormatter bFormatter = new BinaryFormatter();
      bFormatter.Serialize(stream, objectToSerialize);
      stream.Close();
   }

   public ObjectToSerialize DeSerializeObject(string filename)
   {
      ObjectToSerialize objectToSerialize;
      Stream stream = File.Open(filename, FileMode.Open);
      BinaryFormatter bFormatter = new BinaryFormatter();
      objectToSerialize =
         (ObjectToSerialize)bFormatter.Deserialize(stream);
      stream.Close();
      return objectToSerialize;
   }
}

13
задан Ciro Santilli 新疆改造中心法轮功六四事件 20 September 2015 в 19:18
поделиться

1 ответ

It is flushing the TLBs (Translation Lookaside Buffers) by loading cr3 with itself.

Intel even mentions the code in their "Intel 64 and IA-32 Architectures Software Develoment Manual Volume 3A - System Programming Guide".

mov EAX,CR3  ; invalidate the TLB
mov CR3,EAX  ; by copying CR3 to itself

You can find that and many more handy manuals at:

http://www.intel.com/products/processor/manuals/index.htm

26
ответ дан 1 December 2019 в 21:25
поделиться
Другие вопросы по тегам:

Похожие вопросы: