datasone / setup_var.efi

UEFI command-line tool for read/write access of variables
Apache License 2.0
221 stars 8 forks source link

Modifing a CpuSmm store value using CpuSetup on accident (not issue) #22

Open ElephantTweakerdeblaterSAK opened 3 months ago

ElephantTweakerdeblaterSAK commented 3 months ago

I know this may not be the best place to put it , I used your old grub efi, I am going to switch to the new one. I was able to modify lots of bios settings with it but particularly I tried to disable smm stuff and it said successful. But in bios it didn't change, I realized that I wrote down the wrong var store , I put CpuSetup instead of CpuSmm for the var store. I had realized that today. Did I mess anything up , as my PC was never bricked and I've updated my bois firmware multiple times since then. I also have taken out cmos lots of times since then.
These are the things I tried to disable with it SMM MSR Save State Enable | VarStore: CpuSmm | VarOffset: 0x0 | Size: 0x1     Disabled: 0x0     Enabled: 0x1                                                                                                                         CPU SMM Enhancement SMM Code Access Check | VarStore: CpuSmm | VarOffset: 0x1 | Size: 0x1     Disabled: 0x0     Enabled: 0x1                                                                                                                         CPU SMM Enhancement SMM Use Delay Indication | VarStore: CpuSmm | VarOffset: 0x2 | Size: 0x1     Disabled: 0x0     Enabled: 0x1                                                                                                                         CPU SMM Enhancement SMM Use Block Indication | VarStore: CpuSmm | VarOffset: 0x3 | Size: 0x1     Disabled: 0x0     Enabled: 0x1                                                                                                                         CPU SMM Enhancement SMM Use SMM en-US Indication | VarStore: CpuSmm | VarOffset: 0x4 | Size: 0x1     Disabled: 0x0     Enabled: 0x1                                                                                                                         CPU SMM Enhancement DGR+NR11 / NR10 Support | VarStore: CpuSmm | VarOffset: 0x6 | Size: 0x1     NR10: 0x0     DGR_NR11: 0x1 . These settings are visible in my bios anyways , also it didn't touch them as it wasn't the right Var store. Is everything okay. I have anxiety. Thank you.

ElephantTweakerdeblaterSAK commented 3 months ago

I know this may not be the best place to put it , I used your old grub efi, I am going to switch to the new one. I was able to modify lots of bios settings with it but particularly I tried to disable smm stuff and it said successful. But in bios it didn't change, I realized that I wrote down the wrong var store , I put CpuSetup instead of CpuSmm for the var store. I had realized that today. Did I mess anything up , as my PC was never bricked and I've updated my bois firmware multiple times since then. I also have taken out cmos lots of times since then. These are the things I tried to disable with it SMM MSR Save State Enable | VarStore: CpuSmm | VarOffset: 0x0 | Size: 0x1     Disabled: 0x0     Enabled: 0x1                                                                                                                         CPU SMM Enhancement SMM Code Access Check | VarStore: CpuSmm | VarOffset: 0x1 | Size: 0x1     Disabled: 0x0     Enabled: 0x1                                                                                                                         CPU SMM Enhancement SMM Use Delay Indication | VarStore: CpuSmm | VarOffset: 0x2 | Size: 0x1     Disabled: 0x0     Enabled: 0x1                                                                                                                         CPU SMM Enhancement SMM Use Block Indication | VarStore: CpuSmm | VarOffset: 0x3 | Size: 0x1     Disabled: 0x0     Enabled: 0x1                                                                                                                         CPU SMM Enhancement SMM Use SMM en-US Indication | VarStore: CpuSmm | VarOffset: 0x4 | Size: 0x1     Disabled: 0x0     Enabled: 0x1                                                                                                                         CPU SMM Enhancement DGR+NR11 / NR10 Support | VarStore: CpuSmm | VarOffset: 0x6 | Size: 0x1     NR10: 0x0     DGR_NR11: 0x1 . These settings are visible in my bios anyways , also it didn't touch them as it wasn't the right Var store. Is everything okay. I have anxiety. Thank you.

I've touched them many times since then in the bios and it's been fine.

ElephantTweakerdeblaterSAK commented 3 months ago

@datasone

datasone commented 3 months ago

What's the corresponding values with these VarOffsets in CpuSetup? You can use that to confirm which settings are touched.

Though I think the low addresses in CpuSetup are often not used to store settings, that may be why it doesn't affect much on your PC.

ElephantTweakerdeblaterSAK commented 3 months ago

What's the corresponding values with these VarOffsets in CpuSetup? You can use that to confirm which settings are touched.

