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.

> +static inline uint64_t hv_do_hypercall(uint64_t control, paddr_t input_addr,
> +                                       paddr_t output_addr)
> +{
> +    uint64_t status;
> +    register unsigned long r8 asm("r8") = output_addr;

I guess strictly speaking this wants to be asm ( "r8" ),
albeit I now realize that I've similarly not played by style
in alternative_callN(). In the end I guess - either way.

> +    asm volatile ( "call hv_hcall_page"
> +                   : "=a" (status), "+c" (control),
> +                     "+d" (input_addr) ASM_CALL_CONSTRAINT
> +                   : "r" (r8)

Why "+c" and "+d" but just "r"? If r8 gets treated differently
from rcx and rdx, please attach a brief comment.

Jan

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

Reply via email to