Linux KVM/arm64 development list
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Will Deacon <will@kernel.org>
Cc: kvmarm@lists.cs.columbia.edu
Subject: Re: VM live migration failed from Linux v5.9 to Linux v5.10-rc1
Date: Mon, 02 Nov 2020 10:50:04 +0000	[thread overview]
Message-ID: <511aa7301bbead28f74aa4fb460a4e8e@kernel.org> (raw)
In-Reply-To: <20201102102930.GA3226@willie-the-truck>

On 2020-11-02 10:29, Will Deacon wrote:
> On Sat, Oct 31, 2020 at 01:25:17PM +0000, Marc Zyngier wrote:

[...]

>> +static int set_id_aa64pfr0_el1(struct kvm_vcpu *vcpu,
>> +			       const struct sys_reg_desc *rd,
>> +			       const struct kvm_one_reg *reg, void __user *uaddr)
>> +{
>> +	const u64 id = sys_reg_to_index(rd);
>> +	int err;
>> +	u64 val;
>> +	u8 csv2;
>> +
>> +	err = reg_from_user(&val, uaddr, id);
>> +	if (err)
>> +		return err;
>> +
>> +	/*
>> +	 * Allow AA64PFR0_EL1.CSV2 to be set from userspace as long as
>> +	 * it doesn't promise more than what is actually provided (the
>> +	 * guest could otherwise be covered in ectoplasmic residue).
>> +	 */
>> +	csv2 = FIELD_GET(0xfUL << ID_AA64PFR0_CSV2_SHIFT, val);
>> +	if (csv2 > vcpu->kvm->arch.pfr0_csv2)
>> +		return -EINVAL;
>> +	vcpu->kvm->arch.pfr0_csv2 = csv2;
> 
> We might need to be careful here, as this means the guest can now see a
> value of '2' and expect to use the SCXTNUM registers. I haven't checked
> what we do with those, but we never advertise them in the current code
> afaict.

I think a guest can already see CSV2=2 if supported on all the physical
CPUs (the current logic only overrides CSV2 if it is zero). Pretty easy
to fix (just cap it to 1), but we should definitely add the switching
capability to support CSV2=2.

I'll have a look at an additional patch address this.

         M.
-- 
Jazz is not dead. It just smells funny...
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

      reply	other threads:[~2020-11-02 10:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-31  7:03 VM live migration failed from Linux v5.9 to Linux v5.10-rc1 Peng Liang
2020-10-31 13:25 ` Marc Zyngier
2020-11-02  3:12   ` Peng Liang
2020-11-02  7:32     ` Peng Liang
2020-11-02  9:29     ` Marc Zyngier
2020-11-02 10:29   ` Will Deacon
2020-11-02 10:50     ` Marc Zyngier [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=511aa7301bbead28f74aa4fb460a4e8e@kernel.org \
    --to=maz@kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=will@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox