[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v2 10/16] x86/PV: split out dealing with CRn from privileged instruction handling



>>> On 29.09.16 at 22:01, <andrew.cooper3@xxxxxxxxxx> wrote:
> On 28/09/16 09:14, Jan Beulich wrote:
>> +static int priv_op_read_cr(unsigned int reg, unsigned long *val,
>> +                           struct x86_emulate_ctxt *ctxt)
>> +{
>> +    const struct vcpu *curr = current;
>> +
>> +    switch ( reg )
>> +    {
>> +    case 0: /* Read CR0 */
>> +        *val = (read_cr0() & ~X86_CR0_TS) | curr->arch.pv_vcpu.ctrlreg[0];
>> +        return X86EMUL_OKAY;
>> +
>> +    case 2: /* Read CR2 */
>> +    case 4: /* Read CR4 */
>> +        *val = curr->arch.pv_vcpu.ctrlreg[reg];
>> +        return X86EMUL_OKAY;
>> +
>> +    case 3: /* Read CR3 */
>> +    {
>> +        const struct domain *currd = curr->domain;
>> +        unsigned long mfn;
> 
> Any chance of switching this to mfn_t while you are moving it?

To be honest, I'd rather not - there's no single place where the
typed variant would already be needed, so all variable references
would become cluttered.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.