Though I think the low addresses in CpuSetup are often not used to store settings, that may be why it doesn't affect much on your PC.

Can you elaborate. From what I'm understanding of what you said you think that I edited CpuSetup settings correctly . What I'm saying is when I tried to use the syntax of applying many settings a long time ago I used the wrong var store which means those values weren't modified but I'm scared it changed stuff. If you change settings with the wrong var store that those settings do not exist in. Does it make glitch values stored in a secret place which not even a cmos reset plus bios update can fix or does cmos reset the whole motherboard and the bios update removes these values if they are even written. Sorry for my English it happens when I'm nervous and don't know how to write correctly.

ElephantTweakerdeblaterSAK commented 3 months ago

What's the corresponding values with these VarOffsets in CpuSetup? You can use that to confirm which settings are touched.

Though I think the low addresses in CpuSetup are often not used to store settings, that may be why it doesn't affect much on your PC.

I didn't edit it though, I edited basically a value I was supposed to edit in the different var store. But I edited it in CpuSetup which is not the var store in which the setting is stored in . Is it even changing anything at all?

ElephantTweakerdeblaterSAK commented 3 months ago

What's the corresponding values with these VarOffsets in CpuSetup? You can use that to confirm which settings are touched.

Though I think the low addresses in CpuSetup are often not used to store settings, that may be why it doesn't affect much on your PC.

Ohh okay , I realized I messed up I see what you wrote now. I did realize that is not just these settings. Do you have a definitive answer if resetting the cmos does revert everything or no.

ElephantTweakerdeblaterSAK commented 3 months ago

I thought I miscommunicated, I guess I did not read properly, so sorry.

ElephantTweakerdeblaterSAK commented 3 months ago

I will check these specific values , I just hope that I could completely revert anything possible just with cmos battery removal plus bios update.

ElephantTweakerdeblaterSAK commented 3 months ago

Honestly based on what I'm seeing one value I put here because of using the wrong var store ended up modifying peci . Shouldn't all settings modified even ones with that don't change anything be completely reset and cleared or no?.

datasone commented 2 months ago

What's the corresponding values with these VarOffsets in CpuSetup? You can use that to confirm which settings are touched. Though I think the low addresses in CpuSetup are often not used to store settings, that may be why it doesn't affect much on your PC.

Ohh okay , I realized I messed up I see what you wrote now. I did realize that is not just these settings. Do you have a definitive answer if resetting the cmos does revert everything or no.

It's heavily implementation-dependent, but for these varstore used for setting items I think a reset will do the work.

About "implementation-dependent": the varstores are just like configuration files, so it's up to BIOS code to decide whether to read it and how to interpret and apply the values, as well as what to do while resetting CMOS. But most modern UEFI BIOS should handle this correctly (i.e. overwriting changed values with preset). In your case about PCIe settings, there may be possibilities that BIOS just ignores it or the changed settings doesn't effect your current system setup (e.g. the corresponding PCIe slot or feature is not in use). So it doesn't brick or do any damage to your system.

ElephantTweakerdeblaterSAK commented 2 months ago

What's the corresponding values with these VarOffsets in CpuSetup? You can use that to confirm which settings are touched. Though I think the low addresses in CpuSetup are often not used to store settings, that may be why it doesn't affect much on your PC.

Ohh okay , I realized I messed up I see what you wrote now. I did realize that is not just these settings. Do you have a definitive answer if resetting the cmos does revert everything or no.

It's heavily implementation-dependent, but for these varstore used for setting items I think a reset will do the work.

About "implementation-dependent": the varstores are just like configuration files, so it's up to BIOS code to decide whether to read it and how to interpret and apply the values, as well as what to do while resetting CMOS. But most modern UEFI BIOS should handle this correctly (i.e. overwriting changed values with preset). In your case about PCIe settings, there may be possibilities that BIOS just ignores it or the changed settings doesn't effect your current system setup (e.g. the corresponding PCIe slot or feature is not in use). So it doesn't brick or do any damage to your system.

Thanks so much for the reply, I have said these aren't the only settings as I realized even more var stores were wrongly used. I also updated firmware. And I fully took out cmos. If I did all this can I verify that it is fully stock. I want my tests as accurate as possible as I test tweaks ,I would like to ensure that I have a clean slate for testing. If it doesn't clear after all this how can we verify if everything is stock. As isn't the bios files that you get have all values set from that file. I mean any visible settings I think appears reset.

ElephantTweakerdeblaterSAK commented 2 months ago

