All of lore.kernel.org
 help / color / mirror / Atom feed
From: "José Pekkarinen" <jose.pekkarinen@foxhound.fi>
To: Peter Gonda <pgonda@google.com>
Cc: x86@kernel.org, hpa@zytor.com, kvm@vger.kernel.org,
	seanjc@google.com, dave.hansen@linux.intel.com,
	linux-kernel@vger.kernel.org, mingo@redhat.com, bp@alien8.de,
	pbonzini@redhat.com, tglx@linutronix.de,
	linux-kernel-mentees@lists.linuxfoundation.org
Subject: Re: [PATCH] kvm/sev: make SEV/SEV-ES asids configurable
Date: Tue, 10 Oct 2023 21:03:38 +0300	[thread overview]
Message-ID: <8fd78d002d84f3164eb5a9337e694fa1@foxhound.fi> (raw)
In-Reply-To: <CAMkAt6o7urak_kAjxEU4wtXv-mGOnyOYdcyhCRMfAG3MAOip0g@mail.gmail.com>

On 2023-10-10 19:49, Peter Gonda wrote:
> On Tue, Oct 10, 2023 at 5:22 AM José Pekkarinen
> <jose.pekkarinen@foxhound.fi> wrote:
>> 
>> There are bioses that doesn't allow to configure the
>> number of asids allocated for SEV/SEV-ES, for those
>> cases, the default behaviour allocates all the asids
>> for SEV, leaving no room for SEV-ES to have some fun.
>> If the user request SEV-ES to be enabled, it will
>> find the kernel just run out of resources and ignored
>> user request. This following patch will address this
>> issue by making the number of asids for SEV/SEV-ES
>> configurable over kernel module parameters.
>> 
> 
> All this patch does is introduce an error case right? Because if the
> BIOS hasn't actually configured those SEV-ES asids and KVM tries to
> use an SEV as an SEV-ES asid commands to the ASP will fail, right?
> 
> What happens when you try to create an SEV-ES VM with this patch, when
> the BIOS hasn't allocated any SEV-ES asids?

     It still doesn't enable SEV-ES since the cpu exposes
min_sev_asids as 1, and there is a check to bail out in
the hardware setup function, so definitely this is not
fixing anything. I may not being understanding something
here though, since my BIOS doesn't seem to have any options
nor hints about SEV-ES, so I'm not quite sure it really
does something to provide the functionality. For the records
it is a Supermicro H11SSL-NC.

     Thanks!

     José.
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

WARNING: multiple messages have this Message-ID (diff)
From: "José Pekkarinen" <jose.pekkarinen@foxhound.fi>
To: Peter Gonda <pgonda@google.com>
Cc: seanjc@google.com, pbonzini@redhat.com,
	skhan@linuxfoundation.org, tglx@linutronix.de, mingo@redhat.com,
	bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org,
	hpa@zytor.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-kernel-mentees@lists.linuxfoundation.org
Subject: Re: [PATCH] kvm/sev: make SEV/SEV-ES asids configurable
Date: Tue, 10 Oct 2023 21:03:38 +0300	[thread overview]
Message-ID: <8fd78d002d84f3164eb5a9337e694fa1@foxhound.fi> (raw)
In-Reply-To: <CAMkAt6o7urak_kAjxEU4wtXv-mGOnyOYdcyhCRMfAG3MAOip0g@mail.gmail.com>

On 2023-10-10 19:49, Peter Gonda wrote:
> On Tue, Oct 10, 2023 at 5:22 AM José Pekkarinen
> <jose.pekkarinen@foxhound.fi> wrote:
>> 
>> There are bioses that doesn't allow to configure the
>> number of asids allocated for SEV/SEV-ES, for those
>> cases, the default behaviour allocates all the asids
>> for SEV, leaving no room for SEV-ES to have some fun.
>> If the user request SEV-ES to be enabled, it will
>> find the kernel just run out of resources and ignored
>> user request. This following patch will address this
>> issue by making the number of asids for SEV/SEV-ES
>> configurable over kernel module parameters.
>> 
> 
> All this patch does is introduce an error case right? Because if the
> BIOS hasn't actually configured those SEV-ES asids and KVM tries to
> use an SEV as an SEV-ES asid commands to the ASP will fail, right?
> 
> What happens when you try to create an SEV-ES VM with this patch, when
> the BIOS hasn't allocated any SEV-ES asids?

     It still doesn't enable SEV-ES since the cpu exposes
min_sev_asids as 1, and there is a check to bail out in
the hardware setup function, so definitely this is not
fixing anything. I may not being understanding something
here though, since my BIOS doesn't seem to have any options
nor hints about SEV-ES, so I'm not quite sure it really
does something to provide the functionality. For the records
it is a Supermicro H11SSL-NC.

     Thanks!

     José.

  reply	other threads:[~2023-10-10 18:11 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-10 10:04 [PATCH] kvm/sev: make SEV/SEV-ES asids configurable José Pekkarinen
2023-10-10 10:04 ` José Pekkarinen
2023-10-10 11:35 ` Greg KH
2023-10-10 11:35   ` Greg KH
2023-10-10 11:40   ` Paolo Bonzini
2023-10-10 11:40     ` Paolo Bonzini
2023-10-10 12:20     ` José Pekkarinen
2023-10-10 12:20       ` José Pekkarinen
2023-10-10 12:01   ` José Pekkarinen
2023-10-10 12:01     ` José Pekkarinen
2023-10-10 16:49 ` Peter Gonda via Linux-kernel-mentees
2023-10-10 16:49   ` Peter Gonda
2023-10-10 18:03   ` José Pekkarinen [this message]
2023-10-10 18:03     ` José Pekkarinen

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=8fd78d002d84f3164eb5a9337e694fa1@foxhound.fi \
    --to=jose.pekkarinen@foxhound.fi \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel-mentees@lists.linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=pgonda@google.com \
    --cc=seanjc@google.com \
    --cc=tglx@linutronix.de \
    --cc=x86@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 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.