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

Re: [Xen-devel] [PATCH for-next 5/7] x86_64: move PV specific code under pv/x86_64



>>> On 21.04.17 at 14:52, <wei.liu2@xxxxxxxxxx> wrote:
> On Fri, Apr 21, 2017 at 03:33:11AM -0600, Jan Beulich wrote:
>> >>> On 06.04.17 at 19:14, <wei.liu2@xxxxxxxxxx> wrote:
>> > -void subarch_percpu_traps_init(void)
>> > -{
>> > -    unsigned long stack_bottom = get_stack_bottom();
>> > -    unsigned long stub_va = this_cpu(stubs.addr);
>> > -    unsigned char *stub_page;
>> > -    unsigned int offset;
>> > -
>> > -    /* IST_MAX IST pages + 1 syscall page + 1 guard page + primary stack. 
>> > */
>> > -    BUILD_BUG_ON((IST_MAX + 2) * PAGE_SIZE + PRIMARY_STACK_SIZE > 
>> > STACK_SIZE);
>> 
>> Even if it's only this one line - this isn't PV-specific, and hence shouldn't
>> be moved. It is also inappropriate for a function with this name to live
>> in PV-specific code.
> 
> I see your point for this BUILD_BUG_ON. But the rest of this function is
> setting up trampoline stub for syscall and sysenter, which, AFAICT, are
> only ever going to be used by PV guests. What did I miss? May be I
> should rename this function?

No, you should keep it for this BUILD_BUG_ON() and then call
the new PV function from here. Or alternatively both could be
moved into the caller (in which case, yes, you should effectively
rename the function).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

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