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

Re: [Xen-devel] [PATCH v2 2/5] x86/domain: Initialise vcpu debug registers correctly

>>> On 26.10.18 at 17:58, <andrew.cooper3@xxxxxxxxxx> wrote:
> On 26/10/2018 16:01, Jan Beulich wrote:
>>>>> On 26.10.18 at 16:51, <andrew.cooper3@xxxxxxxxxx> wrote:
>>> On 26/10/2018 15:37, Jan Beulich wrote:
>>>>>>> On 26.10.18 at 16:22, <andrew.cooper3@xxxxxxxxxx> wrote:
>>>>> On 26/10/2018 14:31, Jan Beulich wrote:
>>>>>>>>> On 15.10.18 at 12:36, <andrew.cooper3@xxxxxxxxxx> wrote:
>>>>>>> --- a/xen/arch/x86/domain.c
>>>>>>> +++ b/xen/arch/x86/domain.c
>>>>>>> @@ -323,6 +323,18 @@ void free_vcpu_struct(struct vcpu *v)
>>>>>>>      free_xenheap_page(v);
>>>>>>>  }
>>>>>>> +/* Initialise various registers to their architectural INIT/RESET 
>>>>>>> state. */
>>>>>>> +void arch_vcpu_regs_init(struct vcpu *v)
>>>>>>> +{
>>>>>>> +    v->arch.user_regs = (typeof(v->arch.user_regs)){
>>>>>>> +        .rflags = X86_EFLAGS_MBS,
>>>>>>> +    };
>>>>>> Sadly this initializer broke the build once again for gcc 4.3.x.
>>>>> Oh - that's unfortunate.  I guess it will need a memset instead.
>>>> Or we finally need to bump the minimum version we're happy with.
>>>>>> (As a side note, using .eflags instead of .rflags would have a
>>>>>> fair chance of an omitted REX prefix.)
>>>>> You specifically requested rflags over eflags in your previous review.
>>>> Did I? I haven't been able to find v1 of this patch at all in the archives
>>>> (going back to May), or in my inbox (using just part of the title for
>>>> searching). Was that posted in private, or under a different title? I'm
>>>> trying to figure why I would have asked for that...
>>> <5B17E80A02000078001C8C1D@xxxxxxxxxxxxxxxxxxxxxxxx>
>> Hmm, yes, except that my mail client doesn't allow me to search for
>> mail IDs, or at least I don't know how I would do that. You don't
>> happen to have title, time stamp, or mail archive ref?
> "Re: [PATCH 03/11] x86: Initialise debug registers correctly", sent
> 06/06/2018, 14:56

Ah, thanks, now I see. In that earlier patch the context did not
have (in hvm_vcpu_reset_state()) both lines

    memset(&v->arch.user_regs, 0, sizeof(v->arch.user_regs));
    v->arch.user_regs.rflags = X86_EFLAGS_MBS;

and hence I was assuming that the clearing of the high half here
was necessary. (I should have looked at the source instead of
just going from patch context, I admit.) With the memset(), the
use or .rflags was clearly not necessary (and isn't in this new
version of the patch). Anyway - I'd prefer if you used .eflags,
but I'm not going to make this a requirement.


Xen-devel mailing list



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