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

Re: [PATCH] x86/shim: fix build when !PV32


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Fri, 7 May 2021 11:08:20 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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-SenderADCheck; bh=9IkQx80Hb3xVr4x6PYdH59pgvItJyMAQ6I1uyU1oXWE=; b=jaXSaOaE4nwvoBqhOE9eOTnM1Emb5ZcM5gClexhxwA8FSZOW+Qixou7NBjJdGxuSsFu/Cco6b0M6va9bASYFdneX1tZjofDVybJ8shvEDfKqh9EeoePWRcmMkJKsnGigBi8k39aDIBzv67HGecgsHGHmQdGXmMm3VEmIrHJC9tfQrJKmjBk+Gy3pJr1gHgumdM/GvON8e7cOndRK8LlWLMh0AEo7mcD7zJqra6utWlsJh0GfkMq6SQuCHrS/ziNbfKv4n+EhnlRgVZWeHE2dmgZi9na3giafL4mRM+XzhqlfSxWJQjOJxX5KgaRlfgBPClNUxSK76c1K5iFzr1MtlQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JGwjTfrO8bP7NCr+E1tLDO8BODvEadnXZWI9+4YJMBEI/ShlX1RwsLiyNfY6CS28hK7SMYq/rLHvb09g/tEFt6OKI5pBwWsCAsrMInyYpRfqxrF/CIagczcO2bfSTKvqhfSOjwI/n70kkjMTrLq5IEzNeaq0cFIW4zHZ4fv2eXojWl2NUzsyq8JrA4HUri+ZYdal1AxzybLI3faf2Ix7iSzsNzCaP9gL9vRmee9txeh/wd2UVc/K2qEwPZXTFD/MpVDWoIiz6Zn4i1UuJJmVLVBzVTSl7g21bqDcDJFGz1Jp3Cqjn6AtNJrC1rYRC4gUweY94zLwzMbD+f9k45le0Q==
  • Authentication-results: esa5.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "Andrew Cooper" <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Fri, 07 May 2021 09:08:46 +0000
  • Ironport-hdrordr: A9a23:B8XrsqmNv7C/+p1XTry10WUC4hTpDfL13DAbv31ZSRFFG/Fw9v re4cjzsCWetN9/YhAdcK+7Sc+9qB/nmaKdorNhRItKJTOWw1dAdbsSl7cKoAeQZxEWlNQ86U 4IScEXYuEYa2IUsS+Q2mSF+rgbruVujciT9J/jJqNWPGNXg90J1XYfNu/iKDwUeOCwP+tcKH M03Lsjmwad
  • Ironport-sdr: Ma3UhxK+KIQIHakJOlsbwloHL47bz6TyWzK4sKrBe/JglDOadCuoGNg72lK3+xFt2CMb74BqGk Qe962F80Ed02RD139JswH4Kqs8v8mHfehWIRC8Do1c2ut12qGZQtxkke+GRM4Vg//FsTRnxD94 sHLJhxx3EFpTCf6hpntjwWlUeGS5LdJUTirnzfIsboF3K86MAmG/XVSX9RFBE2COvmtnD0NxAx QwxjWRZTx6pNE2eBfAjcE3DwBIM7rm27mE1zhCRKhHd3ng04o6HlosfaveqtyIzCkAqYWOeqRg YLI=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Fri, May 07, 2021 at 10:34:24AM +0200, Jan Beulich wrote:
> On 07.05.2021 10:21, Roger Pau Monné wrote:
> > On Fri, May 07, 2021 at 08:22:38AM +0200, Jan Beulich wrote:
> >> In this case compat headers don't get generated (and aren't needed).
> >> The changes made by 527922008bce ("x86: slim down hypercall handling
> >> when !PV32") also weren't quite sufficient for this case.
> >>
> >> Try to limit #ifdef-ary by introducing two "fallback" #define-s.
> >>
> >> Fixes: d23d792478db ("x86: avoid building COMPAT code when !HVM && !PV32")
> >> Reported-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> >> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> >>
> >> --- a/xen/arch/x86/pv/shim.c
> >> +++ b/xen/arch/x86/pv/shim.c
> >> @@ -34,8 +34,6 @@
> >>  #include <public/arch-x86/cpuid.h>
> >>  #include <public/hvm/params.h>
> >>  
> >> -#include <compat/grant_table.h>
> >> -
> >>  #undef virt_to_mfn
> >>  #define virt_to_mfn(va) _mfn(__virt_to_mfn(va))
> >>  
> >> @@ -300,8 +298,10 @@ static void write_start_info(struct doma
> >>                                            &si->console.domU.mfn) )
> >>          BUG();
> >>  
> >> +#ifdef CONFIG_PV32
> >>      if ( compat )
> >>          xlat_start_info(si, XLAT_start_info_console_domU);
> >> +#endif
> > 
> > Would it help the compiler logic if the 'compat' local variable was
> > made const?
> 
> No, because XLAT_start_info_console_domU is undeclared when there are
> no compat headers.
> 
> > I'm wondering if there's a way we can force DCE from the compiler and
> > avoid the ifdefs around the usage of compat.
> 
> The issue isn't with DCE - I believe the compiler does okay in that
> regard. The issue is with things simply lacking a declaration /
> definition. That's no different from e.g. struct fields living
> inside an #ifdef - all uses then need to as well, no matter whether
> the compiler is capable of otherwise recognizing the code as dead.

Right, I see those are no longer declared anywhere. Since this is
gating compat code, would it make more sense to use CONFIG_COMPAT
rather than CONFIG_PV32 here?

Thanks, Roger.



 


Rackspace

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