qemu-ppc
[Top][All Lists]
Advanced

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

Re: [PATCH v4 07/17] target/ppc: Disconnect hflags from MSR


From: Richard Henderson
Subject: Re: [PATCH v4 07/17] target/ppc: Disconnect hflags from MSR
Date: Tue, 23 Mar 2021 11:04:03 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1

On 3/22/21 5:54 PM, David Gibson wrote:
On Mon, Mar 22, 2021 at 10:55:46AM -0600, Richard Henderson wrote:
On 3/21/21 9:52 PM, David Gibson wrote:
+/*
+ * Bits for env->hflags.
+ *
+ * Most of these bits overlap with corresponding bits in MSR,
+ * but some come from other sources.  Be cautious when modifying.

Yeah.. I'm not sure "be cautious" is enough of a warning.  The exact
value of some but not all of these flags must equal that for the
corresponding MSR bits, which is terrifyingly subtle.

Fair.  How about, for the comment here, "This is validated in 
hreg_compute_hflags."

+    /* Some bits come straight across from MSR. */
+    msr_mask = ((1 << MSR_LE) | (1 << MSR_PR) |
+                (1 << MSR_DR) | (1 << MSR_IR) |
+                (1 << MSR_FP) | (1 << MSR_SA) | (1 << MSR_AP));

Here, and in every other spot within this function where we manipulate msr_mask,

     QEMU_BUILD_BUG_ON(MSR_LE != HFLAGS_LE);

Seems reasonable.


Hah.  Your paranoia was well-founded.  Typo in HFLAGS_PR.  :-)


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]