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

Re: [Xen-devel] [PATCH 9/9] x86: move declaration of arch_set_info_hvm_guest and provide stub



>>> On 16.08.18 at 12:42, <wei.liu2@xxxxxxxxxx> wrote:
> On Tue, Aug 07, 2018 at 05:24:15PM +0100, Wei Liu wrote:
>  > 
>> > All uses sit either in HVM-specific code or inside is_hvm_...()
>> > conditionals: Why do we need the inline stub? If the declaration
>> > was visible independent of CONFIG_HVM, code would compile
>> > fine, and references to the function would be removed by the
>> > compiler, so linking would also succeed despite there not being
>> > any definition of the function.
>> 
>> Last time I tried DCE wasn't working so well. Let me try again and if
>> DCE works it would save me a lot of effort to provide stubs.
>> 
> 
> DCE seems to work better this time.
> 
> The only problem is that some ASSERTs will need to turn into panic or
> BUG() if we want to fully utilise DCE. Is that okay?

In general yes, I think so.

> To give you an example, after making is_hvm_domain evaluate to 0 when
> !CONFIG_HVM, vm_event_fill_regs + !CONFIG_HVM compiles fine for debug
> build because ASSERT hints the compiler that the rest of the function is
> never going to be reachable. But for non-debug build, ASSERT is empty,
> so compiler will not eliminate the rest of the function, complaining
> hvm_get_segment_register is not available. It is solvable by adding
> panic or BUG.
> 
> There is going to be quite a few cases like that. I haven't gone through
> all of them.

In cases like the example you give I'm not convinced of the
suggested conversion though - the entire function should then
live inside CONFIG_HVM (or in a file built for HVM only).

Jan



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

 


Rackspace

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