[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 9/9] RFC: Everything else


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 30 Mar 2023 14:06:52 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+F2yNd1m93iz4OwNbeQZ9bzI/XC3/pXi6YNmHT3v4jc=; b=CoEK0ioQlnTxPRm0pk55Y0EVw/zuyoL9HAVGDF6QEKXjjcY4wak2UotD3/vIZAdTyB8ogd3Dj4DdvVW1WpuWTCvQ1y2shkY6Bp7gvCWUosnMiKgf9Wpv/p26Gxi5bzuVDaveNEcajVdMbndOK1DXdSZoeFKfUjs8Wic59I1qV6Psm6mHwCFON4Ci5ryhZtriGkCehHS8OEZkthda6z3qsUcJbybK3C56rS3PoR9CXxgelaEs5QZlXseHZzrAmNRZnvs+DTtEBX8EDSomilbnT+iPtPGsQjhXq1+cOkZWkc3q97N2tD7gx2fGsUXz38s3XNAwsd2xvNXv/AQFTC6ewg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mIxKAOfWin6DAf8Qq0pP7zyI82pZbQAQB4m/NfLFqxRxoY1Zc7EliMg9vK716WM8pp3bmODuiHU1D6ny7tHqj8F9nrw2yLY7XJOI1Kq7SCnYrGoc/C8pqyzXLMHnURxHbBaD3NJfE7f4y5ZCDHBMzskSACmOOlYj1eFNbQZkY/wwY+PnYi23MGyiU0SlqKxVJypN4Q5j+IlHaWisisvNTg27+NGiEVoqGD/ieF/u6lL+xjXKgnoIJ8vtrXgJMQ594Nh9cKSkg9N4eTrXFKSnKJW8pAXLFAX+rDvkLetE0dVSWzA/aC+swPHz2RpqT/pHieDEX092+oQAKAeBnKF3dQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 30 Mar 2023 12:07:10 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 30.03.2023 14:01, Andrew Cooper wrote:
> On 30/03/2023 11:16 am, Jan Beulich wrote:
>> On 29.03.2023 22:51, Andrew Cooper wrote:
>>> Looking at this diff, I'm wondering whether keeping
>>>
>>>     union {
>>>         struct cpu_policy *cpuid;
>>>         struct cpu_policy *cpu_policy;
>>>     };
>>>
>>> permentantly might be a good idea, because d->arch.cpuid->$X reads rather
>>> better than d->arch.cpu_policy->$X
>>>
>>> Thoughts?
>> I'm not overly fussed, but perhaps yes.
> 
> If we were to do this, we ought to keep d->arch.msr too for the same reason.

I'm not sure this is necessarily a consequence.

> (Honestly - I'm still undecided on whether this is a good idea or not...)
> 
>>  Nevertheless e.g. ...
>>
>>> --- a/tools/fuzz/x86_instruction_emulator/fuzz-emul.c
>>> +++ b/tools/fuzz/x86_instruction_emulator/fuzz-emul.c
>>> @@ -893,7 +893,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data_p, 
>>> size_t size)
>>>      struct x86_emulate_ctxt ctxt = {
>>>          .data = &state,
>>>          .regs = &input.regs,
>>> -        .cpuid = &cp,
>>> +        .cpu_policy = &cp,
>> ... this and ...
>>
>>> --- a/tools/tests/x86_emulator/test_x86_emulator.c
>>> +++ b/tools/tests/x86_emulator/test_x86_emulator.c
>>> @@ -909,7 +909,7 @@ int main(int argc, char **argv)
>>>  
>>>      ctxt.regs = &regs;
>>>      ctxt.force_writeback = 0;
>>> -    ctxt.cpuid     = &cp;
>>> +    ctxt.cpu_policy = &cp;
>> ... this imo want keeping as you have it here.
> 
> Ok, so that's a firm "switch to using cpu_policy for emul_ctxt" then.
> 
> Which is fine - in fact it's one I'd already started splitting out of
> this patch.

Hmm, wait - CPUID "basic" and "feat" and alike uses I still would prefer
to see using "cpuid". It's really only such initializers which (imo
even logically) want to use the name with the wider coverage.

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.