On Fri, Jan 31, 2020 at 05:18:14PM +0100, Jan Beulich wrote:
> On 31.01.2020 17:15, Wei Liu wrote:
> > On Fri, Jan 31, 2020 at 04:35:23PM +0100, Jan Beulich wrote:
> >> On 31.01.2020 15:37, Wei Liu wrote:
> >>> On Fri, Jan 31, 2020 at 03:24:07PM +0100, Jan Beulich wrote:
> >>>> On 29.01.2020 21:20, Wei Liu wrote:
> >>>>> I tried using the asm(".equ ..") trick but hit a problem with %c again.
> >>>>>
> >>>>> mm.c:5736:5: error: invalid 'asm': operand is not a condition code, 
> >>>>> invalid operand code 'c'
> >>>>>                asm ( ".equ HV_HCALL_PAGE, %c0; .global HV_HCALL_PAGE"
> >>>>
> >>>> Would you mind also indicating what the input operand actually
> >>>> was? According to my looking at gcc sources when you first
> >>>> mentioned this (on irc iirc), much depends on it actually be
> >>>> recognizable as a constant by the compiler.
> >>>
> >>> Something along the line:
> >>>
> >>>   asm ( ".equ HV_HCALL_PAGE, %c0; .global HV_HCALL_PAGE"
> >>>        :: "i" (__fix_x_to_virt(FIX_X_HV...))
> >>
> >> Quite a bit of playing later, %P0 is documented, supported
> >> already in gcc 4.1.x, and also used in a few cases by Linux.
> >> %p0 would be another documented alternative, but support for
> >> this looks to have been introduced later. Not being able to use
> >> %c0 here still smells like a bug (and I guess I'll enter one.)
> > 
> > OK. Let me try that.
> > 
> > If that turns out successful, do you want me to change the other
> > instance to %P0 too?
> 
> That was a pretty small value, wasn't it? I guess it might be safer
> to switch to %P (and then perhaps also elsewhere in the code base).

Yes. That value is 0x2000 at the moment.

> But during my playing with it I also noticed there's a signedness
> bug (affecting all possible modifiers), so we need to watch out for
> results being right in any event.

Using %P0 works just fine for that instance, the generated value looks
correct, so I will use it.

Wei.

> 
> Jan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reply via email to