On 20/11/2017 02:04, Liran Alon wrote: >> > First of all, I understand we agree that what I mentioned is indeed a > bug in original commit? > > Second, if I understood original commit purpose correctly, you want to > make sure s->regs APIC_LDR value is correct and matches the s->regs > APIC_ID value. Instead of trusting userspace providing these values > synced correctly. Therefore, you should re-calc LDR regardless of if > x2apic_format was used by userspace or not. > > BTW, I would expect that if this is the intent, there should also be a > commit which adds the "if (*id != vcpu->vcpu_id)" check to the case of > the non-x2apic_format after value was shifted-right by 24. I'm not sure you can do that for backwards-compatibility reasons. I'm applying your fixup, thanks. Paolo