linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH] x86/paravirt: Kill some unused patching functions
@ 2015-11-03  9:18 Borislav Petkov
  2015-11-05 11:15 ` Juergen Gross
  2015-11-07 17:12 ` [tip:x86/cleanups] " tip-bot for Borislav Petkov
  0 siblings, 2 replies; 3+ messages in thread
From: Borislav Petkov @ 2015-11-03  9:18 UTC (permalink / raw)
  To: LKML
  Cc: Andrew Morton, Andy Lutomirski, Chris Wright, H. Peter Anvin,
	Ingo Molnar, Jeremy Fitzhardinge, Juergen Gross,
	Peter Zijlstra (Intel),
	Rusty Russell, Thomas Gleixner, virtualization, xen-devel

From: Borislav Petkov <bp@suse.de>

paravirt_patch_ignore() is completely unused and paravirt_patch_nop()
doesn't do a whole lot. Remove them both.

Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Chris Wright <chrisw@sous-sol.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Juergen Gross <jgross@suse.com>
Cc: "Peter Zijlstra (Intel)" <peterz@infradead.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: virtualization@lists.linux-foundation.org
Cc: xen-devel@lists.xenproject.org
---
 arch/x86/include/asm/paravirt_types.h |  2 --
 arch/x86/kernel/paravirt.c            | 13 +------------
 2 files changed, 1 insertion(+), 14 deletions(-)

diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/include/asm/paravirt_types.h
index 31247b5bff7c..e1f31dfc3b31 100644
--- a/arch/x86/include/asm/paravirt_types.h
+++ b/arch/x86/include/asm/paravirt_types.h
@@ -402,10 +402,8 @@ extern struct pv_lock_ops pv_lock_ops;
 	__visible extern const char start_##ops##_##name[], end_##ops##_##name[];	\
 	asm(NATIVE_LABEL("start_", ops, name) code NATIVE_LABEL("end_", ops, name))
 
-unsigned paravirt_patch_nop(void);
 unsigned paravirt_patch_ident_32(void *insnbuf, unsigned len);
 unsigned paravirt_patch_ident_64(void *insnbuf, unsigned len);
