[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d3fa3c72-b420-0b5c-f385-bad1d56fcd0d@linux.intel.com>
Date: Wed, 17 Nov 2021 17:26:15 -0800
From: Sathyanarayanan Kuppuswamy
<sathyanarayanan.kuppuswamy@...ux.intel.com>
To: Dave Hansen <dave.hansen@...el.com>, Borislav Petkov <bp@...en8.de>
Cc: "Kirill A. Shutemov" <kirill@...temov.name>,
Peter Zijlstra <peterz@...radead.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
Andi Kleen <ak@...ux.intel.com>, x86@...nel.org,
linux-kernel@...r.kernel.org,
"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
Juergen Gross <jgross@...e.com>, Deep Shah <sdeep@...are.com>,
"VMware, Inc." <pv-drivers@...are.com>
Subject: Re: [PATCH] x86/paravirt: Fix build PARAVIRT_XXL=y without XEN_PV
On 11/17/21 3:33 PM, Dave Hansen wrote:
> On 11/17/21 3:04 PM, Sathyanarayanan Kuppuswamy wrote:
>> 1. Directly substitute TDVMCALLs in places where we require emulation.
> ...
>> Since option#1 is not a scalable approach,
>
> Why is this not "scalable"? Just eyeballing the problem, here's my
> laptop's kernel:
I meant it not scalable because, for any new use case of HLT
instruction, it would need substitution again. We cannot always keep
tracking its uses in the future, right?
Also, If we make any changes to the core emulation code (like arguments
change), we will have to re-touch these use cases to handle it.
If this approach is taken to add some performance benefit, then it
makes sense. But for our case, I think it is simpler to use PV ops.
>
> $ objdump -d vmlinux | grep 'hlt ' | awk -F: '{print $1}' | while read
> addr; do addr2line -e vmlinux $addr; done
> arch/x86/include/asm/irqflags.h:51
> arch/x86/include/asm/irqflags.h:51
> arch/x86/include/asm/irqflags.h:57
> arch/x86/include/asm/irqflags.h:57
> arch/x86/include/asm/irqflags.h:57
> arch/x86/include/asm/irqflags.h:57
> arch/x86/include/asm/irqflags.h:51
> arch/x86/include/asm/irqflags.h:51
> arch/x86/include/asm/irqflags.h:51
> arch/x86/kernel/fpu/init.c:84
> arch/x86/include/asm/irqflags.h:57
>
> There are a grand total of 3 sites from which a hlt originates. With
> only 11 possible instances and 3 sites to patch, I'm not sure anything
> here needs to be "scalable".
>
> I'd suspect half these sites aren't even reachable on a TDX system.
>
--
Sathyanarayanan Kuppuswamy
Linux Kernel Developer
Powered by blists - more mailing lists