From: cs5070214 Date: Tue, 29 May 2012 14:54:16 +0000 Subject: Mapping magic page from host side Message-Id: <4f06aa27ebc6f274f2b49d9c39e01e51@iitd.ac.in> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: kvm-ppc@vger.kernel.org Hi, We are trying to do the patching of the privileged instructions of guest from host side (instead of guest kernel patching itself). For this we first need to map the magic page which is currently being done via hypercall from guest. We tried a few approaches. When we map the magic page in the emulation code for the first exit due to MTMSR, it works and guest boots fine. But if we try to map the page on the first exit due to any privileged exits, the guest does not boot and it gives an error. ======================================Oops: Kernel access of bad area, sig: 11 [#1] SMP NR_CPUS=8 P2020 RDB Modules linked in: NIP: c005811c LR: c0052284 CTR: c02e59cc REGS: d81dd9b0 TRAP: 0300 Not tainted (3.0.0-rc4-g832abe3-dirty) MSR: 00029200 CR: 22000024 XER: 20000000 DEAR: e11cec14, ESR: 00000000 TASK = dc902a00[1267] 'qemu-system-ppc' THREAD: d81dc000 CPU: 0 GPR00: e104a7d0 d81dda60 dc902a00 d8090000 e11cec10 c0510000 c02e68f8 277420 GPR08: c06f5290 d80cfffc c0720558 d81dda70 82000024 00000000 d8090000 000000 GPR16: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 000000 GPR24: 00000000 00000000 c0720000 c0510000 d99c0000 d8090000 0000f000 d81dda NIP [c005811c] kvmppc_mmu_xlate+0x40/0xc4 LR [c0052284] kvmppc_read_guest+0x48/0xb0 ====================================== My question is are there any prerequisites that needs to be satisfied before we map the magic page and what would be the proper place to do it? Thanks and Regards, Dushyant Bansal