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

Re: [PATCH 2/5] x86/ucode: Fold early_update_cache() into microcode_init_cache()


  • To: George Dunlap <dunlapg@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 29 Mar 2023 11:26:06 +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=5dHrHk7e7MWwaapL9Sz1b672jKFXAfjfMAQ5upDJ++o=; b=cWTeou4zpQo+vlCTiHRmA9ONmbz5wzKfmVybw5S3oOPQU50KNHPWTbOPhZ/Z1CIK2oymMvMHMR63mbIW/T/iEgapNQCASH46TSXOnN6zyd3IHdmxpHvuSRrR+qOVs4RGcDo+tPSFfN2q4D3igKxMuZHC+joTYT715yzdmAHhDSj4LYwNOxCVzRU8Ja/olEmhv/OT29FWPkR2OcikjPXIkCkWVL3nuL1cMN4qpLiQ8baKQVOuq7vxRqtpPwLCQp9LTBz8IewW6Z5ANX2DUnuKHaEaJqmfpvABysxJEgjndXVGDRn2fnDRvYSqq/VHWlTUaZQG8CbmI/Z0xE8E2XrEjQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kxI31J9fQnEtViqO4fpM50E3qyxTdGQhtcbmUjmMFtxbU/DbP8/eHO6+b4HLBh6WVtPq/UFLpD9CTMeDsLKBSKbl3KHXLCzJJLdqQlw7TwMlm+g2SVp0zDd7Y/sGB44VB1Bo/CseneDNQMk690SZNwz/LpX42VYwoTKtWeS5g8DxTgSM+q7Q99/YC7OJ4HlIJ0H36IEPxm6zijv9o56xcgKuc1IpTR5eOBNQhocIGGDoq7z2Y1dBufyUJOFcUSP8UlSGBv7MaDp5w3ggUQpTW4p1Uc3tN43Id5WrlJRaRavTglq7lgEV61vJG9zrxBc3wyt3Qus5t1xlonGxpjgz7A==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Sergey Dyasli <sergey.dyasli@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 29 Mar 2023 09:26:22 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 29.03.2023 11:13, George Dunlap wrote:
> On Tue, Mar 28, 2023 at 4:58 PM Jan Beulich <jbeulich@xxxxxxxx> wrote:
> 
>> On 28.03.2023 17:07, Andrew Cooper wrote:
>>> On 28/03/2023 2:51 pm, Jan Beulich wrote:
>>>> On 27.03.2023 21:41, Andrew Cooper wrote:
>>>>> It is not valid to retain a bootstrap_map() across returning back to
>>>>> __start_xen(), but various pointers get stashed across calls.
>>>> It's error prone, yes, but "not valid" isn't really true imo: As long as
>>>> nothing calls bootstrap_map(NULL) all mappings will remain as they are.
>>>
>>> And how is this code supposed to know whether it's stashed pointer is
>>> any good or not?
>>>
>>> This is precisely "not valid" means.  It doesn't mean "it definitely
>>> doesn't work", but very much does mean "can't rely on it working".
>>
>> Hmm, not my understanding of "not valid".
>>
> 
> A "valid" approach or algorithm is one which can be relied on.  If an
> approach or algorithm may sometimes work or may sometimes not work, it's
> not valid.

Interesting. Still not my understanding of "not valid", not the least
because "may work" again depends on further aspects. In the case here,
carefully placed (or avoided) bootstrap_map(NULL) means the logic, which
has served us well for years, does always work - so long as you apply
sufficient care. Over time that "sufficient care" has arguably turned
into "overly much care", and hence Andrew's rework here is definitely an
improvement. All I dislike is to call things worse than they really are.
(Another thing would be if "sufficient care" wasn't applied at some
point, and if as a result we actually had active breakage somewhere.)

> That said:
> 
> * "Not valid" is kind of vague: it tells you think it's "bad", but not
> how.  (Even "racy" or "risky" or "error-prone" are more descriptive,
> because it prompts you for the types of problems to think about.) It's
> usually better to state exactly what problems might happen if you do X,
> rather than simply saying X is "not valid".
> 
> * It's usually better to propose specific alternate wording, rather than
> arguing about whether a given wording is... er, valid or not.

Which I did (without explicitly saying that this is an alternative wording
proposal) by starting with "It's error prone, ...". Similarly (iirc) in
replies elsewhere on this series' thread.

Jan



 


Rackspace

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