-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
source/cpu: detect Intel SGX #647
Conversation
Hi @mythi. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically looks good and simple to me.
Would it be useful to add other SGX attributes from klauspost/cpuid as raw features, now that we add this, WDYT? I'm thinking about these max enclave size etc.
if epcSize > 0 { | ||
sgx["enabled"] = "true" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we advertise epcSize
as the raw feature, directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to start with something minimal/basic and enabled
is consistent with the other cpu
source features. The boolean value can be taken into nodeSelector
directly which is my use case at least until #464 lands. Would there be any use for epcSize
other than using it in, e.g., {op: Gt, value: ["0"]}
?
I'm thinking about these max enclave size etc.
I'm not sure how useful they are. We could label, e.g., sgx2=true
but to actually use the feature the kernel support needs to be there and we cannot detect that. max enclave size value is a bit value for 2^(<value>)
computation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to start with something minimal/basic and
enabled
is consistent with the othercpu
source features. The boolean value can be taken intonodeSelector
directly which is my use case at least until #464 lands. Would there be any use forepcSize
other than using it in, e.g.,{op: Gt, value: ["0"]}
?
Yeah, for the label enabled
makes sense. I might be wrong but my intuition is that the better direction would be to expose "raw features" as raw as possible, avoiding any translations. More likely to avoid problems like the kernel module values (currently =y
and =m
now translate to true
and we have no means of telling between y or m). As you said, in this case enabled
would translate to {op: Gt, value: ["0"]}
in the custom rules. That said, I don't know what use people could find for the numerical value (expose it as an extended resource?). Maybe we should expose both, enabled
and epcSize
?
I'm thinking about these max enclave size etc.
I'm not sure how useful they are. We could label, e.g.,
sgx2=true
but to actually use the feature the kernel support needs to be there and we cannot detect that. max enclave size value is a bit value for2^(<value>)
computation.
K, can be added later, if needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expose it as an extended resource?). Maybe we should expose both,
enabled
andepcSize
?
We have an NFD source hook to read epcSize
and that value is registered as sgx.intel.com/epc
. I guess NFD could register the value too but why not then use the NFD source hook because it comes with the device plugin that is also needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/ok-to-test
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
rebased to latest master and force pushed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @mythi for this enhancement 👍 Let's merge this and expand functionality in future, if needed
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: marquiz, mythi The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Fixes: #130, #638