public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Claudio Imbrenda <imbrenda@linux.ibm.com>
To: Steffen Eiden <seiden@linux.ibm.com>
Cc: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org,
	kvm@vger.kernel.org, Janosch Frank <frankja@linux.ibm.com>,
	David Hildenbrand <david@redhat.com>,
	Michael Mueller <mimu@linux.vnet.ibm.com>,
	Marc Hartmayer <mhartmay@linux.ibm.com>
Subject: Re: [PATCH 3/3] KVM: s390: pv:  Allow AP-instructions for pv guests
Date: Thu, 27 Jul 2023 17:07:24 +0200	[thread overview]
Message-ID: <20230727170724.7adb71fa@p-imbrenda> (raw)
In-Reply-To: <20230727122053.774473-4-seiden@linux.ibm.com>

On Thu, 27 Jul 2023 14:20:53 +0200
Steffen Eiden <seiden@linux.ibm.com> wrote:

> Introduces new feature bits and enablement flags for AP and AP IRQ
> support.
> 
> Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
> ---
>  arch/s390/include/asm/uv.h | 12 +++++++++++-
>  arch/s390/kvm/pv.c         |  8 ++++++--
>  2 files changed, 17 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/s390/include/asm/uv.h b/arch/s390/include/asm/uv.h
> index 338845402324..913ccfaa9d76 100644
> --- a/arch/s390/include/asm/uv.h
> +++ b/arch/s390/include/asm/uv.h
> @@ -99,6 +99,8 @@ enum uv_cmds_inst {
>  enum uv_feat_ind {
>  	BIT_UV_FEAT_MISC = 0,
>  	BIT_UV_FEAT_AIV = 1,
> +	BIT_UV_FEAT_AP = 4,
> +	BIT_UV_FEAT_AP_INTR = 5,
>  };
>  
>  struct uv_cb_header {
> @@ -159,7 +161,15 @@ struct uv_cb_cgc {
>  	u64 guest_handle;
>  	u64 conf_base_stor_origin;
>  	u64 conf_virt_stor_origin;
> -	u64 reserved30;
> +	u8  reserved30[6];
> +	union {
> +		struct {
> +			u16 reserved : 14;
> +			u16 ap_instr_intr : 1;
> +			u16 ap_allow_instr : 1;
> +		};
> +		u16 raw;
> +	} flags;
>  	u64 guest_stor_origin;
>  	u64 guest_stor_len;
>  	u64 guest_sca;
> diff --git a/arch/s390/kvm/pv.c b/arch/s390/kvm/pv.c
> index 899f3b8ac011..103add1894c9 100644
> --- a/arch/s390/kvm/pv.c
> +++ b/arch/s390/kvm/pv.c
> @@ -561,12 +561,16 @@ int kvm_s390_pv_init_vm(struct kvm *kvm, u16 *rc, u16 *rrc)
>  	uvcb.conf_base_stor_origin =
>  		virt_to_phys((void *)kvm->arch.pv.stor_base);
>  	uvcb.conf_virt_stor_origin = (u64)kvm->arch.pv.stor_var;
> +	uvcb.flags.ap_allow_instr = uv_has_feature(BIT_UV_FEAT_AP) &&
> +				    kvm->arch.model.uv_feat_guest.ap;

how can it happen that uv_feat_guest.ap is set but
uv_has_feature(BIT_UV_FEAT_AP) is 0 ?

in the previous patch you check for the feature before allowing the bit
to be set.

> +	uvcb.flags.ap_instr_intr = uv_has_feature(BIT_UV_FEAT_AP_INTR) &&
> +				   kvm->arch.model.uv_feat_guest.ap_intr;

same here

>  
>  	cc = uv_call_sched(0, (u64)&uvcb);
>  	*rc = uvcb.header.rc;
>  	*rrc = uvcb.header.rrc;
> -	KVM_UV_EVENT(kvm, 3, "PROTVIRT CREATE VM: handle %llx len %llx rc %x rrc %x",
> -		     uvcb.guest_handle, uvcb.guest_stor_len, *rc, *rrc);
> +	KVM_UV_EVENT(kvm, 3, "PROTVIRT CREATE VM: handle %llx len %llx rc %x rrc %x flags %04x",
> +		     uvcb.guest_handle, uvcb.guest_stor_len, *rc, *rrc, uvcb.flags.raw);
>  
>  	/* Outputs */
>  	kvm->arch.pv.handle = uvcb.guest_handle;


      reply	other threads:[~2023-07-27 15:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-27 12:20 [PATCH 0/3] KVM: s390: Enable AP instructions for pv-guests Steffen Eiden
2023-07-27 12:20 ` [PATCH 1/3] s390: uv: UV feature check utility Steffen Eiden
2023-07-27 14:42   ` Claudio Imbrenda
2023-07-27 12:20 ` [PATCH 2/3] KVM: s390: Add UV feature negotiation Steffen Eiden
2023-07-27 15:02   ` Claudio Imbrenda
2023-07-27 12:20 ` [PATCH 3/3] KVM: s390: pv: Allow AP-instructions for pv guests Steffen Eiden
2023-07-27 15:07   ` Claudio Imbrenda [this message]

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=20230727170724.7adb71fa@p-imbrenda \
    --to=imbrenda@linux.ibm.com \
    --cc=david@redhat.com \
    --cc=frankja@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=mhartmay@linux.ibm.com \
    --cc=mimu@linux.vnet.ibm.com \
    --cc=seiden@linux.ibm.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