interrupt

qemu kvm: how to get permformance monitoring interrupt?

北慕城南 提交于 2020-01-14 14:16:32
问题 I write some function in my OS kernel to issue the performance monitoring interrupt (PMI) on instructions counter overflow. It works well on my machine (Intel core i5). But when I run it on qemu using qemu-system-x86_64 -enable-kvm -cpu host -m 256 -serial mon:stdio -cdrom var/run/hypervisor.iso the interrupt does never fire. Is there anything I am missing? Does it require any special configuration to get the PMI fired on qemu? I recall that instruction counting works well in qemu. msr

Can breakpoints be used in ISRs?

风格不统一 提交于 2020-01-14 10:28:07
问题 Can breakpoints be used in interrupt service routines (ISRs)? 回答1: Yes - in an emulator . Otherwise, no. It's difficult to pull off, and a bad idea in any case. ISRs are (usually) supposed to work with the hardware, and hardware can easily behave very differently when you leave a gap of half a second between each instruction. Set up some sort of logging system instead. ISRs also ungracefully "steal" the CPU from other processes, so many operating systems recommend keeping your ISRs extremely

What's the difference between Software-Generated Interrupt and Software-Generated Exception?

雨燕双飞 提交于 2020-01-14 04:23:52
问题 I am reading the Intel Manual 3A Chapter 6 Interrupt and Exception Handling. Interrupt and Exception have 3 sources respectively. For Software-Generated Interrupt, it says: The INT n instruction permits interrupts to be generated from within software by supplying an interrupt vector number as an operand. For example, the INT 35 instruction forces an implicit call to the interrupt handler for interrupt 35. Any of the interrupt vectors from 0 to 255 can be used as a parameter in this

Real time linux : disable local timer interrupts

故事扮演 提交于 2020-01-12 08:13:13
问题 TL;DR : Using linux kernel real time with NO_HZ_FULL I need to isolate a process in order to have deterministic results but /proc/interrupts tell me there is still local timer interrupts (among other). How to disable it? Long version : I want to make sure my program is not being interrupt so I try to use a real time linux kernel. I'm using the real time version of arch linux (linux-rt on AUR) and I modified the configuration of the kernel to selection the following options : CONFIG_NO_HZ_FULL

Real time linux : disable local timer interrupts

给你一囗甜甜゛ 提交于 2020-01-12 08:13:09
问题 TL;DR : Using linux kernel real time with NO_HZ_FULL I need to isolate a process in order to have deterministic results but /proc/interrupts tell me there is still local timer interrupts (among other). How to disable it? Long version : I want to make sure my program is not being interrupt so I try to use a real time linux kernel. I'm using the real time version of arch linux (linux-rt on AUR) and I modified the configuration of the kernel to selection the following options : CONFIG_NO_HZ_FULL

Simple interrupt handler: request_irq returns error code -22

这一生的挚爱 提交于 2020-01-12 05:03:06
问题 I am writing a simple kernel module, which could register an interrupt and handle it. However, when I try to register interrupt by calling the request_irq function, it returns error code -22 : ERROR: Cannot request IRQ 30 - code -22 , EIO 5 , EINVAL 22 I believe, this error code is equal to EINVAL (invalid argument) Please tell me, what I am doing wrong. Here is a module: #include <linux/init.h> #include <linux/module.h> #include <linux/irq.h> #include <linux/io.h> #include <linux/irqdomain.h

How to allow Web Workers to receive new data while it still performing computation?

妖精的绣舞 提交于 2020-01-11 10:44:29
问题 I want to sort an array, using Web Workers. But this array might receive new values over time, while the worker is still performing the sort function. So my question is, how can I "stop" the sorting computation on the worker after receiving the new item, so it can perform the sort on the array with that item, while still keeping the sorting that was already made? Example: let worker = new Worker('worker.js'); let list = [10,1,5,2,14,3]; worker.postMessage({ list }); setInterval(() => worker

How to allow Web Workers to receive new data while it still performing computation?

人走茶凉 提交于 2020-01-11 10:44:07
问题 I want to sort an array, using Web Workers. But this array might receive new values over time, while the worker is still performing the sort function. So my question is, how can I "stop" the sorting computation on the worker after receiving the new item, so it can perform the sort on the array with that item, while still keeping the sorting that was already made? Example: let worker = new Worker('worker.js'); let list = [10,1,5,2,14,3]; worker.postMessage({ list }); setInterval(() => worker

Why can't Thread.interrupt() interrupt a thread trying to acquire lock

断了今生、忘了曾经 提交于 2020-01-11 09:05:33
问题 In the book Thinking in Java it is written that Thread.interrupt() cannot interrupt a thread which is trying to acquire a synchronized lock, I want to know why? 回答1: A blocking operation can be interrupted only if it is declared to throw InterruptedException . Clearly, a synchronized block does not declare it, therefore it is impossible to interrupt a thread while it is waiting to acquire a lock. Alternatively you can use an explicit lock and call Lock.lockInterruptibly() . 回答2: The book is

Why can't Thread.interrupt() interrupt a thread trying to acquire lock

谁都会走 提交于 2020-01-11 09:04:34
问题 In the book Thinking in Java it is written that Thread.interrupt() cannot interrupt a thread which is trying to acquire a synchronized lock, I want to know why? 回答1: A blocking operation can be interrupted only if it is declared to throw InterruptedException . Clearly, a synchronized block does not declare it, therefore it is impossible to interrupt a thread while it is waiting to acquire a lock. Alternatively you can use an explicit lock and call Lock.lockInterruptibly() . 回答2: The book is