Microcode | Microcode Updates for the USENIX 2017 paper | Reverse Engineering library
kandi X-RAY | Microcode Summary
kandi X-RAY | Microcode Summary
This repository contains the framework used during our work on reverse engineering the microcode of AMD K8 and K10 CPUs. It includes an assembler and disassembler as well as example programs implemented using these tools. We also provide our custom written minimal operating system that can rapidly apply and test microcode updates on AMD CPUs.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Decode a bitcode
- Return the dsz of the dsz
- Return the operation corresponding to op bits
- Return the register corresponding to the given register bits
- Get the Mnem
- Gets the next field by position
- Evaluate the field
- Analyze the triad
- Generate the analysis output
- Assemble the instruction
- Return an instruction
- Wait for the UCSP connection to be ready
- Get a single packet from the server
- Return the bytes of the trie
- Check if the remote host is busy
- Get the MentionM from the triad
- Run a remote SSH command
- Get file from remote
- Send file to remote host
- Synchronizes rsync files
- Parsetriad - crypt
- Return a string representation of the bit
- Receive a single packet from the server
- Convert nasmcode to shell code
- Generate analysis output
- Assemble an assembly code
- Return bit representation of the SW
- Convert inputAsm to random arsen
Microcode Key Features
Microcode Examples and Code Snippets
Community Discussions
Trending Discussions on Microcode
QUESTION
I'm working on a procfs kernel extension for macOS and trying to implement a feature that emulates Linux’s /proc/cpuinfo similar to what FreeBSD does with its linprocfs. Since I'm trying to learn, and since not every bit of FreeBSD code can simply be copied over to XNU and be expected to work right out of the jar, I'm writing this feature from scratch, with FreeBSD and NetBSD's linux-based procfs features as a reference. Anyways...
Under Linux, $cat /proc/cpuinfo showes me something like this:
...ANSWER
Answered 2022-Mar-18 at 07:54There is no need to allocate memory for this task: pass a pointer to a local array along with its size and use strlcat
properly:
QUESTION
I wrote a small program to explore out-of-bounds reads vulnerabilities in C to better understand them; this program is intentionally buggy and has vulnerabilities:
...ANSWER
Answered 2021-Dec-31 at 23:21Since stdout
is line buffered, putchar
doesn't write to the terminal directly; it puts the character into a buffer, which is flushed when a newline is encountered. And the buffer for stdout
happens to be located on the heap following your heap_book
allocation.
So at some point in your copy, you putchar
all the characters of your secretinfo
method. They are now in the output buffer. A little later, heap_book[i]
is within the stdout
buffer itself, so you encounter the copy of secretinfo
that is there. When you putchar
it, you effectively create another copy a little further along in the buffer, and the process repeats.
You can verify this in your debugger. The address of the stdout buffer, on glibc, can be found with p stdout->_IO_buf_base
. In my test it's exactly 160 bytes past heap_book
.
QUESTION
The code I work on has a substantial amount of floating point arithmetic in it. We have test cases that record the output for given inputs and verify that we don't change the results too much. I had it suggested that I enable -march native to improve performance. However, with that enabled we get test failures because the results have changed. Do the instructions that will be used because of access to more modern hardware enabled by -march native reduce the amount of floating point error? Increase the amount of floating point error? Or a bit of both? Fused multiply add should reduce the amount of floating point error but is that typical of instructions added over time? Or have some instructions been added that while more efficient are less accurate?
The platform I am targeting is x86_64 Linux. The processor information according to /proc/cpuinfo
is:
ANSWER
Answered 2021-Nov-15 at 09:40-march native
means -march $MY_HARDWARE
. We have no idea what hardware you have. For you, that would be -march=skylake-avx512
(SkyLake SP) The results could be reproduced by specifying your hardware architecture explicitly.
It's quite possible that the errors will decrease with more modern instructions, specifically Fused-Multiply-and-Add (FMA). This is the operation a*b+c, but rounded once instead of twice. That saves one rounding error.
QUESTION
A couple of years ago, I wrote and updated our MASM codebase with this macro below to combat Spectre V2.
...ANSWER
Answered 2021-Oct-08 at 07:19Those compiler options work by generating special asm, whether it's retpolines or lfence
or whatever. When you're writing asm by hand, obviously it's still up to you whether to manually include special asm or not.
Changes to OSes are the relevant thing for you. The OS, on a CPU with updated microcode, can defend you from other threads by telling the CPU not to allow branch history from past code to influence future code. (The ability to ask it to do this was added in microcode updates, and usually works by just flushing the branch prediction caches).
Another software thread executing on the other logical core of the same physical core can "attack" your code on most CPUs, because branch predictors are shared. At least in theory; ASLR might make that implausible if both tasks would need to be using the same virtual addresses for their branch targets to prime the predictors.
So in user-space, I think you only need to defend yourself from Spectre if you're worried about code running in the same thread (e.g. a JIT engine running untrusted code inside a browser or JVM has to defend itself) or on the same physical core.
QUESTION
When I boot the system, the kernel log shows:
vim /var/log/kern.log
ANSWER
Answered 2021-Jun-29 at 01:45The __common_interrupt: 10.55 No irq handler for vector
is a firmware issue. Seems you are using AMD CPU I guess? You will want to checkout whether there is a newer version of bios for your motherboard. And update bios should solve this, if not, just wait for it.
And for the mce: [Hardware Error]
, probably is caused by the above error, but if your system is working fine. It means it's been corrected. But still you can do:
QUESTION
I am trying to add a custom memory-mapped component in intel FPGA based soc system. I have connected the custom component(NVDLA) with light-weight axi bridge (HPS to FPGA bridge). Device Tree File.
...ANSWER
Answered 2021-Jun-28 at 08:13This issue was resolved. After running the KMD driver for the NVDLA_IP_0
through the instruction mention in the comments and here by Ian Abbott, the node appeared in /pro/iomem.
QUESTION
I'm using Grafana+Prometheus+node_exporter to monitor Linux servers. Grafana dashboard (1860) is great.
I want to see cpu model on the dashboard. But node exporter does not have a such metric as model name is not a real metric.
The information exists in node_cpu_info metric. (shown below)
But model_name information is located in the "key" part, not at value part, so when i query this metric i got "1" as result.
So my question is: Is it possible to take only "model_name"=.. part from metrics and show it on the dashboard? (Intel(R) Xeon(R) Gold 6152 CPU @ 2.10GHz)
sample metric:
node_cpu_info{cachesize="30976 KB",core="0",cpu="0",family="6",microcode="0x200002c",model="85",model_name="Intel(R) Xeon(R) Gold 6152 CPU @ 2.10GHz",package="0",stepping="4",vendor="GenuineIntel"} 1
ANSWER
Answered 2021-Apr-15 at 15:10You can create a relatively simple table with label values like this one:
Create a new panel, select source, change format from
Time series
toTable
, selectTable
visualisation, and enableinstant
mode:Open
Transform
tab, add two transforms in this order: 1)Labels to fields
, 2)Organize fields
. See the picture:Disable unnecessary fields and rename ones you'd like to see.
QUESTION
The problem that I'm trying to solve is to produce portable output that I can display on all of the servers in our environment to show basic info at login using generic information on all CentOS / Red Hat systems. I would like to pluck info from /proc/cpuinfo
and /proc/meminfo
(or free -m -h
); "why not just 'yum install some-great-tool
'?" is not ideal as all of this information is freely available to us right in /proc
. I know that this sort of thing can often be a very simple trick for sed/awk experts (I don't know how to approach this
with my limited sed/awk knowledge).
I would like to extract something like the following on a single line:
...ANSWER
Answered 2020-Nov-10 at 15:39Using /proc/cpuinfo and free -mh along with awk, search for the strings required, using : as the field delimited, set variables accordingly, splitting the output of free -mh further into an array called arr based on " " as the delimiter. At the end, print the data in the required format using the variables created.
When searching for lines beginning with flag, we search for strings svn or vmx using awk's match function. A match will signified by the RSTART variable not being 0 and so we check this to find the type of virtualisatiion being utilised. As we have set virt to No Virtualisation at the beginning, no matches will print No Virtualisation.
QUESTION
Yesterday we lost contact with 10 identically configured servers, after some investigation the conclusion was that a reboot after security updates had failed.
We have so far not been able to get any of the servers back online, but were lucky enough to be able to reinstall the instances without data loss.
I will paste the console log below, can anyone help me determine the root cause and perhaps give me some advice on if there is a better way to configure the server to make recovery easier (like getting past the "Press Enter to continue." prompt, that it seems to hang in).
The full log is too big for SO, so I put it on pastebin and pasted a redacted version below. I have removed the escape sequences that colorize the output and removed some double new lines, but besides that it is complete.
...ANSWER
Answered 2020-Oct-30 at 11:21Ok, shortly after posting we figured it out. Seems like a mount point has changed (I expect due to a linux kernel update) and we have not used the nofail option in /etc/fstab as described in the aws knowledge center, this caused the server to hang at boot.
Going forward we will also ensure we use UUID mounting so we are independent on the device naming in /dev/.
QUESTION
I saw this question How to cross compile from Mac OS X to Linux x86? but my target looks like this
...ANSWER
Answered 2020-Oct-13 at 20:45your target is a 64bit x86 platform, which is certainly not obscure. the SO question you linked is the best starting point, spin up a VM of the linux distribution you're targeting on your embedded board, compile in that and scp the executable to the board (or just compile on the board itself, your target is not exactly underpowered)
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Microcode
You can use Microcode like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page