Another example of me using the wrong var store was for a EC notification, cs pl1 limit, cs pl1 value, Intel rmt state, hw notification and lots of pep settings

ElephantTweakerdeblaterSAK commented 2 months ago

I can't remember all I don't think. Hopefully that's all.

ElephantTweakerdeblaterSAK commented 2 months ago

Intel ready mode technology I think too.

ElephantTweakerdeblaterSAK commented 2 months ago

Using their real vars , not all work. I'm assuming some are locked in my machine. As some fail.

ElephantTweakerdeblaterSAK commented 2 months ago

This is not about the incorrect vars I don't think but when I tweak my bios it resets after like 4 restarts , I traced what caused it , it was applying the imon slope tweak , also disabling memory scrambler causes it. Even after all this it seems fine but it occasionally resets after mabye 10 restarts. This is in the physical bios.

datasone commented 2 months ago

What's the corresponding values with these VarOffsets in CpuSetup? You can use that to confirm which settings are touched. Though I think the low addresses in CpuSetup are often not used to store settings, that may be why it doesn't affect much on your PC.

Ohh okay , I realized I messed up I see what you wrote now. I did realize that is not just these settings. Do you have a definitive answer if resetting the cmos does revert everything or no.

It's heavily implementation-dependent, but for these varstore used for setting items I think a reset will do the work. About "implementation-dependent": the varstores are just like configuration files, so it's up to BIOS code to decide whether to read it and how to interpret and apply the values, as well as what to do while resetting CMOS. But most modern UEFI BIOS should handle this correctly (i.e. overwriting changed values with preset). In your case about PCIe settings, there may be possibilities that BIOS just ignores it or the changed settings doesn't effect your current system setup (e.g. the corresponding PCIe slot or feature is not in use). So it doesn't brick or do any damage to your system.

Thanks so much for the reply, I have said these aren't the only settings as I realized even more var stores were wrongly used. I also updated firmware. And I fully took out cmos. If I did all this can I verify that it is fully stock. I want my tests as accurate as possible as I test tweaks ,I would like to ensure that I have a clean slate for testing. If it doesn't clear after all this how can we verify if everything is stock. As isn't the bios files that you get have all values set from that file. I mean any visible settings I think appears reset.

Well, the IFR extractor will give you the default value of the settings, but as you've reset as well as updated the firmware, I don't see it necessary to recheck the values. It's very time consuming, and some values may actually be changed to suit the exact hardware configuration (many similar hardwares, e.g. with different CPUs, may share same BIOS, so some settings maybe changed according to the real configuration). And as we've discussed, some of the values changed haven't and won't take effect, so it's not necessary I think.

ElephantTweakerdeblaterSAK commented 2 months ago

What's the corresponding values with these VarOffsets in CpuSetup? You can use that to confirm which settings are touched. Though I think the low addresses in CpuSetup are often not used to store settings, that may be why it doesn't affect much on your PC.

Ohh okay , I realized I messed up I see what you wrote now. I did realize that is not just these settings. Do you have a definitive answer if resetting the cmos does revert everything or no.

It's heavily implementation-dependent, but for these varstore used for setting items I think a reset will do the work. About "implementation-dependent": the varstores are just like configuration files, so it's up to BIOS code to decide whether to read it and how to interpret and apply the values, as well as what to do while resetting CMOS. But most modern UEFI BIOS should handle this correctly (i.e. overwriting changed values with preset). In your case about PCIe settings, there may be possibilities that BIOS just ignores it or the changed settings doesn't effect your current system setup (e.g. the corresponding PCIe slot or feature is not in use). So it doesn't brick or do any damage to your system.

Thanks so much for the reply, I have said these aren't the only settings as I realized even more var stores were wrongly used. I also updated firmware. And I fully took out cmos. If I did all this can I verify that it is fully stock. I want my tests as accurate as possible as I test tweaks ,I would like to ensure that I have a clean slate for testing. If it doesn't clear after all this how can we verify if everything is stock. As isn't the bios files that you get have all values set from that file. I mean any visible settings I think appears reset.

Well, the IFR extractor will give you the default value of the settings, but as you've reset as well as updated the firmware, I don't see it necessary to recheck the values. It's very time consuming, and some values may actually be changed to suit the exact hardware configuration (many similar hardwares, e.g. with different CPUs, may share same BIOS, so some settings maybe changed according to the real configuration). And as we've discussed, some of the values changed haven't and won't take effect, so it's not necessary I think.

I already know this , some dont have default values shown in the extractor though. Mabye cause I format it. But if I'm a professional PC tweaker and I want to test can I safely say I'm on stock if I update firmware with a nvram reset checked plus I take out the cmos battery before then.

