Re: [PATCH v2 0/5] Export offsets of VMCS fields as note informationfor kdump

From: Eric Northup
Date: Tue May 22 2012 - 16:53:44 EST


On Mon, May 21, 2012 at 8:53 PM, Yanfei Zhang
<zhangyanfei@xxxxxxxxxxxxxx> wrote:
> 于 2012年05月22日 02:58, Eric Northup 写道:
[...]
>> So you can have the VMCS offset dumping be a manually-loaded module.
>> Build a database mapping from (CPUID, microcode revision) -> (VMCSINFO).
>> There's no need for anything beyond the (CPUID, microcode revision) to
>> be put in the kdump, since your offline processing of a kdump can then
>> look up the rest.
[...]
>
> We have considered this way, but there are two issues:
> 1) vmx resource is unique for a single cpu, and it's risky to grab it forcibly
> on the environment where kvm module is used, in particular on customer's environment.
> To do this safely, kvm support is needed.

It's not risky: you just have to make sure that no one else is going
to use the VMCS on your CPU while you're running. You can disable
preemption and then save the old VMCS pointer from the CPU (see the
VMPTRST instructions). Load your temporary VMCS pointer, discover
the fields, then restore the original VMCS pointer. Then re-enable
preemption and you're done.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/