-unsigned paravirt_patch_ignore(unsigned len);
 unsigned paravirt_patch_call(void *insnbuf,
 			     const void *target, u16 tgt_clobbers,
 			     unsigned long addr, u16 site_clobbers,
diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c
index c2130aef3f9d..4f32a10979db 100644
--- a/arch/x86/kernel/paravirt.c
+++ b/arch/x86/kernel/paravirt.c
@@ -74,16 +74,6 @@ void __init default_banner(void)
 /* Undefined instruction for dealing with missing ops pointers. */
 static const unsigned char ud2a[] = { 0x0f, 0x0b };
 
-unsigned paravirt_patch_nop(void)
-{
-	return 0;
-}
-
-unsigned paravirt_patch_ignore(unsigned len)
-{
-	return len;
-}
-
 struct branch {
 	unsigned char opcode;
 	u32 delta;
@@ -152,8 +142,7 @@ unsigned paravirt_patch_default(u8 type, u16 clobbers, void *insnbuf,
 		/* If there's no function, patch it with a ud2a (BUG) */
 		ret = paravirt_patch_insns(insnbuf, len, ud2a, ud2a+sizeof(ud2a));
 	else if (opfunc == _paravirt_nop)
-		/* If the operation is a nop, then nop the callsite */
-		ret = paravirt_patch_nop();
+		ret = 0;
 
 	/* identity functions just return their single argument */
 	else if (opfunc == _paravirt_ident_32)
-- 
2.3.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [RFC PATCH] x86/paravirt: Kill some unused patching functions
  2015-11-03  9:18 [RFC PATCH] x86/paravirt: Kill some unused patching functions Borislav Petkov
@ 2015-11-05 11:15 ` Juergen Gross
  2015-11-07 17:12 ` [tip:x86/cleanups] " tip-bot for Borislav Petkov
  1 sibling, 0 replies; 3+ messages in thread
From: Juergen Gross @ 2015-11-05 11:15 UTC (permalink / raw)
  To: Borislav Petkov, LKML
  Cc: Andrew Morton, Andy Lutomirski, Chris Wright, H. Peter Anvin,
	Ingo Molnar, Jeremy Fitzhardinge, Peter Zijlstra (Intel),
	Rusty Russell, Thomas Gleixner, virtualization, xen-devel

On 11/03/2015 10:18 AM, Borislav Petkov wrote:
> From: Borislav Petkov <bp@suse.de>
>
> paravirt_patch_ignore() is completely unused and paravirt_patch_nop()
> doesn't do a whole lot. Remove them both.
>
> Signed-off-by: Borislav Petkov <bp@suse.de>

Reviewed-by: Juergen Gross <jgross@suse.com>

> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Andy Lutomirski <luto@kernel.org>
> Cc: Chris Wright <chrisw@sous-sol.org>
> Cc: "H. Peter Anvin" <hpa@zytor.com>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: Jeremy Fitzhardinge <jeremy@goop.org>
> Cc: Juergen Gross <jgross@suse.com>
> Cc: "Peter Zijlstra (Intel)" <peterz@infradead.org>
> Cc: Rusty Russell <rusty@rustcorp.com.au>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: virtualization@lists.linux-foundation.org
> Cc: xen-devel@lists.xenproject.org
> ---
>   arch/x86/include/asm/paravirt_types.h |  2 --
>   arch/x86/kernel/paravirt.c            | 13 +------------
>   2 files changed, 1 insertion(+), 14 deletions(-)
>
> diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/include/asm/paravirt_types.h
> index 31247b5bff7c..e1f31dfc3b31 100644
> --- a/arch/x86/include/asm/paravirt_types.h
> +++ b/arch/x86/include/asm/paravirt_types.h
> @@ -402,10 +402,8 @@ extern struct pv_lock_ops pv_lock_ops;
>   	__visible extern const char start_##ops##_##name[], end_##ops##_##name[];	\
>   	asm(NATIVE_LABEL("start_", ops, name) code NATIVE_LABEL("end_", ops, name))
>
> -unsigned paravirt_patch_nop(void);
>   unsigned paravirt_patch_ident_32(void *insnbuf, unsigned len);
>   unsigned paravirt_patch_ident_64(void *insnbuf, unsigned len);
> -unsigned paravirt_patch_ignore(unsigned len);
>   unsigned paravirt_patch_call(void *insnbuf,
>   			     const void *target, u16 tgt_clobbers,
>   			     unsigned long addr, u16 site_clobbers,
> diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c
> index c2130aef3f9d..4f32a10979db 100644
> --- a/arch/x86/kernel/paravirt.c
> +++ b/arch/x86/kernel/paravirt.c
> @@ -74,16 +74,6 @@ void __init default_banner(void)
>   /* Undefined instruction for dealing with missing ops pointers. */
>   static const unsigned char ud2a[] = { 0x0f, 0x0b };
>
> -unsigned paravirt_patch_nop(void)
> -{
> -	return 0;
> -}
> -
> -unsigned paravirt_patch_ignore(unsigned len)
> -{
> -	return len;
> -}
> -
>   struct branch {
>   	unsigned char opcode;
>   	u32 delta;
> @@ -152,8 +142,7 @@ unsigned paravirt_patch_default(u8 type, u16 clobbers, void *insnbuf,
>   		/* If there's no function, patch it with a ud2a (BUG) */
>   		ret = paravirt_patch_insns(insnbuf, len, ud2a, ud2a+sizeof(ud2a));
>   	else if (opfunc == _paravirt_nop)
> -		/* If the operation is a nop, then nop the callsite */
> -		ret = paravirt_patch_nop();
> +		ret = 0;
>
>   	/* identity functions just return their single argument */
>   	else if (opfunc == _paravirt_ident_32)
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip:x86/cleanups] x86/paravirt: Kill some unused patching functions
  2015-11-03  9:18 [RFC PATCH] x86/paravirt: Kill some unused patching functions Borislav Petkov
  2015-11-05 11:15 ` Juergen Gross
@ 2015-11-07 17:12 ` tip-bot for Borislav Petkov
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Borislav Petkov @ 2015-11-07 17:12 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: luto, akpm, mingo, rusty, tglx, linux-kernel, chrisw, jeremy,
	peterz, hpa, bp, jgross

Commit-ID:  79f1d836925c545b4612f7ed19423f0950978b5e
Gitweb:     http://git.kernel.org/tip/79f1d836925c545b4612f7ed19423f0950978b5e
Author:     Borislav Petkov <bp@suse.de>
AuthorDate: Tue, 3 Nov 2015 10:18:49 +0100
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Sat, 7 Nov 2015 18:09:35 +0100

x86/paravirt: Kill some unused patching functions

paravirt_patch_ignore() is completely unused and paravirt_patch_nop()
doesn't do a whole lot. Remove them both.

Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Juergen Gross <jgross@suse.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Chris Wright <chrisw@sous-sol.org>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: "Peter Zijlstra (Intel)" <peterz@infradead.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: virtualization@lists.linux-foundation.org
Cc: xen-devel@lists.xenproject.org
Link: http://lkml.kernel.org/r/1446542329-32037-1-git-send-email-bp@alien8.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 arch/x86/include/asm/paravirt_types.h |  2 --
 arch/x86/kernel/paravirt.c            | 13 +------------
 2 files changed, 1 insertion(+), 14 deletions(-)

diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/include/asm/paravirt_types.h
index 31247b5..e1f31df 100644
--- a/arch/x86/include/asm/paravirt_types.h
+++ b/arch/x86/include/asm/paravirt_types.h
@@ -402,10 +402,8 @@ extern struct pv_lock_ops pv_lock_ops;
 	__visible extern const char start_##ops##_##name[], end_##ops##_##name[];	\
 	asm(NATIVE_LABEL("start_", ops, name) code NATIVE_LABEL("end_", ops, name))
 
-unsigned paravirt_patch_nop(void);
 unsigned paravirt_patch_ident_32(void *insnbuf, unsigned len);
 unsigned paravirt_patch_ident_64(void *insnbuf, unsigned len);
-unsigned paravirt_patch_ignore(unsigned len);
 unsigned paravirt_patch_call(void *insnbuf,
 			     const void *target, u16 tgt_clobbers,
 			     unsigned long addr, u16 site_clobbers,
diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c
index c2130ae..4f32a10 100644
--- a/arch/x86/kernel/paravirt.c
+++ b/arch/x86/kernel/paravirt.c
@@ -74,16 +74,6 @@ void __init default_banner(void)
 /* Undefined instruction for dealing with missing ops pointers. */
 static const unsigned char ud2a[] = { 0x0f, 0x0b };
 
-unsigned paravirt_patch_nop(void)
-{
-	return 0;
-}
-
-unsigned paravirt_patch_ignore(unsigned len)
-{
-	return len;
-}
-
 struct branch {
 	unsigned char opcode;
 	u32 delta;
@@ -152,8 +142,7 @@ unsigned paravirt_patch_default(u8 type, u16 clobbers, void *insnbuf,
 		/* If there's no function, patch it with a ud2a (BUG) */
 		ret = paravirt_patch_insns(insnbuf, len, ud2a, ud2a+sizeof(ud2a));
 	else if (opfunc == _paravirt_nop)
-		/* If the operation is a nop, then nop the callsite */
-		ret = paravirt_patch_nop();
+		ret = 0;
 
 	/* identity functions just return their single argument */
 	else if (opfunc == _paravirt_ident_32)

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-11-07 17:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-03  9:18 [RFC PATCH] x86/paravirt: Kill some unused patching functions Borislav Petkov
2015-11-05 11:15 ` Juergen Gross
2015-11-07 17:12 ` [tip:x86/cleanups] " tip-bot for Borislav Petkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).