Skip to content

Commit 93b3ed5

Browse files
committed
Revert "Enable jcardsim simulator for Strongbox via new flag."
This reverts commit 449942b. Bug: b/417821103
1 parent e36b361 commit 93b3ed5

10 files changed

Lines changed: 1 addition & 78 deletions

File tree

base/cvd/cuttlefish/host/commands/assemble_cvd/bootconfig_args.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -210,21 +210,6 @@ Result<std::unordered_map<std::string, std::string>> BootconfigArgsFromConfig(
210210
? "com.android.hardware.gatekeeper.nonsecure"
211211
: "com.android.hardware.gatekeeper.cf_remote";
212212

213-
// jcardsimulator
214-
if (secure_hals.count(SecureHal::kGuestStrongboxInsecure)) {
215-
bootconfig_args
216-
["androidboot.vendor.apex.com.android.hardware.secure_element"] =
217-
"com.android.hardware.secure_element_jcardsim";
218-
bootconfig_args["androidboot.vendor.apex.com.android.hardware.strongbox"] =
219-
"com.android.hardware.strongbox";
220-
} else {
221-
bootconfig_args
222-
["androidboot.vendor.apex.com.android.hardware.secure_element"] =
223-
"com.android.hardware.secure_element";
224-
bootconfig_args["androidboot.vendor.apex.com.android.hardware.strongbox"] =
225-
"none";
226-
}
227-
228213
bootconfig_args
229214
["androidboot.vendor.apex.com.android.hardware.graphics.composer"] =
230215
instance.hwcomposer() == kHwComposerDrm

base/cvd/cuttlefish/host/commands/assemble_cvd/flags.cc

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -480,10 +480,6 @@ DEFINE_vec(enable_audio, fmt::format("{}", CF_DEFAULTS_ENABLE_AUDIO),
480480
DEFINE_vec(enable_usb, fmt::format("{}", CF_DEFAULTS_ENABLE_USB),
481481
"Whether to allow USB passthrough on the device");
482482

483-
DEFINE_vec(enable_jcard_simulator,
484-
fmt::format("{}", CF_DEFAULTS_ENABLE_JCARD_SIMULATOR),
485-
"Whether to allow host jcard simulator on the device");
486-
487483
DEFINE_vec(camera_server_port, std::to_string(CF_DEFAULTS_CAMERA_SERVER_PORT),
488484
"camera vsock port");
489485

@@ -1313,8 +1309,6 @@ Result<CuttlefishConfig> InitializeCuttlefishConfiguration(
13131309
CF_EXPECT(GET_FLAG_STR_VALUE(vhost_user_vsock));
13141310
std::vector<std::string> ril_dns_vec =
13151311
CF_EXPECT(GET_FLAG_STR_VALUE(ril_dns));
1316-
std::vector<bool> enable_jcard_simulator_vec =
1317-
CF_EXPECT(GET_FLAG_BOOL_VALUE(enable_jcard_simulator));
13181312

13191313
// At this time, FLAGS_enable_sandbox comes from SetDefaultFlagsForCrosvm
13201314
std::vector<bool> enable_sandbox_vec = CF_EXPECT(GET_FLAG_BOOL_VALUE(
@@ -1592,25 +1586,6 @@ Result<CuttlefishConfig> InitializeCuttlefishConfiguration(
15921586
instance.set_audio_output_streams_count(
15931587
guest_configs[instance_index].output_audio_streams_count);
15941588

1595-
// jcardsim
1596-
instance.set_enable_jcard_simulator(
1597-
enable_jcard_simulator_vec[instance_index]);
1598-
1599-
if (enable_jcard_simulator_vec[instance_index]) {
1600-
const auto& secure_hals = CF_EXPECT(tmp_config_obj.secure_hals());
1601-
if (0 == secure_hals.count(SecureHal::kGuestStrongboxInsecure)) {
1602-
// When the enable_jcard_simulator flag is enabled, include the keymint
1603-
// and secure_element hals, which interact with jcard simulator.
1604-
static constexpr char kDefaultSecure[] =
1605-
"oemlock,guest_keymint_insecure,guest_gatekeeper_insecure,guest_"
1606-
"strongbox_insecure";
1607-
1608-
auto secure_hals = CF_EXPECT(ParseSecureHals(kDefaultSecure));
1609-
CF_EXPECT(ValidateSecureHals(secure_hals));
1610-
tmp_config_obj.set_secure_hals(secure_hals);
1611-
}
1612-
}
1613-
16141589
if (vhost_user_vsock_vec[instance_index] == kVhostUserVsockModeAuto) {
16151590
std::set<Arch> default_on_arch = {Arch::Arm64};
16161591
if (guest_configs[instance_index].vhost_user_vsock) {

base/cvd/cuttlefish/host/commands/assemble_cvd/flags_defaults.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,6 @@
218218
// USB Passhtrough default parameters
219219
#define CF_DEFAULTS_ENABLE_USB false
220220

221-
// Jcardsim default parameters
222-
#define CF_DEFAULTS_ENABLE_JCARD_SIMULATOR false
223-
224221
// Streaming default parameters
225222
#define CF_DEFAULTS_START_WEBRTC false
226223
#define CF_DEFAULTS_START_WEBRTC_SIG_SERVER true

base/cvd/cuttlefish/host/libs/config/cuttlefish_config.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,6 @@ class CuttlefishConfig {
638638
bool fail_fast() const;
639639
bool vhost_user_block() const;
640640
std::string ti50_emulator() const;
641-
bool enable_jcard_simulator() const;
642641

643642
// Kernel and bootloader logging
644643
bool enable_kernel_log() const;
@@ -877,8 +876,6 @@ class CuttlefishConfig {
877876
void set_fail_fast(bool fail_fast);
878877
void set_vhost_user_block(bool qemu_vhost_user_block);
879878
void set_ti50_emulator(const std::string& ti50_emulator);
880-
// jcardsim
881-
void set_enable_jcard_simulator(bool enable);
882879

883880
// Kernel and bootloader logging
884881
void set_enable_kernel_log(bool enable_kernel_log);

base/cvd/cuttlefish/host/libs/config/cuttlefish_config_instance.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,16 +1164,6 @@ std::string CuttlefishConfig::InstanceSpecific::ti50_emulator() const {
11641164
return (*Dictionary())[kTi50].asString();
11651165
}
11661166

1167-
// jcardsim
1168-
static constexpr char kEnableJcardSimulator[] = "enable_jcard_simulator";
1169-
void CuttlefishConfig::MutableInstanceSpecific::set_enable_jcard_simulator(
1170-
bool enable_jcard_simulator) {
1171-
(*Dictionary())[kEnableJcardSimulator] = enable_jcard_simulator;
1172-
}
1173-
bool CuttlefishConfig::InstanceSpecific::enable_jcard_simulator() const {
1174-
return (*Dictionary())[kEnableJcardSimulator].asBool();
1175-
}
1176-
11771167
static constexpr char kEnableWebRTC[] = "enable_webrtc";
11781168
void CuttlefishConfig::MutableInstanceSpecific::set_enable_webrtc(bool enable_webrtc) {
11791169
(*Dictionary())[kEnableWebRTC] = enable_webrtc;

base/cvd/cuttlefish/host/libs/config/secure_hals.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ NoDestructor<std::unordered_map<std::string_view, SecureHal>> kMapping([] {
5151
{"oemlock", SecureHal::kHostOemlockSecure},
5252
{"host_oemlock_secure", SecureHal::kHostOemlockSecure},
5353
{"host_secure_oemlock", SecureHal::kHostOemlockSecure},
54-
{"guest_strongbox_insecure", SecureHal::kGuestStrongboxInsecure},
5554
};
5655
}());
5756

@@ -116,8 +115,6 @@ std::string ToString(SecureHal hal_in) {
116115
return "host_oemlock_insecure";
117116
case SecureHal::kHostOemlockSecure:
118117
return "host_oemlock_secure";
119-
case SecureHal::kGuestStrongboxInsecure:
120-
return "guest_strongbox_insecure";
121118
}
122119
}
123120

base/cvd/cuttlefish/host/libs/config/secure_hals.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ enum class SecureHal {
2626
kGuestGatekeeperInsecure,
2727
kGuestKeymintInsecure,
2828
kGuestKeymintTrustyInsecure,
29-
kGuestStrongboxInsecure,
3029
kHostKeymintInsecure,
3130
kHostKeymintSecure,
3231
kHostGatekeeperInsecure,

base/cvd/cuttlefish/host/libs/vm_manager/crosvm_manager.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -887,15 +887,6 @@ Result<std::vector<MonitorCommand>> CrosvmManager::StartCommands(
887887
crosvm_cmd.AddHvcSink();
888888
}
889889

890-
if (instance.enable_jcard_simulator()) {
891-
// /dev/hvc17 = JCardSimulator
892-
crosvm_cmd.AddHvcReadWrite(
893-
instance.PerInstanceInternalPath("jcardsim_fifo_vm.out"),
894-
instance.PerInstanceInternalPath("jcardsim_fifo_vm.in"));
895-
} else {
896-
crosvm_cmd.AddHvcSink();
897-
}
898-
899890
for (auto i = 0; i < VmManager::kMaxDisks - disk_num; i++) {
900891
crosvm_cmd.AddHvcSink();
901892
}

base/cvd/cuttlefish/host/libs/vm_manager/qemu_manager.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -656,13 +656,6 @@ Result<std::vector<MonitorCommand>> QemuManager::StartCommands(
656656
add_hvc_sink();
657657
}
658658

659-
if (instance.enable_jcard_simulator()) {
660-
// /dev/hvc17 = keymint (jcardsim implementation)
661-
add_hvc(instance.PerInstanceInternalPath("jcardsim_fifo_vm"));
662-
} else {
663-
add_hvc_sink();
664-
}
665-
666659
auto disk_num = instance.virtual_disk_paths().size();
667660

668661
for (auto i = 0; i < VmManager::kMaxDisks - disk_num; i++) {

base/cvd/cuttlefish/host/libs/vm_manager/vm_manager.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ class VmManager {
6464
// - /dev/hvc14 = MCU control
6565
// - /dev/hvc15 = MCU UART
6666
// - /dev/hvc16 = Ti50 TPM FIFO
67-
// - /dev/hvc17 = jcardsimulator
68-
static const int kDefaultNumHvcs = 18;
67+
static const int kDefaultNumHvcs = 17;
6968

7069
// This is the number of virtual disks (block devices) that should be
7170
// configured by the VmManager. Related to the description above regarding

0 commit comments

Comments
 (0)