From: Scott Wood <scottwood@freescale.com>
To: Mihai Caraman <mihai.caraman@freescale.com>
Cc: Mihai Caraman <mihai.caraman@freescale.com>,
linuxppc-dev@lists.ozlabs.org, kvm@vger.kernel.org,
kvm-ppc@vger.kernel.org
Subject: Re: [PATCH 3/7 v2] KVM: PPC: e500: Add support for TLBnPS registers
Date: Tue, 26 Mar 2013 17:48:31 -0500 [thread overview]
Message-ID: <1364338111.469.17@snotra> (raw)
In-Reply-To: <1364335512-28426-4-git-send-email-mihai.caraman@freescale.com> (from mihai.caraman@freescale.com on Tue Mar 26 17:05:08 2013)
On 03/26/2013 05:05:08 PM, Mihai Caraman wrote:
> diff --git a/arch/powerpc/kvm/e500.h b/arch/powerpc/kvm/e500.h
> index b73ca7a..795934d 100644
> --- a/arch/powerpc/kvm/e500.h
> +++ b/arch/powerpc/kvm/e500.h
> @@ -23,6 +23,8 @@
> #include <asm/mmu-book3e.h>
> #include <asm/tlb.h>
>=20
> +#define VCPU_FTR_MMU_V2 0
enum? We don't care about the actual value here.
> #define E500_PID_NUM 3
> #define E500_TLB_NUM 2
>=20
> @@ -299,4 +301,18 @@ static inline unsigned int =20
> get_tlbmiss_tid(struct kvm_vcpu *vcpu)
> #define get_tlb_sts(gtlbe) (MAS1_TS)
> #endif /* !BOOKE_HV */
>=20
> +static inline bool has_feature(const struct kvm_vcpu *vcpu,
> + unsigned long vcpu_ftr)
> +{
> + bool has_ftr;
> + switch (vcpu_ftr) {
> + case VCPU_FTR_MMU_V2:
> + has_ftr =3D ((vcpu->arch.mmucfg & MMUCFG_MAVN) =3D=3D =20
> MMUCFG_MAVN_V2);
> + break;
> + default:
> + has_ftr =3D false;
> + }
> + return has_ftr;
> +}
vcpu_has_feature()
Can simplify by replacing has_ftr with "return true" and "return false".
-Scott=
next prev parent reply other threads:[~2013-03-26 22:48 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-26 22:05 [PATCH 0/7 v2] KVM: PPC: e500: Enable FSL e6500 core Mihai Caraman
2013-03-26 22:05 ` [PATCH 1/7 v2] KVM: PPC: e500: Expose MMU registers via ONE_REG Mihai Caraman
2013-03-27 15:58 ` Alexander Graf
2013-03-26 22:05 ` [PATCH 2/7 v2] KVM: PPC: e500: Move vcpu's MMU configuration to dedicated functions Mihai Caraman
2013-03-26 22:05 ` [PATCH 3/7 v2] KVM: PPC: e500: Add support for TLBnPS registers Mihai Caraman
2013-03-26 22:48 ` Scott Wood [this message]
2013-03-26 22:05 ` [PATCH 4/7 v2] KVM: PPC: e500: Add support for EPTCFG register Mihai Caraman
2013-03-27 17:21 ` Alexander Graf
2013-03-26 22:05 ` [PATCH 5/7 v2] KVM: PPC: e500: Remove E.PT and E.HV.LRAT categories from VCPUs Mihai Caraman
2013-03-27 17:23 ` Alexander Graf
2013-03-27 17:50 ` Scott Wood
2013-03-26 22:05 ` [PATCH 6/7 v2] KVM: PPC: e500mc: Enable e6500 cores Mihai Caraman
2013-03-26 22:05 ` [PATCH 7/7 v2] KVM: PPC: e500: Add e6500 core to Kconfig description Mihai Caraman
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=1364338111.469.17@snotra \
--to=scottwood@freescale.com \
--cc=kvm-ppc@vger.kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mihai.caraman@freescale.com \
/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 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).