From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754465AbbFSQOp (ORCPT ); Fri, 19 Jun 2015 12:14:45 -0400 Received: from mail-lb0-f179.google.com ([209.85.217.179]:36385 "EHLO mail-lb0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752679AbbFSQOh (ORCPT ); Fri, 19 Jun 2015 12:14:37 -0400 MIME-Version: 1.0 In-Reply-To: <20150619153201.GF12979@pd.tnic> References: <20150619153201.GF12979@pd.tnic> From: Andy Lutomirski Date: Fri, 19 Jun 2015 09:14:14 -0700 Message-ID: Subject: Re: [PATCH v3 03/18] x86/tsc/paravirt: Remove the read_tsc and read_tscp paravirt hooks To: Borislav Petkov Cc: Andy Lutomirski , X86 ML , Peter Zijlstra , John Stultz , "linux-kernel@vger.kernel.org" , Len Brown , Huang Rui , Denys Vlasenko , kvm list , Ralf Baechle Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 19, 2015 at 8:32 AM, Borislav Petkov wrote: > On Tue, Jun 16, 2015 at 05:35:51PM -0700, Andy Lutomirski wrote: >> We've had read_tsc and read_tscp paravirt hooks since the very >> beginning of paravirt, i.e., d3561b7fa0fb ("[PATCH] paravirt: header >> and stubs for paravirtualisation"). AFAICT the only paravirt guest >> implementation that ever replaced these calls was vmware, and it's >> gone. Arguably even vmware shouldn't have hooked rdtsc -- we fully >> support systems that don't have a TSC at all, so there's no point >> for a paravirt implementation to pretend that we have a TSC but to >> replace it. >> >> I also doubt that these hooks actually worked. Calls to rdtscl and >> rdtscll, which respected the hooks, were used seemingly >> interchangeably with native_read_tsc, which did not. >> >> Just remove them. If anyone ever needs them again, they can try >> to make a case for why they need them. >> >> Before, on a paravirt config: >> text data bss dec hex filename >> 13426505 1827056 14508032 29761593 1c62039 vmlinux >> >> After: >> text data bss dec hex filename >> 13426617 1827056 14508032 29761705 1c620a9 vmlinux > > Those look swapped. I mean, you're removing a bunch of stuff and text > grew?! Trying again. The config is different, so the numbers won't match. Before: text data bss dec hex filename 12618257 1816384 1093632 15528273 ecf151 vmlinux After: text data bss dec hex filename 12617207 1816384 1093632 15527223 eced37 vmlinux So, yes, I have it backwards. There's some penalty here because this patch also causes rdtsc to be inlined on paravirt kernels (it was patched as a call instead of an inline instruction sequence), so each call site pays for the shift, the or, and the pointless zero extension. With the "unsigned long" patch, it's: text data bss dec hex filename 12617002 1816384 1093632 15527018 ecec6a vmlinux Want to fix up the commit message? It seems silly to re-send the whole series for this. --Andy > >> Signed-off-by: Andy Lutomirski >> --- >> arch/x86/include/asm/msr.h | 16 ++++++++-------- >> arch/x86/include/asm/paravirt.h | 34 ---------------------------------- >> arch/x86/include/asm/paravirt_types.h | 2 -- >> arch/x86/kernel/paravirt.c | 2 -- >> arch/x86/kernel/paravirt_patch_32.c | 2 -- >> arch/x86/xen/enlighten.c | 3 --- >> 6 files changed, 8 insertions(+), 51 deletions(-) > > -- > Regards/Gruss, > Boris. > > ECO tip #101: Trim your mails when you reply. > -- -- Andy Lutomirski AMA Capital Management, LLC -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in Please read the FAQ at http://www.tux.org/lkml/ From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Lutomirski Subject: Re: [PATCH v3 03/18] x86/tsc/paravirt: Remove the read_tsc and read_tscp paravirt hooks Date: Fri, 19 Jun 2015 09:14:14 -0700 Message-ID: References: <20150619153201.GF12979@pd.tnic> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Cc: Andy Lutomirski , X86 ML , Peter Zijlstra , John Stultz , "linux-kernel@vger.kernel.org" , Len Brown , Huang Rui , Denys Vlasenko , kvm list , Ralf Baechle To: Borislav Petkov Return-path: In-Reply-To: <20150619153201.GF12979@pd.tnic> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On Fri, Jun 19, 2015 at 8:32 AM, Borislav Petkov wrote: > On Tue, Jun 16, 2015 at 05:35:51PM -0700, Andy Lutomirski wrote: >> We've had read_tsc and read_tscp paravirt hooks since the very >> beginning of paravirt, i.e., d3561b7fa0fb ("[PATCH] paravirt: header >> and stubs for paravirtualisation"). AFAICT the only paravirt guest >> implementation that ever replaced these calls was vmware, and it's >> gone. Arguably even vmware shouldn't have hooked rdtsc -- we fully >> support systems that don't have a TSC at all, so there's no point >> for a paravirt implementation to pretend that we have a TSC but to >> replace it. >> >> I also doubt that these hooks actually worked. Calls to rdtscl and >> rdtscll, which respected the hooks, were used seemingly >> interchangeably with native_read_tsc, which did not. >> >> Just remove them. If anyone ever needs them again, they can try >> to make a case for why they need them. >> >> Before, on a paravirt config: >> text data bss dec hex filename >> 13426505 1827056 14508032 29761593 1c62039 vmlinux >> >> After: >> text data bss dec hex filename >> 13426617 1827056 14508032 29761705 1c620a9 vmlinux > > Those look swapped. I mean, you're removing a bunch of stuff and text > grew?! Trying again. The config is different, so the numbers won't match. Before: text data bss dec hex filename 12618257 1816384 1093632 15528273 ecf151 vmlinux After: text data bss dec hex filename 12617207 1816384 1093632 15527223 eced37 vmlinux So, yes, I have it backwards. There's some penalty here because this patch also causes rdtsc to be inlined on paravirt kernels (it was patched as a call instead of an inline instruction sequence), so each call site pays for the shift, the or, and the pointless zero extension. With the "unsigned long" patch, it's: text data bss dec hex filename 12617002 1816384 1093632 15527018 ecec6a vmlinux Want to fix up the commit message? It seems silly to re-send the whole series for this. --Andy > >> Signed-off-by: Andy Lutomirski >> --- >> arch/x86/include/asm/msr.h | 16 ++++++++-------- >> arch/x86/include/asm/paravirt.h | 34 ---------------------------------- >> arch/x86/include/asm/paravirt_types.h | 2 -- >> arch/x86/kernel/paravirt.c | 2 -- >> arch/x86/kernel/paravirt_patch_32.c | 2 -- >> arch/x86/xen/enlighten.c | 3 --- >> 6 files changed, 8 insertions(+), 51 deletions(-) > > -- > Regards/Gruss, > Boris. > > ECO tip #101: Trim your mails when you reply. > -- -- Andy Lutomirski AMA Capital Management, LLC