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

Re: Build warnings in Xen 5.15.y and 5.10.y with retbleed backports


  • To: Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx>
  • From: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
  • Date: Tue, 12 Jul 2022 16:22:41 -0400
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=NJwkzDuOXR0dqbj5lwa/yTDUgZF+ahp8tDICCrXCnH4=; b=klWw+xw4rZhL/oT9iMZf98/R4zIO7IGRccCytgD449CidMH0VKfIAiZXx73uf6iHGoftqhjLCuZIH1yBc0y6NNwPPsVg0brO65gaOZ0UGshp8PHuHJUsADqeFeRO+GRFZKGxvZ4IZZ1NebCneofWGfF7krgVOJzRXNn4D/gX4UeDRHTJud3wKt/wCSqQyVrjS4ElvlXq4+EmV581KY9mV4aJyobkXEFqLJ10eiJnrb4DjTFpWjyjZRxq4GCSgQCymQgHtrjNh0xJpFE74YMtPl8f06swSMJHl3cgut+9f7PCTRWjqbAMdQGJE+nm8EVsTDmcFRhTGLGe2XGhmpaxfw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Vmd5jYL4QWpEttAyeK3G5py7CsLFjZb0ZNbO536mo3ceUCWLtwgqtc7CbrapG/AK499oQf866A6UIXt9jDSdtnhFIg16Nl6phPs/iXtKkEUJ4IK9Fcto3WxJh554VVik34oiW5vbEE+jkhcCF/ZOTZE/j6hEBj4mCljKhL2fT5tPfyjgbhFtdS14Irj48+k+RSkL+pJblHabSLsw9s7S0JSPHLjIs7OV/yLBF1IYg9BQGfeZwGsjkb37Z9sGmn8o2kaZAhpLGp22nLzUffRsVSVEidiDiBeCuhsiATSpu/NVa8Q9Adlb45FoGJp+SkYUwfH+sAC762O++J/yO0lO5Q==
  • Cc: Juergen Gross <jgross@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, Borislav Petkov <bp@xxxxxxxxx>, Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>, x86@xxxxxxxxxx, "H. Peter Anvin" <hpa@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, jpoimboe@xxxxxxxxxx
  • Delivery-date: Tue, 12 Jul 2022 20:24:16 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>



On 7/12/22 3:31 PM, Greg KH wrote:
On Tue, Jul 12, 2022 at 03:19:39PM -0400, Boris Ostrovsky wrote:

On 7/12/22 12:38 PM, Greg KH wrote:
Hi all,

I'm seeing the following build warning:
        arch/x86/kernel/head_64.o: warning: objtool: 
xen_hypercall_mmu_update(): can't find starting instruction
in the 5.15.y and 5.10.y retbleed backports.

I don't know why just this one hypercall is being called out by objtool,
and this warning isn't in 5.18 and Linus's tree due to I think commit
5b2fc51576ef ("x86/ibt,xen: Sprinkle the ENDBR") being there.

But, is this a ret call that we "forgot" here?  It's a "real" ret in
Linus's branch:

.pushsection .noinstr.text, "ax"
        .balign PAGE_SIZE
SYM_CODE_START(hypercall_page)
        .rept (PAGE_SIZE / 32)
                UNWIND_HINT_FUNC
                ANNOTATE_NOENDBR
                ANNOTATE_UNRET_SAFE
                ret
                /*
                 * Xen will write the hypercall page, and sort out ENDBR.
                 */
                .skip 31, 0xcc
        .endr

while 5.15.y and older has:
.pushsection .text
        .balign PAGE_SIZE
SYM_CODE_START(hypercall_page)
        .rept (PAGE_SIZE / 32)
                UNWIND_HINT_FUNC
                .skip 31, 0x90
                ANNOTATE_UNRET_SAFE
                RET
        .endr

So should the "ret" remain or be turned into "RET" in mainline right
now?


It doesn't matter --- this is overwritten by the hypervisor during 
initialization when Xen fills in actual hypercall code.


So f4b4bc10b0b85ec66f1a9bf5dddf475e6695b6d2 added 'ret' to make objtool happy 
and then 14b476e07fab6 replaced 'ret' with RET as part of SLS fixes. The latter 
was not really necessary but harmless.


So it can be 'ret', RET, or anything else that tools don't complain about. It 
will not be executed.

Cool, thanks.

But what about the objtool warning that I now see?  Is that "real"?



It's not real in the sense that the code there is not real, it will be 
overwritten. (Originally the whole page was 'nop's)


I am getting a different error BTW:

        arch/x86/kernel/head_64.o: warning: objtool: .text+0x5: unreachable 
instruction





I don't run any Xen systems, so I can't test any of this myself.


You can't test any changes to that code --- it is rewritten when Xen guest is 
running.


We probably do want to shut up objtool. Josh, any suggestions?


-boris



 


Rackspace

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