From: Madhavan Srinivasan <maddy@linux.ibm.com>
To: Gautam Menghani <gautam@linux.ibm.com>,
mpe@ellerman.id.au, npiggin@gmail.com,
christophe.leroy@csgroup.eu, naveen.n.rao@linux.ibm.com
Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
kvm@vger.kernel.org
Subject: Re: [PATCH v2] KVM: PPC: Book3S HV: Refactor HFSCR emulation for KVM guests
Date: Thu, 18 Jul 2024 09:21:13 +0530 [thread overview]
Message-ID: <d6edb26f-f19e-4296-8fea-07961ce24960@linux.ibm.com> (raw)
In-Reply-To: <20240716115206.70210-1-gautam@linux.ibm.com>
On 7/16/24 5:22 PM, Gautam Menghani wrote:
> Refactor HFSCR emulation for KVM guests when they exit out with
> H_FAC_UNAVAIL to use a switch case instead of checking all "cause"
> values, since the "cause" values are mutually exclusive; and this is
> better expressed with a switch case.
>
> Signed-off-by: Gautam Menghani <gautam@linux.ibm.com>
> ---
> V1 -> V2:
> 1. Reword changelog to point out mutual exclusivity of HFSCR bits.
> 2. Reword commit message to match other commits in book3s_hv.c
Minor: I guess you mean "Reword the subject line"
Reviewed-by: Madhavan Srinivasan <maddy@linux.ibm.com>
>
> arch/powerpc/kvm/book3s_hv.c | 16 ++++++++++++----
> 1 file changed, 12 insertions(+), 4 deletions(-)
>
> diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
> index daaf7faf21a5..50797b0611a2 100644
> --- a/arch/powerpc/kvm/book3s_hv.c
> +++ b/arch/powerpc/kvm/book3s_hv.c
> @@ -1922,14 +1922,22 @@ static int kvmppc_handle_exit_hv(struct kvm_vcpu *vcpu,
>
> r = EMULATE_FAIL;
> if (cpu_has_feature(CPU_FTR_ARCH_300)) {
> - if (cause == FSCR_MSGP_LG)
> + switch (cause) {
> + case FSCR_MSGP_LG:
> r = kvmppc_emulate_doorbell_instr(vcpu);
> - if (cause == FSCR_PM_LG)
> + break;
> + case FSCR_PM_LG:
> r = kvmppc_pmu_unavailable(vcpu);
> - if (cause == FSCR_EBB_LG)
> + break;
> + case FSCR_EBB_LG:
> r = kvmppc_ebb_unavailable(vcpu);
> - if (cause == FSCR_TM_LG)
> + break;
> + case FSCR_TM_LG:
> r = kvmppc_tm_unavailable(vcpu);
> + break;
> + default:
> + break;
> + }
> }
> if (r == EMULATE_FAIL) {
> kvmppc_core_queue_program(vcpu, SRR1_PROGILL |
next prev parent reply other threads:[~2024-07-18 3:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-16 11:52 Gautam Menghani
2024-07-18 3:51 ` Madhavan Srinivasan [this message]
2024-08-13 12:44 ` Michael Ellerman
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=d6edb26f-f19e-4296-8fea-07961ce24960@linux.ibm.com \
--to=maddy@linux.ibm.com \
--cc=christophe.leroy@csgroup.eu \
--cc=gautam@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=naveen.n.rao@linux.ibm.com \
--cc=npiggin@gmail.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
all inboxes | Powered by JetHome®