|
From: | Richard Henderson |
Subject: | Re: [PATCH v4 07/17] target/ppc: Disconnect hflags from MSR |
Date: | Mon, 22 Mar 2021 10:55:46 -0600 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 |
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); etc. r~
[Prev in Thread] | Current Thread | [Next in Thread] |