[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH] x86/vmce: Dispatch vmce_{rd,wr}msr() from guest_{rd,wr}msr()
On 23/07/2020 12:30, Roger Pau Monné wrote: > On Thu, Jul 23, 2020 at 12:00:53PM +0100, Andrew Cooper wrote: >> On 23/07/2020 11:07, Roger Pau Monné wrote: >>> On Wed, Jul 22, 2020 at 11:18:09AM +0100, Andrew Cooper wrote: >>>> + case MSR_IA32_MCG_CAP ... MSR_IA32_MCG_CTL: /* 0x179 -> >>>> 0x17b */ >>>> + case MSR_IA32_MCx_CTL2(0) ... MSR_IA32_MCx_CTL2(31): /* 0x280 -> >>>> 0x29f */ >>>> + case MSR_IA32_MCx_CTL(0) ... MSR_IA32_MCx_MISC(31): /* 0x400 -> >>>> 0x47f */ >>> Where do you get the ranges from 0 to 31? It seems like the count >>> field in the CAP register is 8 bits, which could allow for up to 256 >>> banks? >>> >>> I'm quite sure this would then overlap with other MSRs? >> Irritatingly, nothing I can find actually states an upper architectural >> limit. >> >> SDM Vol4, Table 2-2 which enumerates the Architectural MSRs. >> >> 0x280 thru 0x29f are explicitly reserved MCx_CTL2, which is a limit of >> 32 banks. There are gaps after this in the architectural table, but >> IceLake has PRMRR_BASE_0 at 0x2a0. >> >> The main bank of MCx_{CTL,STATUS,ADDR,MISC} start at 0x400 and are >> listed in the table up to 0x473, which is a limit of 29 banks. The >> Model specific table for SandyBridge fills in the remaining 3 banks up >> to MSR 0x47f, which is the previous limit of 32 banks. (These MSRs have >> package scope rather than core/thread scope, but they are still >> enumerated architecturally so I'm not sure why they are in the model >> specific tables.) >> >> More importantly however, the VMX MSR range starts at 0x480, immediately >> above bank 31, which puts an architectural hard limit on the number of >> banks. > Yes, realized about the VMX MSRs starting at 0x480, which limits the > number of banks. Maybe a small comment about the fact that albeit the > count in the CAP register could go up to 256 32 is the actual limit > due to how MSRs are arranged? Ok. I've added: The bank limit of 32 isn't stated anywhere I can locate, but is a consequence of the MSR layout described in SDM Volume 4. as another paragraph to the commit message. > Note there's also GUEST_MC_BANK_NUM which is the actual implementation > limit in Xen AFAICT, maybe using it here would be clearer? (and limit > the ranges forwarded to vmce_rdmsr) First, there is a note saying that older versions of Xen advertised more than 2 banks to guests (and therefore we might see such a guest migrated in), and second, capturing all MSRs is a bug I'm specifically fixing with this change, and was called out in the commit message. These MSRs, even beyond the banks implemented by the guest, are still MCE banks, and need handling appropriately as "out of range banks", which isn't necessarily the same as falling into the general default MSR path. ~Andrew
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |