On 10 March 2015 at 17:28, Andrew Jones <drjo...@redhat.com> wrote: > On Tue, Mar 10, 2015 at 05:14:21PM +0000, Peter Maydell wrote:[?] >> No, because patch 2 doesn't do anything in the callers to >> make them pass only bits [2:1]. So after patch 2 get_rw_prot >> still requires bits [2:0]. Except it's broken, because the >> function itself assumes it gets bits [2:1]. > > You've lost me. Patch 2 adds support for 2-bit ap, but > doesn't remove support for 3-bit. There are not callers > expecting it to support the simple model as 2 or 3 bits > at that time, except v6, but that was broken already, and > we fix it in patch 5 (and we add the ap shift there too). > IOW, how can preparing a function for new callers, while > still supporting the old callers, be 'broken'?
(This is all somewhat academic at this point given we're splitting the two functions up, but:) Because it's not being consistent with itself -- if it wants to accept AP[2:1] only then the v6 callsite needs to change, otherwise it needs to handle AP[2:0] and look only at bits 2:1 in that. You eventually fixed this in patch 5 with an extra shift, but if you wanted to do it that way then that part should have been in patch 2... -- PMM