|
From: | Philippe Mathieu-Daudé |
Subject: | Re: [Qemu-devel] [PATCH v2] strongarm: mask off high[32:28] bits from dir and state registers |
Date: | Tue, 30 Oct 2018 14:25:33 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 |
On 30/10/18 12:49, P J P wrote:
+-- On Mon, 29 Oct 2018, Peter Maydell wrote --+ | > switch (offset) { | > case GPDR: /* GPIO Pin-Direction registers */ | > - s->dir = value; | > + s->dir = value & 0x3fffff; | | The commit message says it's masking [31:28], but the | code is masking [31:22]. The SA1110 spec suggests the | commit message is correct and the code is not. Ouch, sorry! Sent revised patch v3.
That's where the extract32() is more convenient and less bug prone: s->dir = extract32(value, 0, 28); /* mask off [31:28] */
Thank you. -- Prasad J Pandit / Red Hat Product Security Team 47AF CE69 3A90 54AA 9045 1053 DD13 3D32 FE5B 041F
[Prev in Thread] | Current Thread | [Next in Thread] |