All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Mackerras <paulus@samba.org>
To: Andreas Schwab <schwab-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>
Cc: kvm-ppc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linuxppc-dev-mnsaURCQ41sdnm+yROfE0A@public.gmane.org,
	Alexander Graf <agraf-l3A5Bk7waGM@public.gmane.org>,
	kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] KVM: PPC: elide struct thread_struct instances from
Date: Mon, 31 May 2010 22:40:40 +0000	[thread overview]
Message-ID: <20100531224040.GA22927@brick.ozlabs.ibm.com> (raw)
In-Reply-To: <m26323onam.fsf-hBGjKatGTSWzQB+pC5nmwQ@public.gmane.org>

On Mon, May 31, 2010 at 09:59:13PM +0200, Andreas Schwab wrote:

> Instead of instantiating a whole thread_struct on the stack use only the
> required parts of it.

...

> +_GLOBAL(kvm_cvt_fd)
> +	lfd	0,0(r5)			/* load up fpscr value */
> +	MTFSF_L(0)
> +	lfs	0,0(r3)
> +	stfd	0,0(r4)
> +	mffs	0
> +	stfd	0,0(r5)			/* save new fpscr value */
> +	blr
> +
> +_GLOBAL(kvm_cvt_df)
> +	lfd	0,0(r5)			/* load up fpscr value */
> +	MTFSF_L(0)
> +	lfd	0,0(r3)
> +	stfs	0,0(r4)
> +	mffs	0
> +	stfd	0,0(r5)			/* save new fpscr value */
> +	blr

I re-read the relevant part of the PowerPC architecture spec
yesterday, and it seems pretty clear that the FPSCR doesn't affect the
behaviour of lfs and stfs, and is not affected by them.  So in fact 4
out of the 7 instructions in each of those procedures are unnecessary
(and similarly for the cvt_fd/df used in the alignment fixup code).

Paul.

WARNING: multiple messages have this Message-ID (diff)
From: Paul Mackerras <paulus@samba.org>
To: Andreas Schwab <schwab@linux-m68k.org>
Cc: linuxppc-dev@ozlabs.org, Alexander Graf <agraf@suse.de>,
	kvm-ppc@vger.kernel.org, kvm@vger.kernel.org
Subject: Re: [PATCH] KVM: PPC: elide struct thread_struct instances from stack
Date: Tue, 1 Jun 2010 08:40:40 +1000	[thread overview]
Message-ID: <20100531224040.GA22927@brick.ozlabs.ibm.com> (raw)
In-Reply-To: <m26323onam.fsf@igel.home>

On Mon, May 31, 2010 at 09:59:13PM +0200, Andreas Schwab wrote:

> Instead of instantiating a whole thread_struct on the stack use only the
> required parts of it.

...

> +_GLOBAL(kvm_cvt_fd)
> +	lfd	0,0(r5)			/* load up fpscr value */
> +	MTFSF_L(0)
> +	lfs	0,0(r3)
> +	stfd	0,0(r4)
> +	mffs	0
> +	stfd	0,0(r5)			/* save new fpscr value */
> +	blr
> +
> +_GLOBAL(kvm_cvt_df)
> +	lfd	0,0(r5)			/* load up fpscr value */
> +	MTFSF_L(0)
> +	lfd	0,0(r3)
> +	stfs	0,0(r4)
> +	mffs	0
> +	stfd	0,0(r5)			/* save new fpscr value */
> +	blr

I re-read the relevant part of the PowerPC architecture spec
yesterday, and it seems pretty clear that the FPSCR doesn't affect the
behaviour of lfs and stfs, and is not affected by them.  So in fact 4
out of the 7 instructions in each of those procedures are unnecessary
(and similarly for the cvt_fd/df used in the alignment fixup code).

Paul.

WARNING: multiple messages have this Message-ID (diff)
From: Paul Mackerras <paulus-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
To: Andreas Schwab <schwab-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>
Cc: kvm-ppc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linuxppc-dev-mnsaURCQ41sdnm+yROfE0A@public.gmane.org,
	Alexander Graf <agraf-l3A5Bk7waGM@public.gmane.org>,
	kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] KVM: PPC: elide struct thread_struct instances from stack
Date: Tue, 1 Jun 2010 08:40:40 +1000	[thread overview]
Message-ID: <20100531224040.GA22927@brick.ozlabs.ibm.com> (raw)
In-Reply-To: <m26323onam.fsf-hBGjKatGTSWzQB+pC5nmwQ@public.gmane.org>

On Mon, May 31, 2010 at 09:59:13PM +0200, Andreas Schwab wrote:

> Instead of instantiating a whole thread_struct on the stack use only the
> required parts of it.

...

> +_GLOBAL(kvm_cvt_fd)
> +	lfd	0,0(r5)			/* load up fpscr value */
> +	MTFSF_L(0)
> +	lfs	0,0(r3)
> +	stfd	0,0(r4)
> +	mffs	0
> +	stfd	0,0(r5)			/* save new fpscr value */
> +	blr
> +
> +_GLOBAL(kvm_cvt_df)
> +	lfd	0,0(r5)			/* load up fpscr value */
> +	MTFSF_L(0)
> +	lfd	0,0(r3)
> +	stfs	0,0(r4)
> +	mffs	0
> +	stfd	0,0(r5)			/* save new fpscr value */
> +	blr

I re-read the relevant part of the PowerPC architecture spec
yesterday, and it seems pretty clear that the FPSCR doesn't affect the
behaviour of lfs and stfs, and is not affected by them.  So in fact 4
out of the 7 instructions in each of those procedures are unnecessary
(and similarly for the cvt_fd/df used in the alignment fixup code).

Paul.

  parent reply	other threads:[~2010-05-31 22:40 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-31 19:59 [PATCH] KVM: PPC: elide struct thread_struct instances from stack Andreas Schwab
2010-05-31 19:59 ` Andreas Schwab
2010-05-31 19:59 ` Andreas Schwab
     [not found] ` <m26323onam.fsf-hBGjKatGTSWzQB+pC5nmwQ@public.gmane.org>
2010-05-31 20:00   ` Alexander Graf
2010-05-31 20:00     ` Alexander Graf
2010-05-31 20:00     ` Alexander Graf
2010-05-31 22:40   ` Paul Mackerras [this message]
2010-05-31 22:40     ` Paul Mackerras
2010-05-31 22:40     ` Paul Mackerras
2010-05-31 23:27     ` Alexander Graf
2010-05-31 23:27       ` Alexander Graf
2010-05-31 23:27       ` Alexander Graf
     [not found]     ` <20100531224040.GA22927-oklZEfemRj05kJ7NmlRacFaTQe2KTcn/@public.gmane.org>
2010-06-01  8:36       ` Andreas Schwab
2010-06-01  8:36         ` Andreas Schwab
2010-06-01  8:36         ` Andreas Schwab
     [not found]         ` <m3r5krrvy2.fsf-YqIcNwjZo96zQB+pC5nmwQ@public.gmane.org>
2010-06-01  9:19           ` Alexander Graf
2010-06-01  9:19             ` Alexander Graf
2010-06-01  9:19             ` Alexander Graf
2010-06-02 16:00 ` Marcelo Tosatti
2010-06-02 16:00   ` Marcelo Tosatti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100531224040.GA22927@brick.ozlabs.ibm.com \
    --to=paulus@samba.org \
    --cc=agraf-l3A5Bk7waGM@public.gmane.org \
    --cc=kvm-ppc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linuxppc-dev-mnsaURCQ41sdnm+yROfE0A@public.gmane.org \
    --cc=schwab-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.