[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 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?

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.

Let me know your opinion.

Wei.

_______________________________________________
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®.