Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1212810pxb; Tue, 17 Aug 2021 06:33:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwaVoH+PXLe7cclT6rseYMQSE7kpXzEcg62OFD6FFqj6dWG9Zuqi0edCYw1EbkOj2GRbD13 X-Received: by 2002:a05:6402:31ae:: with SMTP id dj14mr4195301edb.94.1629207229797; Tue, 17 Aug 2021 06:33:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629207229; cv=none; d=google.com; s=arc-20160816; b=zZ91lqlMBDyqz0e2Zqe+6Q0HLfe5NG8VwJ/MnvWVJrZttJivgqHpR7O3wWu0lai26f yBFOdHVDlPp76hHJf7mGML1hCX40xHmDYyEYiMQQ8X3rarDF+JJs33TLepYujkWKl0Bt isyT6CT7VliUjiJlkMo/YjI2aqaoUzQxu+ZSp07eeZua/nNMqgFippibCwu56lQu8gdU T9ZUpU7OaOH+92Vo5Etc0wxb7eDGrpxgq1zo04LzlXCQcpa36rtHp/oBVDkfxdVq+DE9 3+6mZzQWQLo9aBRIuB8VD0DPRJGlPvP8IiB5jmQByO4eGtPSaSUa2qBi0oc2sfBHbIBl jtmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:mime-version:user-agent:date :message-id:subject:from:references:cc:to:dkim-signature; bh=AM1Yfu/VA+CFkoJtGcJlyq5LfmzZYcy4W2EX0iByKN0=; b=ip6DAH+dpc0n41bs+1P+hINLXxr+c40AEzrEgihFFDxXQ3jYj2YzzjAtxtLDvR+zhu 7uakR0WwjTJIy4/fpJN0f6D17o09XUtKiooLw1gw0mDgw061RRN17ShTXP4N+N/6gQyB 9LDynEXwypzf49ASgJua7plEfDfGI3hvrPdM4pmISV6QyMGI4cKvrxKTO3hWLfV/IwG4 sw9S8VCR2PxgyxiPmTqHYiHD3RDrQEbbmsUXsdracUtbF6x5NYfdwAfiMG1PmHyPXrMj eISUUFAmnGI2eS3G5ZyeJWGlwnZZ5+o41Xm37QbESriTHDMMwnTABykK8Wf3R3VH2sGi tPrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=KGYaGeIe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bl4si2968431ejb.17.2021.08.17.06.33.23; Tue, 17 Aug 2021 06:33:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=KGYaGeIe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239983AbhHQN3f (ORCPT + 99 others); Tue, 17 Aug 2021 09:29:35 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:41140 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239926AbhHQN3O (ORCPT ); Tue, 17 Aug 2021 09:29:14 -0400 Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 017EE21EC1; Tue, 17 Aug 2021 13:28:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1629206920; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=AM1Yfu/VA+CFkoJtGcJlyq5LfmzZYcy4W2EX0iByKN0=; b=KGYaGeIemSEKhL5b+qZxzE7WqR5Uuahi1g+aM+42jiSovjiki3IPCcylbm+T3gDt9+pEij 0SlDXlQHS/HBqUr4ji9k3VlF79SQjuzQvdKjB1ieWagRVXS80mVI4Zy3WIS9t7QpOPOps3 W8UJtOlBbL/5Ph4VYN8h2PfUqqLsxOg= Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap1.suse-dmz.suse.de (Postfix) with ESMTPS id 76736132AB; Tue, 17 Aug 2021 13:28:39 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap1.suse-dmz.suse.de with ESMTPSA id RVl2G4e5G2HXQQAAGKfGzw (envelope-from ); Tue, 17 Aug 2021 13:28:39 +0000 To: "Kuppuswamy, Sathyanarayanan" , Borislav Petkov Cc: Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Andy Lutomirski , Peter H Anvin , Dave Hansen , Tony Luck , Dan Williams , Andi Kleen , Kirill Shutemov , Sean Christopherson , Kuppuswamy Sathyanarayanan , x86@kernel.org, linux-kernel@vger.kernel.org, Deep Shah , "VMware, Inc." References: <20210804181329.2899708-1-sathyanarayanan.kuppuswamy@linux.intel.com> <20210804181329.2899708-2-sathyanarayanan.kuppuswamy@linux.intel.com> <057170db-9382-eb40-7bcb-4ec1de4aae62@suse.com> From: Juergen Gross Subject: Re: [PATCH v5 01/12] x86/paravirt: Move halt paravirt calls under CONFIG_PARAVIRT Message-ID: Date: Tue, 17 Aug 2021 15:28:38 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="nchmaQkHf2Jc5jvFBRkxkf7Z2wH0GxIcM" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --nchmaQkHf2Jc5jvFBRkxkf7Z2wH0GxIcM Content-Type: multipart/mixed; boundary="tHFOW1luDj43gk5xj4meJfqDp6ADSdDXm"; protected-headers="v1" From: Juergen Gross To: "Kuppuswamy, Sathyanarayanan" , Borislav Petkov Cc: Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Andy Lutomirski , Peter H Anvin , Dave Hansen , Tony Luck , Dan Williams , Andi Kleen , Kirill Shutemov , Sean Christopherson , Kuppuswamy Sathyanarayanan , x86@kernel.org, linux-kernel@vger.kernel.org, Deep Shah , "VMware, Inc." Message-ID: Subject: Re: [PATCH v5 01/12] x86/paravirt: Move halt paravirt calls under CONFIG_PARAVIRT References: <20210804181329.2899708-1-sathyanarayanan.kuppuswamy@linux.intel.com> <20210804181329.2899708-2-sathyanarayanan.kuppuswamy@linux.intel.com> <057170db-9382-eb40-7bcb-4ec1de4aae62@suse.com> In-Reply-To: --tHFOW1luDj43gk5xj4meJfqDp6ADSdDXm Content-Type: multipart/mixed; boundary="------------AC7EFD19D87D3EB8A3ABE1E5" Content-Language: en-US This is a multi-part message in MIME format. --------------AC7EFD19D87D3EB8A3ABE1E5 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable On 17.08.21 15:16, Kuppuswamy, Sathyanarayanan wrote: >=20 >=20 > On 8/17/21 5:50 AM, Juergen Gross wrote: >> On 12.08.21 09:18, Borislav Petkov wrote: >>> On Wed, Aug 04, 2021 at 11:13:18AM -0700, Kuppuswamy Sathyanarayanan = >>> wrote: >>>> From: "Kirill A. Shutemov" >>>> >>>> CONFIG_PARAVIRT_XXL is mainly defined/used by XEN PV guests. For >>>> other VM guest types, features supported under CONFIG_PARAVIRT >>>> are self sufficient. CONFIG_PARAVIRT mainly provides support for >>>> TLB flush operations and time related operations. >>>> >>>> For TDX guest as well, paravirt calls under CONFIG_PARVIRT meets >>>> most of its requirement except the need of HLT and SAFE_HLT >>>> paravirt calls, which is currently defined under >>>> COFNIG_PARAVIRT_XXL. >>>> >>>> Since enabling CONFIG_PARAVIRT_XXL is too bloated for TDX guest >>>> like platforms, move HLT and SAFE_HLT paravirt calls under >>>> CONFIG_PARAVIRT. >>>> >>>> Moving HLT and SAFE_HLT paravirt calls are not fatal and should not >>>> break any functionality for current users of CONFIG_PARAVIRT. >>>> >>>> Co-developed-by: Kuppuswamy Sathyanarayanan=20 >>>> >>>> Signed-off-by: Kuppuswamy Sathyanarayanan=20 >>>> >>>> Signed-off-by: Kirill A. Shutemov >>>> Reviewed-by: Andi Kleen >>>> Reviewed-by: Tony Luck >>>> --- >>> >>> You need to do this before sending your patches: >>> >>> ./scripts/get_maintainer.pl /tmp/tdx.01 >>> Thomas Gleixner (maintainer:X86 ARCHITECTURE=20 >>> (32-BIT AND 64-BIT),commit_signer:1/6=3D17%) >>> Ingo Molnar (maintainer:X86 ARCHITECTURE (32-BIT=20 >>> AND 64-BIT)) >>> Borislav Petkov (maintainer:X86 ARCHITECTURE (32-BIT=20 >>> AND 64-BIT),commit_signer:6/6=3D100%) >>> x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)) >>> "H. Peter Anvin" (reviewer:X86 ARCHITECTURE (32-BIT=20 >>> AND 64-BIT)) >>> Juergen Gross (supporter:PARAVIRT_OPS=20 >>> INTERFACE,commit_signer:5/6=3D83%,authored:5/6=3D83%,added_lines:15/1= 6=3D94%,removed_lines:38/39=3D97%)=20 >>> >>> Deep Shah (supporter:PARAVIRT_OPS INTERFACE) >>> "VMware, Inc." (supporter:PARAVIRT_OPS=20 >>> INTERFACE) >>> ... >>> >>> and CC also the supporters - I'm pretty sure at least Juergen would l= ike >>> to be kept up-to-date on pv changes. I'll CC him and the others now a= nd >>> leave in the whole diff but make sure you do that in the future pleas= e. >>> >>>> =C2=A0 arch/x86/include/asm/irqflags.h=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 | 40=20 >>>> +++++++++++++++------------ >>>> =C2=A0 arch/x86/include/asm/paravirt.h=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 | 20 +++++++------- >>>> =C2=A0 arch/x86/include/asm/paravirt_types.h |=C2=A0 3 +- >>>> =C2=A0 arch/x86/kernel/paravirt.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0 4 ++- >>>> =C2=A0 4 files changed, 36 insertions(+), 31 deletions(-) >>>> >>>> diff --git a/arch/x86/include/asm/irqflags.h=20 >>>> b/arch/x86/include/asm/irqflags.h >>>> index c5ce9845c999..f3bb33b1715d 100644 >>>> --- a/arch/x86/include/asm/irqflags.h >>>> +++ b/arch/x86/include/asm/irqflags.h >>>> @@ -59,6 +59,28 @@ static inline __cpuidle void native_halt(void) >>>> =C2=A0 #endif >>>> +#ifndef CONFIG_PARAVIRT >>>> +#ifndef __ASSEMBLY__ >>>> +/* >>>> + * Used in the idle loop; sti takes one instruction cycle >>>> + * to complete: >>>> + */ >>>> +static inline __cpuidle void arch_safe_halt(void) >>>> +{ >>>> +=C2=A0=C2=A0=C2=A0 native_safe_halt(); >>>> +} >>>> + >>>> +/* >>>> + * Used when interrupts are already enabled or to >>>> + * shutdown the processor: >>>> + */ >>>> +static inline __cpuidle void halt(void) >>>> +{ >>>> +=C2=A0=C2=A0=C2=A0 native_halt(); >>>> +} >>>> +#endif /* __ASSEMBLY__ */ >>>> +#endif /* CONFIG_PARAVIRT */ >>>> + >>>> =C2=A0 #ifdef CONFIG_PARAVIRT_XXL >>>> =C2=A0 #include >> >> Did you test this with CONFIG_PARAVIRT enabled and CONFIG_PARAVIRT_XXL= >> disabled? >> >> I'm asking because in this case I don't see where halt() and >> arch_safe_halt() would be defined in case someone is including >> asm/irqflags.h and not asm/paravirt.h. >=20 > We have tested both cases and did not hit any issues. >=20 > 1. CONFIG_PARAVIRT=3Dy and=C2=A0 CONFIG_PARAVIRT_XXL=3Dy > 2. CONFIG_PARAVIRT=3Dy and=C2=A0 CONFIG_PARAVIRT_XXL=3Dn I guess you have been lucky and all users of arch_safe_halt() and halt() are directly or indirectly including asm/paravirt.h by other means. There might be configs where this is not true, though. In any case I believe you should fix your patch to let asm/irqflags.h include asm/paravirt.h for the CONFIG_PARAVIRT case. Juergen --------------AC7EFD19D87D3EB8A3ABE1E5 Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc" Content-Transfer-Encoding: quoted-printable Content-Description: OpenPGP public key Content-Disposition: attachment; filename="OpenPGP_0xB0DE9DD628BF132F.asc" -----BEGIN PGP PUBLIC KEY BLOCK----- xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjrioyspZKOBy= cWx w3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2kaV2KL9650I1SJvedYm8O= f8Z d621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i1TXkH09XSSI8mEQ/ouNcMvIJNwQpd369y= 9bf IhWUiVXEK7MlRgUG6MvIj6Y3Am/BBLUVbDa4+gmzDC9ezlZkTZG2t14zWPvxXP3FAp2pkW0xq= G7/ 377qptDmrk42GlSKN4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEBAAHNHEp1ZXJnZW4gR= 3Jv c3MgPGpnQHBmdXBmLm5ldD7CwHkEEwECACMFAlOMcBYCGwMHCwkIBwMCAQYVCAIJCgsEFgIDA= QIe AQIXgAAKCRCw3p3WKL8TL0KdB/93FcIZ3GCNwFU0u3EjNbNjmXBKDY4FUGNQH2lvWAUy+dnyT= hpw dtF/jQ6j9RwE8VP0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4P/L+bQpJwrZ/dneZcmEw= Tbe 8YFsw2V/Buv6Z4Mysln3nQK5ZadD534CF7TDVft7fC4tU4PONxF5D+/tvgkPfDAfF77zy2AH1= vJz Q1fOU8lYFpZXTXIHb+559UqvIB8AdgR3SAJGHHt4RKA0F7f5ipYBBrC6cyXJyyoprT10EMvU8= VGi wXvTyJz3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqcsuylW= svi uGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5BjR/i1DG86lem3iBDX= zXs ZDn8R38=3D =3D2wuH -----END PGP PUBLIC KEY BLOCK----- --------------AC7EFD19D87D3EB8A3ABE1E5-- --tHFOW1luDj43gk5xj4meJfqDp6ADSdDXm-- --nchmaQkHf2Jc5jvFBRkxkf7Z2wH0GxIcM Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmEbuYYFAwAAAAAACgkQsN6d1ii/Ey++ 8ggAjrz3PuztnDTAh2P8Gm60P+SQZlvEvafIfAcHpnVlEr2t2MLN41N1kRSAcLJ7/iyvFkB/6Ozp cthN416EIsiU3ytazjkXV408oL/eo1Rubgfd/enAA/yJD/FMETLr9HxQMYhFXzdOl2NipTpqUJLc YzfiPfLCx2RhCeBcUfPG7XIsobXuHI0WzOHmm1hHMTVqu/9DVTy64ETKJj8wqLZ7hdwyTEMShRQR wOwOcfac9QkXRabS2G8J8S2p742LUZIpfDK7YFHEKvR7FBzRsWwi5y1Rd7vr3IxUvKrtufl+yYYf 95BxHjWbWxG0rLwcTjnXSDOKJWRXZZGzatp0lTlCIg== =uUqV -----END PGP SIGNATURE----- --nchmaQkHf2Jc5jvFBRkxkf7Z2wH0GxIcM--