ElephantTweakerdeblaterSAK commented 2 months ago

What's the corresponding values with these VarOffsets in CpuSetup? You can use that to confirm which settings are touched. Though I think the low addresses in CpuSetup are often not used to store settings, that may be why it doesn't affect much on your PC.

Ohh okay , I realized I messed up I see what you wrote now. I did realize that is not just these settings. Do you have a definitive answer if resetting the cmos does revert everything or no.

It's heavily implementation-dependent, but for these varstore used for setting items I think a reset will do the work. About "implementation-dependent": the varstores are just like configuration files, so it's up to BIOS code to decide whether to read it and how to interpret and apply the values, as well as what to do while resetting CMOS. But most modern UEFI BIOS should handle this correctly (i.e. overwriting changed values with preset). In your case about PCIe settings, there may be possibilities that BIOS just ignores it or the changed settings doesn't effect your current system setup (e.g. the corresponding PCIe slot or feature is not in use). So it doesn't brick or do any damage to your system.

Thanks so much for the reply, I have said these aren't the only settings as I realized even more var stores were wrongly used. I also updated firmware. And I fully took out cmos. If I did all this can I verify that it is fully stock. I want my tests as accurate as possible as I test tweaks ,I would like to ensure that I have a clean slate for testing. If it doesn't clear after all this how can we verify if everything is stock. As isn't the bios files that you get have all values set from that file. I mean any visible settings I think appears reset.

Well, the IFR extractor will give you the default value of the settings, but as you've reset as well as updated the firmware, I don't see it necessary to recheck the values. It's very time consuming, and some values may actually be changed to suit the exact hardware configuration (many similar hardwares, e.g. with different CPUs, may share same BIOS, so some settings maybe changed according to the real configuration). And as we've discussed, some of the values changed haven't and won't take effect, so it's not necessary I think.

But I have stated that I changed more and I'm unsure if that's everything I changed, if you check a few I posted.

datasone commented 2 months ago

Well, in short though we can't be 100% sure, it's safe to say all setting values (that effect the PC) are back to default after resetting the BIOS and a firmware update.

ElephantTweakerdeblaterSAK commented 2 months ago

Well, in short though we can't be 100% sure, it's safe to say all setting values (that effect the PC) are back to default after resetting the BIOS and a firmware update.

Thank you, I'm glad to know, thanks so much for the help. I wish I could create a grub automation tool called Genicity, Earth from AMITs server hated the idea saying it would brick PCs and I see what he would mean, not everyone has time to reset their cmos but I think it would be really cool if I at least automated it for my self, and then made a cmd that makes a efi boot partition that autobots runs grub tweaks , which you would have to drag your ROM into a cmd window, it would extract it , search for the var store and variable based of a list then it would add to a grub config , boot it run it then remove the efi partition. It's a cool concept but I've been made fun of for this idea. I got timed out it AMITs server for it back when I was a public tweaker.

ElephantTweakerdeblaterSAK commented 2 months ago

Well, in short though we can't be 100% sure, it's safe to say all setting values (that effect the PC) are back to default after resetting the BIOS and a firmware update.

One more thing, I told you how I changed more , so does this still apply, as I said those were not the only ones I did with the wrong var store.

ElephantTweakerdeblaterSAK commented 1 month ago

@datasone I'm still quite worried about this and came across an spi programmer, with it I should be able to ensure defaults, correct? If theirs anyway else without purchasing something it would be nice to, but I'd love to learn about moding bios's and not have any worry about bricking it as I will have this. I also have another question, how come your new var tool seems to not boot on my PC even with secure boot disabled.

datasone commented 1 month ago

Well it's a CLI tool intended to be used under UEFI shell, so it can't be directly booted.

ElephantTweakerdeblaterSAK commented 1 month ago

Well it's a CLI tool intended to be used under UEFI shell, so it can't be directly booted.

I'm not to familiar with motherboard mechanisms but I do know I have a uefi bios , how would I boot it. Also do you know anything regarding on ensuring my bios is defaults. I'm okay with any method to do it no matter how much time it takes. I spent 4 plus hours today writing down vars I'm going to try to automate just for my self.

ElephantTweakerdeblaterSAK commented 1 month ago

Thank you so much, I ended up looking a lot into why it wasn't working because you talked about using another efi shell, I found it and got it working but I spent 4 hours writing a list of legacy commands and I cant get them working in the new version.

ElephantTweakerdeblaterSAK commented 1 month ago

I do feel the need to still know if theirs anyway I can ensure my bios is stock.