search for: lhcall_timer_read

Displaying 10 results from an estimated 10 matches for "lhcall_timer_read".

2007 May 09
2
[PATCH 0/2 v05] lguest: TSC & hrtimers
The following patches are the latest update of the TSC and hrtimer patches I posted on 29/03. Rusty's original TSC patch has been resynced to the latest lguest repo, as has the hrtimer patch, which also incorporates feedback from Jeremy & Rusty: - Change clock event hrtimer to absolute time. 'now' is captured in the host during the hypercall. - Propagate -ETIME back to the
2007 May 09
2
[PATCH 0/2 v05] lguest: TSC & hrtimers
The following patches are the latest update of the TSC and hrtimer patches I posted on 29/03. Rusty's original TSC patch has been resynced to the latest lguest repo, as has the hrtimer patch, which also incorporates feedback from Jeremy & Rusty: - Change clock event hrtimer to absolute time. 'now' is captured in the host during the hypercall. - Propagate -ETIME back to the
2007 May 09
1
[patch 2/9] lguest: the guest code
...&lguest_irq_controller, + handle_level_irq); + } + } + irq_ctx_init(smp_processor_id()); +} + +static unsigned long lguest_get_wallclock(void) +{ + return hcall(LHCALL_GET_WALLCLOCK, 0, 0, 0); +} + +static void lguest_time_irq(unsigned int irq, struct irq_desc *desc) +{ + do_timer(hcall(LHCALL_TIMER_READ, 0, 0, 0)); + update_process_times(user_mode_vm(get_irq_regs())); +} + +static void lguest_time_init(void) +{ + set_irq_handler(0, lguest_time_irq); + hcall(LHCALL_TIMER_READ, 0, 0, 0); + enable_lguest_irq(0); +} + +static void lguest_load_esp0(struct tss_struct *tss, + struct thread_struct...
2007 May 09
1
[patch 2/9] lguest: the guest code
...&lguest_irq_controller, + handle_level_irq); + } + } + irq_ctx_init(smp_processor_id()); +} + +static unsigned long lguest_get_wallclock(void) +{ + return hcall(LHCALL_GET_WALLCLOCK, 0, 0, 0); +} + +static void lguest_time_irq(unsigned int irq, struct irq_desc *desc) +{ + do_timer(hcall(LHCALL_TIMER_READ, 0, 0, 0)); + update_process_times(user_mode_vm(get_irq_regs())); +} + +static void lguest_time_init(void) +{ + set_irq_handler(0, lguest_time_irq); + hcall(LHCALL_TIMER_READ, 0, 0, 0); + enable_lguest_irq(0); +} + +static void lguest_load_esp0(struct tss_struct *tss, + struct thread_struct...
2007 Apr 18
1
[PATCH 0/8] lguest
As promised to Andrew, and with much thanks to Andi Kleen for feedback, this is the new series of lguest patches. Main change is the move to drivers/lguest (for future non-i386 expansion), but lots of cleanups driven by Andi's feedback and the documentation effort (which made me examine every line of code). It's not perfect, but it's definitely useful. Cheers, Rusty. List of
2007 Apr 18
1
[PATCH 0/8] lguest
As promised to Andrew, and with much thanks to Andi Kleen for feedback, this is the new series of lguest patches. Main change is the move to drivers/lguest (for future non-i386 expansion), but lots of cleanups driven by Andi's feedback and the documentation effort (which made me examine every line of code). It's not perfect, but it's definitely useful. Cheers, Rusty. List of
2007 Apr 18
1
[RFC/PATCH LGUEST X86_64 03/13] lguest64 core
...trying to do??"); + } + lhread(linfo, &g, regs->rbx, sizeof(g)); + load_guest_idt_entry(vcpu, regs->rdx,&g); + break; + } + case LHCALL_SET_STACK: + guest_set_stack(vcpu, regs->rdx, regs->rbx); + break; + case LHCALL_TS: + vcpu->ts = regs->rdx; + break; + case LHCALL_TIMER_READ: { + u32 now = jiffies; + mb(); + regs->rax = now - linfo->last_timer; + linfo->last_timer = now; + break; + } + case LHCALL_TIMER_START: + linfo->timer_on = 1; + if (regs->rdx != HZ) + kill_guest(linfo, "Bad clock speed %lli", regs->rdx); + linfo->last_time...
2007 Apr 18
1
[RFC/PATCH LGUEST X86_64 03/13] lguest64 core
...trying to do??"); + } + lhread(linfo, &g, regs->rbx, sizeof(g)); + load_guest_idt_entry(vcpu, regs->rdx,&g); + break; + } + case LHCALL_SET_STACK: + guest_set_stack(vcpu, regs->rdx, regs->rbx); + break; + case LHCALL_TS: + vcpu->ts = regs->rdx; + break; + case LHCALL_TIMER_READ: { + u32 now = jiffies; + mb(); + regs->rax = now - linfo->last_timer; + linfo->last_timer = now; + break; + } + case LHCALL_TIMER_START: + linfo->timer_on = 1; + if (regs->rdx != HZ) + kill_guest(linfo, "Bad clock speed %lli", regs->rdx); + linfo->last_time...
2007 May 09
1
[patch 3/9] lguest: the host code
...r msg[128]; + lgread(lg, msg, regs->edx, sizeof(msg)); + msg[sizeof(msg)-1] = '\0'; + kill_guest(lg, "CRASH: %s", msg); + break; + } + case LHCALL_FLUSH_TLB: + if (regs->edx) + guest_pagetable_clear_all(lg); + else + guest_pagetable_flush_user(lg); + break; + case LHCALL_TIMER_READ: { + u32 now = jiffies; + mb(); + regs->eax = now - lg->last_timer; + lg->last_timer = now; + break; + } + case LHCALL_GET_WALLCLOCK: { + struct timespec ts; + ktime_get_real_ts(&ts); + regs->eax = ts.tv_sec; + break; + } + case LHCALL_BIND_DMA: + regs->eax = bind_dma(l...
2007 May 09
1
[patch 3/9] lguest: the host code
...r msg[128]; + lgread(lg, msg, regs->edx, sizeof(msg)); + msg[sizeof(msg)-1] = '\0'; + kill_guest(lg, "CRASH: %s", msg); + break; + } + case LHCALL_FLUSH_TLB: + if (regs->edx) + guest_pagetable_clear_all(lg); + else + guest_pagetable_flush_user(lg); + break; + case LHCALL_TIMER_READ: { + u32 now = jiffies; + mb(); + regs->eax = now - lg->last_timer; + lg->last_timer = now; + break; + } + case LHCALL_GET_WALLCLOCK: { + struct timespec ts; + ktime_get_real_ts(&ts); + regs->eax = ts.tv_sec; + break; + } + case LHCALL_BIND_DMA: + regs->eax = bind_dma(l...