Re: [PATCH v7 10/21] RISC-V: KVM: Handle MMIO exits for VCPU

2019-10-08 Thread Anup Patel
s (if I did the RVC math right) in order to save two. :) > > > > Paolo > > > >> +"li %[tscause], 0\n" > >> +#ifdef CONFIG_64BIT > >> +"ld %[val], (%[addr])\n" > >> +#else > >> +

Re: [PATCH v7 10/21] RISC-V: KVM: Handle MMIO exits for VCPU

2019-10-08 Thread Palmer Dabbelt
Anup Patel CC: Paul Walmsley CC: rkrc...@redhat.com CC: daniel.lezc...@linaro.org CC: t...@linutronix.de CC: g...@amazon.com CC: Atish Patra CC: Alistair Francis CC: Damien Le Moal CC: Christoph Hellwig CC:

Re: [PATCH v7 10/21] RISC-V: KVM: Handle MMIO exits for VCPU

2019-09-23 Thread Anup Patel
On Mon, Sep 23, 2019 at 7:03 PM Paolo Bonzini wrote: > > On 23/09/19 15:09, Anup Patel wrote: > >>> +#ifndef CONFIG_RISCV_ISA_C > >>> + "li %[tilen], 4\n" > >>> +#else > >>> + "li %[tilen], 2\n" > >>> +#endif > >> > >> Can you use an assembler directive to

Re: [PATCH v7 10/21] RISC-V: KVM: Handle MMIO exits for VCPU

2019-09-23 Thread Paolo Bonzini
On 23/09/19 15:09, Anup Patel wrote: >>> +#ifndef CONFIG_RISCV_ISA_C >>> + "li %[tilen], 4\n" >>> +#else >>> + "li %[tilen], 2\n" >>> +#endif >> >> Can you use an assembler directive to force using a non-compressed >> format for ld and lw? This would get

Re: [PATCH v7 10/21] RISC-V: KVM: Handle MMIO exits for VCPU

2019-09-23 Thread Anup Patel
On Mon, Sep 23, 2019 at 4:42 PM Paolo Bonzini wrote: > > On 04/09/19 18:15, Anup Patel wrote: > > + unsigned long guest_sstatus = > > + vcpu->arch.guest_context.sstatus | SR_MXR; > > + unsigned long guest_hstatus = > > +

Re: [PATCH v7 10/21] RISC-V: KVM: Handle MMIO exits for VCPU

2019-09-23 Thread Paolo Bonzini
On 04/09/19 18:15, Anup Patel wrote: > + unsigned long guest_sstatus = > + vcpu->arch.guest_context.sstatus | SR_MXR; > + unsigned long guest_hstatus = > + vcpu->arch.guest_context.hstatus | HSTATUS_SPRV; > + unsigned long guest_vsstatus,

Re: [PATCH v7 10/21] RISC-V: KVM: Handle MMIO exits for VCPU

2019-09-23 Thread Alexander Graf
On 04.09.19 18:15, Anup Patel wrote: We will get stage2 page faults whenever Guest/VM access SW emulated MMIO device or unmapped Guest RAM. This patch implements MMIO read/write emulation by extracting MMIO details from the trapped load/store instruction and forwarding the MMIO read/write to

[PATCH v7 10/21] RISC-V: KVM: Handle MMIO exits for VCPU

2019-09-04 Thread Anup Patel
We will get stage2 page faults whenever Guest/VM access SW emulated MMIO device or unmapped Guest RAM. This patch implements MMIO read/write emulation by extracting MMIO details from the trapped load/store instruction and forwarding the MMIO read/write to user-space. The actual MMIO emulation