lkml.org 
[lkml]   [2022]   [Apr]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH v3 02/21] x86/virt/tdx: Detect TDX private KeyIDs
    From
    Date
    On Mon, 2022-04-18 at 22:42 -0700, Sathyanarayanan Kuppuswamy wrote:
    >
    > On 4/5/22 9:49 PM, Kai Huang wrote:
    > > detect_seam(c);
    > > + detect_tdx_keyids(c);
    >
    > Do you want to add some return value to detect_seam() and not
    > proceed if it fails?

    I don't think this function should return. However it may make sense to stop
    detecting TDX KeyIDs when on some cpu SEAMRR is detected as not enabled (i.e. on
    BSP when SEAMRR is not enabled by BIOS, or on any AP when there's BIOS bug that
    BIOS doesn't configure SEAMRR consistently on all cpus). The reason is TDX
    KeyIDs can only be accessed by software runs in SEAM mode. So if SEAMRR
    configuration is broken, TDX KeyID configuration probably is broken too.

    However detect_tdx_keyids() essentially only uses rdmsr_safe() to read some MSR,
    so if there's any problem, rdmsr_safe() will catch it. And SEAMRR is always
    checked before doing any TDX related staff later, therefore in practice there
    will be no problem. But anyway I guess there's no harm to add additional SEAMRR
    check in detect_tdx_keyids(). I'll think more on this. Thanks.

    >
    > In case if this function is going to be extended by future
    > patch set, maybe do the same for detect_tdx_keyids()?
    >

    I'd prefer to leaving this in current way until there's a real need.

    --
    Thanks,
    -Kai


    \
     
     \ /
      Last update: 2022-04-19 12:08    [W:3.942 / U:0.024 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site