qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Cc: kvm@vger.kernel.org,
	"Daniel Henrique Barboza" <dbarboza@ventanamicro.com>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	"Michael Tokarev" <mjt@tls.msk.ru>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Marcelo Tosatti" <mtosatti@redhat.com>,
	"Daniel P . Berrangé" <berrange@redhat.com>,
	"Kevin Wolf" <kwolf@redhat.com>
Subject: Re: [RFC PATCH v4 2/3] target/i386: Restrict system-specific features from user emulation
Date: Wed, 13 Sep 2023 11:02:10 +0200	[thread overview]
Message-ID: <361eaa5e-67d4-bce0-679b-8faf6cb5ce32@linaro.org> (raw)
In-Reply-To: <c33130ec-661a-a1ed-c285-eeaa52365358@redhat.com>

On 12/9/23 16:05, Paolo Bonzini wrote:
> On 9/11/23 23:13, Philippe Mathieu-Daudé wrote:
>>   /*
>>    * Only for builtin_x86_defs models initialized with 
>> x86_register_cpudef_types.
>>    */
>> @@ -6163,6 +6195,7 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t 
>> index, uint32_t count,
>>               }
>>               *edx = env->features[FEAT_7_0_EDX]; /* Feature flags */
>> +#ifndef CONFIG_USER_ONLY
>>               /*
>>                * SGX cannot be emulated in software.  If hardware does 
>> not
>>                * support enabling SGX and/or SGX flexible launch control,
>> @@ -6181,6 +6214,7 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t 
>> index, uint32_t count,
>>                       CPUID_7_0_ECX_SGX_LC))) {
>>                   *ecx &= ~CPUID_7_0_ECX_SGX_LC;
>>               }
>> +#endif
> 
> This can use a variant of x86_cpu_get_supported_cpuid that returns a 
> single register; or it can be rewritten to use x86_cpu_get_supported_cpuid.

Great suggestion, thanks!

> In general, a lot of checks for accel_uses_host_cpuid() are unnecessary, 
> and the code can be modified to not depend on either KVM or HVF.

OK.


  reply	other threads:[~2023-09-13  9:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-11 21:13 [PATCH v4 0/3] target/i386: Restrict system-specific features from user emulation Philippe Mathieu-Daudé
2023-09-11 21:13 ` [PATCH v4 1/3] target/i386: Check kvm_hyperv_expand_features() return value Philippe Mathieu-Daudé
2023-09-11 21:13 ` [RFC PATCH v4 2/3] target/i386: Restrict system-specific features from user emulation Philippe Mathieu-Daudé
2023-09-12 14:05   ` Paolo Bonzini
2023-09-13  9:02     ` Philippe Mathieu-Daudé [this message]
2023-09-11 21:13 ` [PATCH v4 3/3] target/i386: Prohibit target specific KVM prototypes on " Philippe Mathieu-Daudé
2023-09-12 14:07 ` [PATCH v4 0/3] target/i386: Restrict system-specific features from " Paolo Bonzini
2023-09-12 16:44   ` Philippe Mathieu-Daudé
2023-09-12 17:25     ` Paolo Bonzini
2023-09-13  9:26       ` Philippe Mathieu-Daudé

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=361eaa5e-67d4-bce0-679b-8faf6cb5ce32@linaro.org \
    --to=philmd@linaro.org \
    --cc=berrange@redhat.com \
    --cc=dbarboza@ventanamicro.com \
    --cc=kvm@vger.kernel.org \
    --cc=kwolf@redhat.com \
    --cc=mjt@tls.msk.ru \
    --cc=mtosatti@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=stefanha@redhat.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).